Analytique supplémentaire

Négociation financière en R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

Générer une série de profit et perte (P&L)

  • L'environnement blotter contient l'historique des transactions
  • Syntaxe pour le P&L :
portPL <- .blotter$portfolio.firststrat$summary$Net.Trading.PL
head(portPL)
           Net.Trading.PL
1999-01-01           0
2003-01-02           0
2003-01-03           0
2003-01-06           0
2003-01-07           0
2003-01-08           0
Négociation financière en R

Ratio de Sharpe

  • Peut être obtenu à partir du P&L de votre stratégie
  • Rapport entre récompense et risque de votre stratégie
SharpeRatio.annualized(portPL, geometric = FALSE)
                                   Net.Trading.PL
Annualized Sharpe Ratio (Rf=0%)         0.5166274
Négociation financière en R

Obtenir les rendements

  • Ratio entre le profit ou la perte d'une opération et le capital initial
  • Obtenir les rendements du portefeuille :
instrets <- 
      PortfReturns(account.st)
head(instrets, n = 3)
           LQD.DailyEndEq
2003-01-02           0
2003-01-03           0
2003-01-06           0
tail(instrets, n = 3)
            LQD.DailyEndEq
2015-12-29           0
2015-12-30           0
2003-12-31           0
Négociation financière en R

Obtenir le ratio de Sharpe sur les rendements

SharpeRatio.annualized(instrets, geometric = FALSE)
                                  LQD.DailyEndEq
Annualized Sharpe Ratio (Rf=0%)        0.488011
Négociation financière en R

Passons à la pratique !

Négociation financière en R

Preparing Video For Download...