Extract the historical trades on first EA running?

 

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

 

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

You trade history should show up including previous months.

 
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 

 

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.

 
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