Indicator Period Days or Trading Days?
Just wanted to clarify a basic one - when you set the
periodin an indicator (i.e. SMA), is this period equal to trading days (i.e. count of dates in the data feed)... OR... calendar days?
bt.indicators.SimpleMovingAverage(d, period=30)for a theoretical ending date of 14 June 2017, will the window start on 15 May 2017, or several days earlier (if using trading days).
Curtis Miller last edited by
My understanding is most of the time parameters like
periodapply to data points, so that would imply trading days, or points in your data feed (in short, the first thing in your question). backtrader is not aware of time frames, just data points.
So it is, or else working in different timeframes wouldn't be feasible. Furthermore it would seem pointless to define a period of
30and get a different number of items in the calculation.
This is, on the other hand, nothing specific to this library.
Cool thanks guys