AcitiveJone:
Dear
I have a MQL4 EA, now i am plan to convert MQL5. i did all coding. just i can't convert only below MQL4 coding
what is the coding to get history trade in MQL5? please help me.....
is Any one help me......
Begin with it: HistorySelect
AcitiveJone:
MQL5-code:I have a MQL4 EA, now i am plan to convert MQL5. i did all coding. just i can't convert only below MQL4 coding
what is the coding to get history trade in MQL5? please help me.....
https://www.mql5.com/en/code/16006 #include <MT4Orders.mqh> // Last version - https://www.mql5.com/ru/code/16006 for (int i = 0; i < OrdersHistoryTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) { if (OrderSymbol() == Symbol() && (OrderType() == OP_SELL || OrderType() == OP_BUY) && OrderMagicNumber() == MagicNumber && OrderCloseTime()!=0){ if ( OrderOpenTime() >= date) { DailyProfit=DailyProfit+(OrderProfit()+OrderSwap()+OrderCommission()); TotalDailyOrders++; if(OrderType()==OP_BUY) DailyPips += NormalizeDouble(OrderClosePrice()-OrderOpenPrice(),_Digits); if(OrderType()==OP_SELL) DailyPips += NormalizeDouble(OrderOpenPrice()-OrderClosePrice(),_Digits); } } } }
That's all !!!
Nice work. Congrats.

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
Dear
I have a MQL4 EA, now i am plan to convert MQL5. i did all coding. just i can't convert only below MQL4 coding
what is the coding to get history trade in MQL5? please help me.....