Experts: EXSR

 

EXSR:

EXSR.mq5: A counter‑trend MT5 EA that catches reversals by combining RSI(14) extremes with Bollinger Band breakouts and a reversal candlestick, placing one trade per symbol with fixed SL/TP.

Author: Le Trung Kien Hoang

 
The logic for determining whether a trade has been open in the current bar and, hence, avoiding the opening of new positions is incorrect; it depends on the server's time. Therefore, in the case of a significant movement, it's possible for multiple trades to be opened on the same bar, but not simultaneously. To solve this issue, make the time variable a global variable instead of static and use the iTime function for example datetime lastBarTime=0; void OnTick() { //--- Use a static variable to ensure logic runs only once per bar datetime barTime =iTime(_Symbol,_Period,0); if( barTime == lastBarTime) return; lastBarTime = barTime; .... rest of the code
 
Aws Kyoma #:
The logic for determining whether a trade has been open in the current bar and, hence, avoiding the opening of new positions is incorrect; it depends on the server's time. Therefore, in the case of a significant movement, it's possible for multiple trades to be opened on the same bar, but not simultaneously. To solve this issue, make the time variable a global variable instead of static and use the iTime function for example datetime lastBarTime=0; void OnTick() { //--- Use a static variable to ensure logic runs only once per bar datetime barTime =iTime(_Symbol,_Period,0); if( barTime == lastBarTime) return; lastBarTime = barTime; .... rest of the code

I published the new version based on your suggestion.

 
Where can new code be accessed ? 
[Deleted]  
@SHXDWmvp #Where can new code be accessed ? 

Use a desktop browser, not mobile, and follow the link on the first post ...