An example of what my Journal looks like is this:
2014.02.13 03:29:20.485 2013.01.30 23:45 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 23:30 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 23:15 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 23:00 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 22:45 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 22:30 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 22:15 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 22:00 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 21:45 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 21:30 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.485 2013.01.30 21:15 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 21:00 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 20:45 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 20:30 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 20:15 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 20:00 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 19:45 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.484 2013.01.30 19:30 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.483 2013.01.30 19:15 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.483 2013.01.30 19:00 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
2014.02.13 03:29:20.483 2013.01.30 18:45 AtrWithEma GBPJPY,M15: #53 2013.01.25 14:45:00 buy 0.30 GBPJPY 144.064 143.899 144.339 2013.01.25 14:52:30 143.899 0.00 0.00 -48.45 Buy Order[sl] 123
You don't loop through the closed trades, so you can only expect the one trade to be printed
In your second piece of code, you don't print anything
You don't loop through the closed trades, so you can only expect the one trade to be printed
In your second piece of code, you don't print anything
Hi mate, the second one was just another way to do it. The Print message is just informative. Both functions return a boolean to indicate if the last one is a winner (the first snippet) or if the last trade is a loser (second snippet).
The point is that the functions always return the same value, which corresponds to the last trade in the whole period (number 53) instead of the last trade at the moment of calling the function. How is it possible that trade 53 is printed at 18:45 when that trade is executed in the tester at 22:45?
Can you put the code of how you would do it? I don't get what you mean. the second snippet (checkforlosses) loops through all the closed trades and it returns always true because trade 53 is a loser, when I have about 40% winners.
Hi mate, the second one was just another way to do it. The Print message is just informative. Both functions return a boolean to indicate if the last one is a winner (the first snippet) or if the last trade is a loser (second snippet).
The point is that the functions always return the same value, which corresponds to the last trade in the whole period (number 53) instead of the last trade at the moment of calling the function. How is it possible that trade 53 is printed at 18:45 when that trade is executed in the tester at 22:45?
Did you look in the log file ? the Journal can't keep up when you are printing so frequently . ..
You hit the nail RaptorUK. What a huge headache yesterday trying to find the problem. MT4 Journal doesn't display the right information but the log does and that is what I need. Many thanks!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I'm writing an EA and for filtering purposes I need to know if the last closed trade was a winner or a loser. I'm using OrdersHistoryTotal() and debugging with Print(). My EA is having for instance 40% winners, 60% losers, but when I have a look at the Journal because I just see that all the prints refers to the very last trade, for instance trade number 53, no matter the hour of the bar.
I haven't done anything weird. This is the code:
I also tried another variation running through all the trades:
Is anyone aware about this kind of issue with OrdersHistoryTotal() in the Strategy Tester? Many thanks in advance.