First of all, for me, that is what an SL is for. if you base it on ATR, that could give your EA a good idea that you’re wrong with your assumption and the need to exit a trade is present.
But if you want a specific exit rule that contains “IF x bars has passed after order opened AND Another-Condition THEN close order ” that would depend on the trading strategy you are trying to code, and what would be an indication of “going the wrong way” or a “reversal” for you.
For example, maybe you want to use Fibonacci levels (38.2%, 50.0% and 61.8% ) to determine a bar closed beyond/above them which means reversal probability for you? Maybe pivot points is best for that assumption? maybe candlestick patterns? (Though IMO they’re useless).
So have your strategy in mind, and you can code it..
You must be logged in to reply to this topic.