To those that may come across this thread, I cannot explain why the issue is occurring, but if you pass a name to the default data when utilizing 'adddata', the legend will look normal again. Fixed
#Don't use this:
#Use a name with the data:
The name comes across in the heading / legend of the master Bokeh plot as so:
when using multiple data sources, you will get notified of every change. when resampling, if data advances, on replay if data changes (in that case, data will not necessary advance). So to know if the data source advanced, you need to check the length of data.
if self._last_len > len(self.datas):
self._last_len = len(self.datas
self.dataclose = self.datas.close
# Order variable will contain ongoing order details/status
self.order = None
self.bb = bt.indicators.BBands(self.datas,
period = self.params.bbperiod,
devfactor = self.params.bbfactor,
self.ema = bt.indicators.EMA(self.datas, period=self.params.emaperiod)
This init has been used in other strategies and has no problems. I'm not sure what's going on.
I had heeded your advice. It taked me several days for studying documentation and at the end of the days, I've implemented sizer and bracket orders. Now it's better.
Thank you for the bracket feature that is really powerful.