No one has ever had this problem before? @backtrader in your opinion is it possible any workaround for this?
Latest posts made by emmepra
-
RE: Plot BuySell Observer with Tick Data
-
RE: Plot BuySell Observer with Tick Data
@backtrader Oh sure you’re totally right! I’m sorry, I’ve forgotten to say that I’ve modified the BuySell observer in order to try Barplot=True and Bardist=0, and this is the result.
Setting both to standard False and 0.015 produce the same result, the only difference is that arrows are a little more distant than 0.So, I truly hope to find a solution to this behaviour since those arrows are definetely useful!
-
RE: Plot BuySell Observer with Tick Data
Please don’t kill me but I haven’t understood your suggestion. I’ve read the doc-page of Observers-Reference, but in my particular situation what should I do to fit those BuySell arrrows?
Thank you so much!
-
Plot BuySell Observer with Tick Data
Hi everyone I'm trying to plot my strategy in order to observe it and improve but one of the fundamental Observers, the BuySell one, seems to now work!
I'm using TickData without resampling candles, OHLC values are all equal to the Price at which the tick was traded.
Initially the arrows appeared but way too distant from the price (50/100 points away), then after reading many community threads, I've tried to set:
cerebro = bt.Cerebro(stdstats=False) cerebro.addobserver(bt.observers.BuySell)
And this is the result:
Arrows appeared but almost randomly!
I've read that this behaviour could be cause by matplotlib misinterpreting the 0 distance between OHLC, but right now I've not found a way to handle this problem.Any idea about it?
Thank you very much -
RE: Issue with BuySell obverver plot from cerebro.plot(). Disappearing with few data points
Hey @Lammy have you solved this in the end?
I'm trying to handle this arrows misplacement problem with my tick data (single-tick value).
The only solution that I've found is to call:cerebro = bt.Cerebro(stdstats=False) cerebro.addobserver(bt.Observers.BuySell)
This way the arrows will be printed above/under the priceline and maybe, as in my case, too close to it. But I think is better to have it too close than not having at all!
Errata Corrige: this solution will lead to many problems when plotting more than one datas, I'm currently looking for another option to solve it!
-
RE: Dictionary as Lines Problem
Thank you for this reply Boss, I’m honored.
So you are telling me that Indicators can store things that evolve over time different than Lines?Could it be better to create a Strategy attribute wich will be updated each next() call?
-
Dictionary as Lines Problem
Hi everybody,
I'm a newbie of Backtrader and I'm still trying to learn on my own as much as I can of how it works, but I think that asking directly to experts, could be a much faster way to learn.So the problem is that I'm trying to develop a new indicator that will produce a lines but to calculate this it needs to employ a much complicated data structure as a dictionary.
In particular, it needs to store for each touched level of price how many times this price has been touched from a certain point in time to another. But as I've seen (and probably I'm wrong), there's no direct way to store something like this in an indicator:{price1: value1, price2: value2, price3: value3, ...}
The question is simple, is there a way to store a dictionary over time?
Thank you so much!