For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
To datafeed number in bracket `self.datas[0].close[0]`
-
Newbie here. I would like to confirm what is the number in bracket indicate.
print (self.datas[0].close[0]) print (self.datas[-1].close[0]) print (self.datas[0].close[-1]) print (self.datas[0].close[-2]) print (self.datas[-1].close[-1]) print (self.datas[0].close[1])
From what I tested,
self.datas[0].close[0]
is close of current day.self.datas[-1].close[0]
is also same asself.datas[0].close[0]
.self.datas[0].close[-1]
is closing a day before.self.datas[0].close[1]
is a day after.Could someone experience can share what is the first number in bracket means? Since
self.datas[0].close[0]
is same asself.datas[-1].close[0]
from my testing.I am trying to set a buy in strategy if today close is higher than previous day close ans sell if today close is lower than yesterday close. So understanding the data is important.