0
self.one_pct = bt.indicators.RateOfChange(self.datas[0].close, period=1)
self.two_pct = bt.indicators.RateOfChange(self.datas[1].close, period=1)
self.three_pct = bt.indicators.RateOfChange(self.datas[2].close, period=1)
.....
self.n_pct = bt.indicators.RateOfChange(self.datas[n-1].close, period=1)

what I want to do is find the max one and buy like below

max_stock=findMaxpct()
self.buy(data=max_stock)

how to implement the find_max_pct efficient?

ChandlerSong
  • 387
  • 1
  • 14

0 Answers0