@run-out can you share the code that can runing successful.
Latest posts made by bebe
-
RE: I use dash and plotly ,plot the backtest result in one page
-
RE: I use dash and plotly ,plot the backtest result in one page
thanks for your demo code.
but when i debug the demo, I found the following code is not defined:
plot_results(results,"/home/yun/index_000300_reverse_strategy_hold_day_90.html")
trade_dict_1=OrderedDict()could you pls give the define.
thanks. -
RE: the SharpeRatio is not correct.
thanks. i will try ...
-
the SharpeRatio is not correct.
the SharpeRadio is not correct,how to fix it ?thanks
out put is:
test: OrderedDict([('sharperatio', None)])cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name = 'SharpeRatio') results=cerebro.run() strat =results[0] print('test:', strat.analyzers.SharpeRatio.get_analysis())
-
RE: how to test multi data
code_text if __name__ == '__main__': cerebro.adddata(data1) cerebro.adddata(data2) cerebro.adddata(data3) def init(self): self.sma = bt.indicators.SimpleMovingAverage( self.datas, 30) def next(self): if self.dataclose > self.sma: self.buy()
-
how to test multi data
dear all:
I am a fresher.
I want to test multi stock use same strategy.
how to write the test function?
the following is framework... anybody can share some code ?thanks.main:#add multi data
cerebro.adddata(data1)
cerebro.adddata(data2)
cerebro.adddata(data3)def init(self):
self.sma = bt.indicators.SimpleMovingAverage( self.datas, 30)
def next(self):
if self.dataclose > self.sma:
self.buy()