- Don't double post General rules and best pratices of the Forum. - General - MQL5 programming forum
total=OrdersTotal(); if(total<1)
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forumticket = OrderSend(Symbol(),OP_BUY,Lots,Ask,10,0,0,"MA",MagicNo,0,Blue); return(0);
Check your return codes for errors and report them.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articlesfor(int i = OrdersHistoryTotal()-1; i>= 0 ; i--){ if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY)) continue;
#2 and Do not assume history is ordered by date, it's not.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 and MetaTrader 4 - MQL4 programming forum
Count how many lost orders from the last profit order - MQL4 and MetaTrader 4 - MQL4 programming forumSMACur=iMA(NULL,0,ShortMA,0,MODE_SMA,PRICE_OPEN,0); SMAPre=iMA(NULL,0,ShortMA,0,MODE_SMA,PRICE_OPEN,1);
Are you sure you want to use bar zero? You will intermittently get vanishing crosses.if(TimeCurrent() < OrderCloseTime()+Pause_time*60*60 ){ LastOrderCon =False; } if(TimeCurrent() >= OrderCloseTime()+Pause_time*60*60){ LastOrderCon =True; } } if(OrderProfit()>0){ LastOrderCon =True; }
Simplify your code. Increase Order after stoploss - MQL4 and MetaTrader 4 - MQL4 programming forum

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
Even if I use it, it does not make any difference when I are not using it.