Analyser votre stratégie

Trading financier en R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

Notre stratégie

  • Acheter quand :
    • moyenne mobile 50 jours > moyenne mobile 200 jours
    • et dvo < 20
  • Vendre quand :
    • moyenne mobile 50 jours < moyenne mobile 200 jours
    • ou dvo > 80
Trading financier en R

Exécuter votre stratégie

Appliquer votre stratégie

applyStrategy(strategy = strategy.st, 
              portfolios = portfolio.st)

Mettre à jour le portefeuille

updatePortf(portfolio.st)
daterange <- time(getPortfolio(portfolio.st)$summary)[-1]

Mettre à jour le compte

updateAcct(account.st, daterange)
updateEndEq(account.st)
Trading financier en R
tStats  <- tradeStats(Portfolios = portfolio.st)
tStats
    Portfolio    Symbol    Num.Txns    Num.Trades    Net.Trading.PL    
LQD  firstStrat    LQD       382          156           25681.09     
     Avg.Trade.PL    Med.Trade.PL    Largest.Winner   Largest.Loser   
LQD   164.6223      363.0143         2981.424        -7012.523          
   Gross.Profits    Gross.Losses   Std.Dev.Trade.PL  Percent.Positive      
LQD   77251.33      -51570.24        1174.442          66.66667           
    Percent.Negative   Profit.Factor   Avg.Win.Trade   Med.Win.Trade  
LQD    32.69231           1.497983        742.8012         624.5683        
    Avg.Losing.Trade  Med.Losing.Trade   Avg.Daily.PL   Med.Daily.PL   
LQD     -1011.181        -660.7456          164.6223       363.0143     
     Std.Dev.Daily.PL  Ann.Sharpe   Max.Drawdown   Profit.To.Max.Draw    
LQD         1174.442        2.225141     -10625.62           2.416903           
    Avg.WinLoss.Ratio    Med.WinLoss.Ratio     Max.Equity   Min.Equity     
LQD         0.7345877            0.9452477      27567.98    -1550.332      
    End.Equity
LQD    25681.09
Trading financier en R

Caractéristiques des systèmes de trading

  • Systèmes basés sur moyennes mobiles/tendance
    • Ratio gain/perte moyen élevé (supérieur à 1)
    • Faible pourcentage de gains (inférieur à 50 %)
  • Systèmes basés sur oscillation/retour à la moyenne :
    • Fort pourcentage de gains (supérieur à 50 %)
    • Ratio gain/perte moyen faible (inférieur à 1)
Trading financier en R

Passons à la pratique !

Trading financier en R

Preparing Video For Download...