Download MetaTrader 5
To add comments, please log in or register
MQL5 Cloud Network speeds up calculations. Try it!
Ming Luo
293
Ming Luo 2014.09.16 02:11 

Hi All:

I have two questions: 

1. When I apply an EA to a chart to run in real time, is it possible to extract the historical test trading result on the first run please?  For example, I want to have a logic that detect the previous trading winning percent, if the winning rate is lower than 30%, I would like to cut the trading volume. For now, whenever an EA is applied on a chart first time, I have no history data to analyse. And every time I shut down my computer, all history data will be lost.

 

2. From the OrdersHistoryTotal() function, how many previous trading orders can be retrieved? Also I notice that the trading history tab is refreshed every month. Does it mean that on the first day of every month, the trading history data is cleared?

 

Thanks

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.09.16 02:47  

Actually, you need to click Account History. Select any trade history, right click > All history

You trade history should show up including previous months.

Ming Luo
293
Ming Luo 2014.09.16 02:59  
deysmacro:

Actually, you need to click Account History. Select any trade history, right click > All history

You trade history should show up including previous months.

Hi deysmacro:

 

Thanks for your reply. I know how to show the trade history on the terminal. But what I mean is how to retrieve the historical trade data from the EA program. And also when I first run the EA, is it possible to get the mock trading data automatically, so I am able to use the previous mock trading data.

 

Thanks 

Keith Watford
Moderator
7951
Keith Watford 2014.09.16 04:32  

When you run the EA for the first time give it a totally individual magic number. Make sure that the magic number has never been used for any trade in history. This can be done with a relatively simple piece of code.

 Then next time you start the EA, give it another magic number and you can retrieve all trades with the old magic number from history.

Ming Luo
293
Ming Luo 2014.09.16 05:52  
GumRai:

When you run the EA for the first time give it a totally individual magic number. Make sure that the magic number has never been used for any trade in history. This can be done with a relatively simple piece of code.

 Then next time you start the EA, give it another magic number and you can retrieve all trades with the old magic number from history.

Hi GumRai:

 

Thanks for your reply. Do you mean that if I use the same magic number, I will not able to retrieve the order from the history?

 

Also, is it possible to get some mock test result when I run the EA first time?

 

Thanks 

whroeder1
13627
/
To add comments, please log in or register