-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
Hey, I was wondering what happens if you set both take profit and stop loss on an order, and the next candle fluctuates in a manner that should trigger both. What gets priority according to the backtest? (given the fact we cant know the order of events within the candle).
For example: you set a market order with tp=2 and sl=1, and the next candle has high=3 and low=0.
Beta Was this translation helpful? Give feedback.
All reactions
If you enter with a plain market order, SL has priority (the framework takes an adversarial, rather than an optimistic stance).
If you enter with a stop/limit order, a warning is emitted:
backtesting.py/backtesting/backtesting.py
Lines 905 to 915 in a49122c
Replies: 1 comment 1 reply
-
If you enter with a plain market order, SL has priority (the framework takes an adversarial, rather than an optimistic stance).
If you enter with a stop/limit order, a warning is emitted:
backtesting.py/backtesting/backtesting.py
Lines 905 to 915 in a49122c
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you!
Beta Was this translation helpful? Give feedback.