sergeyrar:
I seem to get Ordersend error 148
can anyone tell why ?
thanks
P.S - without the condition : " if (AccountBalance()/max_account_balance>0.9) " it works fine
nevermind I solved it.
How did you solved it Serge?
Presumably by restricting the number of orders. This is a limit set by your broker:
148 | ERR_TRADE_TOO_MANY_ORDERS | The amount of open and pending orders has reached the limit set by the broker |
bool IsNewOrderAllowed() { //--- get the number of pending orders allowed on the account int max_allowed_orders=(int)AccountInfoInteger(ACCOUNT_LIMIT_ORDERS); //--- if there is no limitation, return true; you can send an order if(max_allowed_orders==0) return(true); //--- if we passed to this line, then there is a limitation; find out how many orders are already placed int orders=OrdersTotal(); //--- return the result of comparing return(orders<max_allowed_orders); }
This code check orders
if ( ( Ask- SMA_10day < buffer*Point*K ) && ( price_above==true))
You are looking at a signal (opening one order per tick). Act on a change of signal.
Too many orders - MQL4 programming forum #1 (2017)

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
I seem to get Ordersend error 148
can anyone tell why ?
thanks