Which line in the data is SimpleMovingAverage based on?
In https://www.backtrader.com/docu/concepts.html , a moving average is constructed like this:
sma = btind.SimpleMovingAverage(self.datas, period=self.params.period)
Wouldn't self.datas contain several lines, i.e. self.datas.lines.close, self.datas.lines.open, self.datas.lines.min, etc. according to whatever columns are in our data table?
Which of these lines is the SMA based on? Follow up: does it ASSUME that we want compute SMA on "close" and are therefore required to include a "close" line in every data feed that is sent to the SMA function?
No. If no specific line is passed, the 1st defined line is used. In the case of regular data feeds,
closeis defined as the 1st line to match the de-facto standard which is to do things directly on the