I just made a EA which seems to be profitable in backtesting (it opens and closes positions) but when i activated it in my demo account it just don't open any trade however all criteria are met.
In the backtest it opens about 6 trades a day, but in my demo it has not opened anything in 2 days.
Is there a way to troubleshoot this ?
I'm writing buy and close actions with all current variables to a log file but nothing is logged.
The journal does not show any activity or error's either.
That's what frustrating me. I'm not (yet) really familiar with a good troubleshooting method.
Maybe you have some hints in the right direction ...
Just before your order send... put in an alert or print to confirm that the code has got that far through your code... after the ordersend, call https://docs.mql4.com/check/GetLastError and print the result (if it's not zero)... and that will be a start.
You probably have a broker that forbids sending TP and SL in the same command as the trade entry. Take a look at my post here.
Yep, i'm with an ECN broker.
I have worked around that by doing a modification after the trade has been opened.
That's not the issue. (failed trades are in the journal)
@viffer that's a nice one i haven't thought off before. thnx will try that.