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
Hi there, I think there is an inconsistency between the implementation of backtrader StopLimit order and the alpaca-backtrader-api implemntation of Stop-Limits.
Hi there, I think there is an inconsistency between the implementation of backtrader
StopLimit
order and the alpaca-backtrader-api implemntation of Stop-Limits.According to backtrader (https://www.backtrader.com/docu/order-creation-execution/order-creation-execution/#stoplimit):
price
is the trigger priceplimit
is the limit priceFor instance:
order = self.buy(exectype=Order.StopLimit, price=self.data.close[0] * 1.02, plimit=self.data.close[0] * 1.07)
But according to line 707 from here: https://github.com/alpacahq/alpaca-backtrader-api/blob/master/alpaca_backtrader_api/alpacastore.py:
if order.exectype in [bt.Order.StopLimit, bt.Order.Stop]: okwargs['stop_price'] = order.created.pricelimit
In other words, the limit price I give to backtrader is used as a trigger price in alpaca.
Please let me know if I missed something. Thanks.
The text was updated successfully, but these errors were encountered: