-
What I observe from using backtesting.py is that long and short trades are executed on the same candle. Like in the given 'SMA-Crossover' example a short trade is closed and a long immediately starts. Since I use freqtrade which does not support executing both signals on the same candle I was wondering how to implement a rule that tells backpy to entry a trade on the next candle after closing the previous trade? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
IOW, you: self.position.close()
self.buy(...) This places two orders to be executed when the next candle opens. If you want to skip a candle, simply consider it all as a state machine. |
Beta Was this translation helpful? Give feedback.
-
Your solution worked out. This topic can be closed. Many thanks to you! |
Beta Was this translation helpful? Give feedback.
IOW, you:
This places two orders to be executed when the next candle opens.
If you want to skip a candle, simply consider it all as a state machine.