You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "..\backtrader_v1\strategies\base.py", line 191, in purchase
data.long_order = self.sell(exectype=bt.Order.StopTrail,
File "C:\Projects\Personal\Trading\trader\backtrader_v1\venv\lib\site-packages\backtrader\strategy.py", line 963, in sell
return self.broker.sell(
File "C:\Projects\Personal\Trading\trader\backtrader_v1\venv\lib\site-packages\alpaca_backtrader_api\alpacabroker.py", line 323, in sell
return self._transmit(order)
File "C:\Projects\Personal\Trading\trader\backtrader_v1\venv\lib\site-packages\alpaca_backtrader_api\alpacabroker.py", line 275, in _transmit
parent, stopside = self.opending.pop(pref)
ValueError: not enough values to unpack (expected 2, got 1)
Requirements.txt
alpaca-backtrader-api==0.15.0
setuptools==59.5.0
Long works fine alone, bracket orders work fine, but when I use the transmit=False and use the non-transmitted purchase as a parent I get this error. I'm basing my code on the example: https://www.backtrader.com/blog/posts/2018-02-01-stop-trading/stop-trading/ under the AutoStopOrStopTrail class. The ManualStopOrStopTrail class works fine because it doesn't leverage the parent and transmit=False feature, but it delays the submitting the trailing stop by a minute...so it's not optimal.
The text was updated successfully, but these errors were encountered:
I'm trying to buy for a long position with a trailing stop.
Source snippet:
Traceback:
Requirements.txt
Long works fine alone, bracket orders work fine, but when I use the
transmit=False
and use the non-transmitted purchase as a parent I get this error. I'm basing my code on the example: https://www.backtrader.com/blog/posts/2018-02-01-stop-trading/stop-trading/ under the AutoStopOrStopTrail class. The ManualStopOrStopTrail class works fine because it doesn't leverage theparent
andtransmit=False
feature, but it delays the submitting the trailing stop by a minute...so it's not optimal.The text was updated successfully, but these errors were encountered: