Happy Accidents & Better Account Protection
-
I started testing an EA less than a week ago on Demo. The balance is up almost double. But there's an open position with no stop loss that promises to erase 1/4 of the gains. How did this happen. And how do I protect against it?
I'm guessing my stop was too close, and thus 'illegal'. So it was left unset. I'm computing my stops and may have an error somewhere. (This is why I wanted to dump variable values into the testing log. How do you do that?)
But how do you check that your Stop Loss and Take Profit are set?
Things are getting complicated.
The good results could be due to trading without stops ... that was not my intent.Thanks for your help. And thanks for the cool tool.
-
Okay, never mind. I figured out how to show variables in the tester log.
fxD can be a treasure hunt as times ...
I put this line into a Custom MQL code block and connected it after my Buy and Sell blocks ...
Print("***** T/P: " + v::TakeProfit + " S/L: " + v::StopLoss + " *****");
Stuff inside quotes is just text. Variables are prefixed with 'v::'. Constants would be prefixed with 'c::'
My code was occasionally setting stop loss to zero.
Made a ton of funny money.