Looking at the StrategyTester report, I can't find that loss.
In the "Chart" session, there seems to be a small dip of only $1.7 on 2022-10-6.
In the "Results" section, I did find two losses on 2022-10-6: -1.65 + -1.68 = -3.33.
But those are orders number 21 and 22, not 23. Off by one? Maybe, but that is still a little far from 4.68.
You may think that either trade closed at only -1.6 but probably dipped further than -1.6 before closing. But my stoploss wouldn't let them dip that far. My stoploss is set at -2.0. Two losses of -2.0 would be -4.0, not 4.68.
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.
I want to put a cap on losses before I turn off the EA to avoid further damage on a clear bad day. Do you think this is the correct way to do it?
starting up:
the function:
in loop:
Of course, you can't see the LogAppend function's body here, but that is irrelevant. It just writes to a file.
It looks correct to me, however, the log tells me that the biggest loss in a day was:
Looking at the StrategyTester report, I can't find that loss.
In the "Chart" session, there seems to be a small dip of only $1.7 on 2022-10-6.
In the "Results" section, I did find two losses on 2022-10-6: -1.65 + -1.68 = -3.33.
But those are orders number 21 and 22, not 23. Off by one? Maybe, but that is still a little far from 4.68.
You may think that either trade closed at only -1.6 but probably dipped further than -1.6 before closing. But my stoploss wouldn't let them dip that far. My stoploss is set at -2.0. Two losses of -2.0 would be -4.0, not 4.68.
Order 23 profits 2.36 and order 24 loses 1.69.
What do you gentlemen think?