hello guys hope you're doing good , i'm new to mql4 , i'm trying to do a simple expert expert advisor that counts the number of trades each expert advisor did historically using the matching number,
but it is always returning result 0 ,(new to mql4 , training).
Do not double post!
I have deleted your duplicated topic.
int exe;
You should always assign an initial value to variables like this.
int exe=0;
for ( i=OrdersHistoryTotal();i>0;i--);
Should be
for ( i=OrdersHistoryTotal()-1;i>=0;i--);
Are there any closed orders with that magic number?
hello guys hope you're doing good , i'm new to mql4 , i'm trying to do a simple expert expert advisor that counts the number of trades each expert advisor did historically using the matching number,
but it is always returning result 0 ,(new to mql4 , training).
int exe; for ( i=OrdersHistoryTotal();i>0;i--); { OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
If there are n history orders, their position index is [n-1 … 0]
- Your first OrderSelect failed, but you don't check.
- Your last OrderSelect is skipped.
-
MT4:
-
Do not assume history has only closed orders.
OrderType() == 6, 7 in the history pool? - MQL4 programming forum (2017) -
Do not assume history is ordered by date, it's not.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum (2012)
Taking the last profit and storing it in a variable | MQL4 - MQL4 programming forum #3 (2020) -
Total Profit is OrderProfit() + OrderSwap() + OrderCommission(). Some brokers don't use the Commission/Swap fields. Instead, they add balance entries. (Maybe related to Government required accounting/tax laws.)
"balance" orders in account history - Day Trading Techniques - MQL4 programming forum (2017)Broker History FXCM Commission - <TICKET>
Rollover - <TICKET>>R/O - 1,000 EUR/USD @0.52 #<ticket> N/A OANDA Balance update
Financing (Swap: One entry for all open orders.)
-
You have been told not to double post and yet you have opened a new topic that is related to this code. I have deleted that topic.
Continue your questions here, don't open a new topic every time that you have a related question.
Also Topics concerning MT4 and MQL4 have their own section. I have already moved this topic.
In future please post in the correct section.
You have been told not to double post and yet you have opened a new topic that is related to this code. I have deleted that topic.
Continue your questions here, don't open a new topic every time that you have a related question.
Also Topics concerning MT4 and MQL4 have their own section. I have already moved this topic.
In future please post in the correct section.
I have just deleted yet another topic, again posted in the wrong section.
I will ban you for 1 day, next time you can expect longer.
I have just deleted yet another topic of yours that is related to dealing with historic orders.
Again it was posted in the wrong section!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello guys hope you're doing good , i'm new to mql4 , i'm trying to do a simple expert expert advisor that counts the number of trades each expert advisor did historically using the matching number,
but it is always returning result 0 ,(new to mql4 , training).