AFAIK IB could only be requested to provide either ticks (default) or real-time 5 sec bars ( if rtbar parameter is set to True in getdata method). In case of ticks, backtrader is transforming it to look like bars with open/high/low/close prices set to the tick price.
In your case the ticks are requested ( rtbar is false by default) so you may get the 'tick' bar every time it is available ( could be much faster than 1 second depending on what your are trading). The fact that both timeframe and compression arguments were provided to the getdata method is irrelevant for live feed (they only used for getting the historical data AFAIR).
As for replay anomaly, I'm not sure here - probably others may help.
Hi, yes I'm aware I can read the source code, but 1) even if I tried, I'm certainly not good enough to identify any suspicious code, and 2) that would take me forever! I wonder how other people have approached this problem. Is there a shortcut to address security concerns?
If you are indeed as you say "planning to use Backtrader for institutional purposes" and "compliance with company cybersecurity policy" is a concern, you can either get your company's cybersecurity department to look into it, or get it audited by an independent cybersecurity firm.
It sounds like you have all the available resources from source code to institutional backing to make an evidence based decision instead of a faith-based one.
if inner timeperiod is not equal to outer timeperiod, and runonce=False, the got the following excetption:
File "/home/user/.local/lib/python3.7/site-packages/backtrader/lineiterator.py", line 347, in nextstart
File "/home/user/.local/lib/python3.7/site-packages/backtrader/talib.py", line 217, in next
out = self._tafunc(*narrays, **self.p._getkwargs())
File "/home/user/.local/lib/python3.7/site-packages/talib/__init__.py", line 27, in wrapper
return func(*args, **kwargs)
File "talib/_func.pxi", line 3323, in talib._ta_lib.LINEARREG_SLOPE
File "talib/_func.pxi", line 68, in talib._ta_lib.check_begidx1
Exception: inputs are all NaN
@daniel-cunha Add your 1-k indicators to your asset in pandas before loading, then load your close + k indicators together as one data feed. You will then have a data line for each asset that has the 1-k indicators in the same line.
Any updates on this topic? I am trying to obtain simpler risk management except that when the current close price is greater than 5% of my entry price, I want to be able to amend my initial stop loss to breakeven stop.
I tried using the bracket example in backtrader and manually add orders when the TP1 is obtained. Then I place a new order. However, when the trade is closed, that newly issued breakeven stop is still dangling.
Is there any example that shows how I can implement bracket order with amdendent?