@exu said in Analyzers stats when datas have only trading days:
just checking on how the built-in analyzers deal with that...
I fail to understand what the built-in analyzers have to deal with. They have de-facto default values (the ones mostly used by the industry/people/call-it-X) which you can customize to your liking.
@darian-hickman if you want to use bt writer than you can write an observer/analyzer which tracks in and out prices using notify_order or notify_trade. Some time ago I've created extended trades table and used notify_trade and tradehistory to get in and out prices. Check the link: Closed trade list (including MFE/MAE) analyzer
Many thanks again for your prompt reply and help. However, I am confused since I actually got this without any errors apart from the ones mentioned.
Isn't self.datas.lines.close equivalent to self.data.close(0)? I also understand that bt.If is redundant but I fail to see why these two lines would not produce the same results.
self.lines.signal = bt.If(self.datas.lines.close > self.params.threshold, 1, 0)
self.lines.signal = self.data.close(0) > self.p.threshold
I mean in a similar fashion I used
self.lines.signal = bt.If(self.datas.lines.close > self.datas.lines.close(-self.params.period), 1, 0)
self.lines.signal = self.data.close(0) > self.data.close(-self.p.period)
I have been having the same issue. I've tried the fixed code above and the conversion of matplotlib graph was only partially successful - the candle chart was eliminated and the plotly results seems distorted and unclear. Is there any other alternative for plotly support? I've seen OmegaUI, not sure I need something this sophisticated.
@xiaoy0521 on https://github.com/ftomassetti/backtrader-oandav20 there is some installation guide. In the directory examples, you will find oandav20test.py . This may help you get started.
also you need v20 instead of oandav20.
pip install v20
Great design! Friendly reminders:
Change commission to abs(commission) avoid sell/short results a negative commission...(and you know the consequence)
This commission does not include the cost of exchange (I.e nasdaq/amex). Additional mapping or charges are needed