Hey thank you for replying.
@backtrader said in Multi Data Feed Plotting Issue:
I fail to understand your expectation. They are not overlapping, they are close to each other, which is what one would expect when plotting to things with a very similar price on the same axis.
I am not saying those lines are overlapped. I said :
They overlapped and only ask data remains (top-left corner).
I mean those numbers on top-left corner. Sorry for confusing.
I want to show both bid and ask data feed's details on top-left corner, something like this:
sma_bid_open (15) 1.20
sma_bid_high (15) 1.20
sma_bid_low (15) 1.20
sma_bid_close (15) 1.20
bid_data (1 Min) O :1.20 H : 1.20 L : 1.20 C : 1.20
sma_ask_open (15) 1.20
sma_ask_high (15) 1.20
sma_ask_low (15) 1.20
sma_ask_close (15) 1.20
ask_data (1 Min) O :1.20 H : 1.20 L : 1.20 C : 1.20
Can it be done? If so, how?
Also I want to ask can I set both cheat-on-open and cheat-on-close to True ?
I mean like this : cerebro.broker.set_coc(True) and cerebro.broker.set_coo(True) at the same time.
Again, thank you for your reply.
@g_will said in How to calculate the highest close value in a period except current close value?:
# except current close value
close(-1) excludes the current close from the calculation, so it would seem to fit your purpose perfectly. Whether you use n or n - 1 is really up to your expectation of how many data points have to be included.
thanks for this thread. The behavior of my system is slightly different. Between -1100 and -1102 I get sometimes some None messages, or one or more RTVolume, - it changes from time to time, - but only during night, when IB is restarting something. When I simulate this case by interrupting the internet-connection everything works as it should work. I testet different versions of TWS/Gateway on Mac against IB papertrading. My fix is similar to @vytautas-a 's one.
Hi @Rodrigo Brito, On another note, have you faced any other major/minor issues/bugs while running the Backtrader+CCXT live so we need to be aware of before go live? Any special error handling or Binance broker specific issues we might face? Thanks
Many thanks for the explanation! It is now clear!
I'm realizing a multi symbol strategy can create a complex synchronization scenario. It is not enough to just copy a “single symbol” strategy, you need to pay attention to the many details and situations that can occur.
Thank you very much!
@momentum said in params values:
Depending on they way I try to get the coc value, sometimes I get the actual value and other the default value.
That's not accurate. You always get the same value using the same method. There is not "sometimes".
@momentum said in params values:
self.broker.params.coc, params_dict['coc'], self.broker.params._get('coc'))
Only the 1st one is the right one. The other are undocumented methods, to get the actual declared, active values.
Docs - Parameters - Section Parameters
There are additional methods with proper names (which were not expected to be used and are also only in the source code) which will specifically give you the defaults or not.
Floating point arithmetic.
I have written a system which uses high precision Decimals. Backtrader uses Floats.
I run a backtest through my system to verify the output of BT.
To do this, I must convert the source prices used in BT from Floats into Decimals.
After some iterations, with spreads involving subtraction and division, my indicators begin to diverge, presumably due to the increased rounding accuracy.
I would prefer to convert BT to use Decimals and this is why I asked the question.
Without searching the entire codebase for occurences of all numbers, I would like to ask the creator of this library for his view on how best to do this.