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 as self.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 as self.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.