Définir une stratégie I

Trading financier en R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

Trois dates clés

  • Quantstrat requiert un initDate, une date from et une date to.

  • YYYY-MM-DD, par ex. « 2000-01-01 »

initdate <- "1999-01-01"
from <- "2003-01-01"
to <- "2015-12-31"
Trading financier en R

Configurer quantstrat

# Définir le fuseau horaire du système :
Sys.setenv(TZ = "UTC")
# Définir la devise (nous utiliserons USD pour l'instant) :
currency("USD")
# Récupérer les données financières :
getSymbols("LQD", from = from, to = to, 
           src = "yahoo", adjust = TRUE)
# Traiter comme une action de base
stock("LQD", currency = "USD", multiplier = 1)
Trading financier en R

Aperçu

initDate = "1999-01-01"
from = "2003-01-01"
to = "2015-12-31"
Sys.setenv(TZ = "UTC")
currency("USD")
getSymbols("LQD", from = from, to = to, src = "yahoo", 
           adjust = TRUE)        
Trading financier en R

Passons à la pratique !

Trading financier en R

Preparing Video For Download...