danielkrizian / strategery

Quant Strategy Specification, Backtesting, Optimization And Statistical Analysis Workflow
10 stars 21 forks source link

Signal at the last timestamp results in incorrect Backtest() #9

Closed danielkrizian closed 10 years ago

danielkrizian commented 10 years ago

Run fomc strategy in examples to replicate:

beforeFOMC <- 4 # works for 2

FOMC <- indicator( FomcDay(Date, before=beforeFOMC), input=cal)

Long <- (FOMC==TRUE) %position% shares(1)
Neutral <- (FOMC!=TRUE) %position% shares(0)

Backtest()

Fix probably this part: image

resulting orders.filled with NAs for the timestamps when market data doesn't yet exist: image