In the EA of MT4, I want to extract the transaction results by specifying a specific date and time in the past.
As a result of writing the following code,
OrderOpenTime ()> "2019.12.10" will be extracted,
OrderOpenTime ()> "2019.12.15" is not extracted
Some cases cannot be extracted by date.
* Transactions occur at 12.10 and 12.15
I would be grateful if you could give advice on this factor and improvement.
- How to copy deals of successful traders in MetaTrader 5
- Flexible MetaTrader 5 trading system with all order types
- MetaTrader 5 Built-in Trading Strategy Tester
12027780:
In the EA of MT4, I want to extract the transaction results by specifying a specific date and time in the past.
As a result of writing the following code,
OrderOpenTime ()> "2019.12.10" will be extracted,
OrderOpenTime ()> "2019.12.15" is not extracted
Some cases cannot be extracted by date.
* Transactions occur at 12.10 and 12.15
I would be grateful if you could give advice on this factor and improvement.
If I'm having trouble extracting info I break it down to a base level, so at least the code is getting the values I expect....
In
this case I'd start with a list of orders in profit, then check it against the actual values in the terminal.Then, expand the code to filter
what you need, and consider whether you need to use StringToTime(..) TimeHour(..) etc...
string txt; for(int x=1;x<OrdersHistoryTotal();x++) if(OrderSelect(x,SELECT_BY_POS,MODE_HISTORY)) if(OrderProfit()>0){ txt=StringConcatenate(txt,OrderTicket(),",",OrderSymbol(),",",OrderProfit()); txt=StringConcatenate(txt,",",OrderOpenTime(),"\n") ; } Comment(txt); /* (my history on screen) 8614215,GBPNZD,0.09,2019.12.23 09:45:51 8614219,GBPNZD,0.24,2019.12.23 09:47:00 8614225,GBPNZD,0.08,2019.12.23 09:47:52 */

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