Are you talking about the Strategy Tester (i.e. backtesting)? Or are you using a forward test?
Backwards or forward and tester has nothing to do with it.
Read the manual and examine the example code provided here https://www.mql5.com/en/docs/constants/structures/mqltradetransaction

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am new to MQL5, and I'm just coming back to trading after a few year break. I figured this time I would like to automate my old strategy and have it send me prompts to set orders, and then send me the results of those orders. I've been able to program most of it already, but I keep stumbling over the titular issue.
As example, please look at the following journal entries from MetaTrader5 when I ran my EA:
Everything seems alright here, but no matter what I do, I can't ever seem to capture the information contained in the first line. As you can see, the parameters of the Order and Position (as well as Request and Result -- not pictured) objects are 0. What I'm trying to explicitly capture is the following:
Basically, I'd like to capture that first journal line. It is automatically generated by MetaTrader, so I thought the information would be available in the OnTradeTransaction() event. However, I can't seem to gain access to that information.
The relevant section of my OnTradeTransaction() code is:
The intent behind this is to have a live check on my trading strategy as orders execute.
What am I missing here? I feel like this should be a simple and basic task.
Thanks for your help, in advance.