Hi,
I cant properly set a strategy that has multi data feed (ie the components of sp500) and inside of next() method i ahve put a function call to my personal model .
in next method I am trying
def my_f(self, x):
y = randn() #ie my strategy called on data x
return y
def next(self):
if self.order:
return
ret={}
for d in self.datas:
ret[d]=self.my_f(d)
best_stock = min(ret, key=ret.get)
......
if not self.position:
self.buy(data=d,.....)
It doesnt work and it use just a small part of the dataset (ie I have data from 2019-2022, but i see only trades on the last 30 days)
If i run the strategy for each single data feed it works
best