What's strange, if I set the backtest
for H4, the candles wouldn't use timeLapsed, but when I set it to M1, it would work.
I saw you entered EventSetTimer(60); but when I deleted it, the effect wouldn't change.
Check again - when you run on H4, your SL and TP gets triggered within the candle itself, that's why new position is opened in the immediate next
candle. Things will be different if you enlarge your SL and TP accordingly.
PS. Oops... EventSetTimer(60) can be removed... it was automatically generated when I create the EA template...
Hello everyone, how are you? I hope I was testing your codes well, but when I click to collect, I get many errors, but everything is fine, can you please help me?
Machine translated to English from Spanish, by moderator
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Ran your code.
What's strange, if I set the backtest for H4, the candles wouldn't use timeLapsed, but when I set it to M1, it would work.
I saw you entered EventSetTimer(60); but when I deleted it, the effect wouldn't change.
Check again - when you run on H4, your SL and TP gets triggered within the candle itself, that's why new position is opened in the immediate next candle. Things will be different if you enlarge your SL and TP accordingly.
PS. Oops... EventSetTimer(60) can be removed... it was automatically generated when I create the EA template...
Hello everyone, how are you? I hope I was testing your codes well, but when I click to collect, I get many errors, but everything is fine, can you please help me?