Last order profit/loss

MrChuckW
406
MrChuckW  

How do I code my EA to collect the last closed order's profit/loss?

I can track the p/l for live orders, and if I close the order, I can collect the data... but if the system closes the order... for whatever reason... I don't know how to collect the data.

Chuck

Anthony Garot
4718
Anthony Garot  
MrChuckW:

How do I code my EA to collect the last closed order's profit/loss?

I can track the p/l for live orders, and if I close the order, I can collect the data... but if the system closes the order... for whatever reason... I don't know how to collect the data.

Chuck

https://www.mql5.com/en/forum/218962#comment_6019043
MT5 back tester -- how to capture final trade when "position closed due end of test"
MT5 back tester -- how to capture final trade when "position closed due end of test"
  • 2017.11.06
  • www.mql5.com
When backtesting, I often have an ongoing trade when the tester ends. It shows up with the message "end of test." So far so good...