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
Consider a stop-loss order placed at a stop-loss price p. When the opening price is way below the stop-loss price p, I would expect the stop-loss order to be executed at the opening price.
Actual Behavior
The stop-loss order is executed at the stop-loss price p, which is way higher than the opening price.
Not sure if there is active maintenance of the library, but this trade_on_close bug was really annoying and found no other place that's mentioned.
Just in case anyone has solved that properly or still searching about it, I write below my dirty patch.
After checking, my backtesting results seem normal now in terms of filling price for the SL orders.
On the other hand, I am competely ignorant if these extra lines could cause any harmful side effect, so it would be nice if someone that checks that can tell her/his opinion.
Expected Behavior
Consider a stop-loss order placed at a stop-loss price
p
. When the opening price is way below the stop-loss pricep
, I would expect the stop-loss order to be executed at the opening price.Actual Behavior
The stop-loss order is executed at the stop-loss price
p
, which is way higher than the opening price.Steps to Reproduce
Additional info
trade_on_close
option isFalse
, the code works as expected.The text was updated successfully, but these errors were encountered: