Impostare una strategia I

Trading finanziario in R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

Tre date importanti

  • quantstrat richiede un initDate, una data from e una data to.

  • YYYY-MM-DD, es. “2000-01-01”

initdate <- "1999-01-01"
from <- "2003-01-01"
to <- "2015-12-31"
Trading finanziario in R

Configurare quantstrat

# Imposta il fuso orario di sistema:
Sys.setenv(TZ = "UTC")
# Imposta la valuta (usiamo USD per ora):
currency("USD")
# Ottieni i dati finanziari:
getSymbols("LQD", from = from, to = to, 
           src = "yahoo", adjust = TRUE)
# Tratta come azione base
stock("LQD", currency = "USD", multiplier = 1)
Trading finanziario in R

Panoramica

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 finanziario in R

Ayo berlatih!

Trading finanziario in R

Preparing Video For Download...