How to use in array or save without using OrderSend

 

Hi,

I don't want to place trade.


Instead of place trade I need to use Array, put all trades data into Array and if loss/profit trades need to save in array?


I can use lot for each trade 0.01 and then check, but I need without make trade because in this case I will lost 0.01.


I can make this in demo account but I'm trying to get better solution, because if I cannot make backtesting.


Simple instead to place trade, to put in array and then with Print read array to display data


Is this possible?


Regards,

 

Of course, it's possible.

Create a struct with what you want to save, and create an array of them.

 

from what i know mt4 dont save session..you need to save any data to outside file the load it again if needed. for box check see 

Wingdings - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
Wingdings - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
Wingdings - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
Files:
 

Thanks for your help.


But how can I recognized if trades loss or won?


If I put in array or session, or write file I understand but problem how can I get from mql4 that trades are lost?

 
Dejan Krapez #: how can I get from mql4 that trades are lost?

Select the ticket, verify the order has been closed, read the profit.

Reason: