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
Please show the sample of your test trade history as shown by MetaTrader, that shows "ins" and "outs". Here is an example of only the deals ...
Then show debugging log output from your program for the same deals shown in your trade history.
Sample Logs:
Full History:
To see the loop that generated this log, check previous comments. Thanks for looking into this for me. If no one is having this issue, then I will chalk it down to being a broker platform issue.
Use the following to test on your own setup and see if it produces equivalent output as mine.
If it does, then use it as a reference to analyse your own code. But if not, report your results as I have done below ...
Sample MQL5 Script code ...
Sample log output ...
Sample trade history ...
Use the following to test on your own setup and see if it produces equivalent output as mine.
If it does, then use it as a reference to analyse your own code. But if not, report your results as I have done below ...
Sample MQL5 Script code ...
Thank you soo much, this actually gives DEAL_ENTRY_OUT. Once I figure out the flaw in my code I will make a follow up. Thanks again
Edit/Follow-up: In the complete version of my code, I actually look into the data from the start of position part way through collecting data on the current ticket, which dequeues the current ticket (Reason being to collect the commission so I get an accurate final profit sum). Though embarrassing, I don't want to cause any confusion due to my oversight. Thanks for the help again
It is an understandable oversight, due to the "strange" ways that MetaQuotes has implemented the trade history. It is best to cache your results in memory, to help prevent the issue.
Closing a position by a SL or TP doesn't trigger DEAL_ENTRY_OUT.
A deal caused by a SL/TP has an entry ENTRY_OUT.
I suppose your issue was caused by the fact that your positions were closed manually:
TraderTogami #:
I made the trade close manually and the DEAL_ENTRY is still always DEAL_ENTRY_IN. Do you see a case of DEAL_ENTRY_OUT on your platform?
If this is the case, you got a MAGIC_NUMBER = 0 and your loop failed here:
The following image and the relative Print() output is an example where you can see the value of MAGIC_NUMBER, DEAL_ENTRY and DEAL_REASON.