error 130

 

Im trying to send an order but it seems that my broker has limits to the orders sent. 


I had the following line of code which gave me an output of 10: Alert(MarketInfo(NULL,MODE_STOPLEVEL)); 


and the following is my order send function but its not accepted :  OrderSend(NULL,OP_BUYLIMIT,0.01,Ask,10,10,0.89980); 


the order gets rejected with an order ID of -1 can someone please explain to me how do i deal with the inputs in order to send my order? 



Thanks in advance

 
Have you scheduled an order limit check?

Because a trading account cannot have an infinite number of order requests and it depends on the type of account and the broker.

look here : https://www.mql5.com/en/articles/2555#account_limit_pending_orders
The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market
  • www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
areejyousefhussein:
OrderSend(NULL,OP_BUYLIMIT,0.01,Ask,10,10,0.89980)

It is unlikely that a buy limit order will be placed at ask.

10 does not look like a valid stoploss to me if the TP is 0.89980

 

areejyousefhussein:

I had the following line of code which gave me an output of 10: Alert(MarketInfo(NULL,MODE_STOPLEVEL)); 

and the following is my order send function but its not accepted :  OrderSend(NULL,OP_BUYLIMIT,0.01,Ask,10,10,0.89980);

  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. Be careful with NULL.

    1. On MT4, you can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, iCustom does, MarketInfo does not, OrderSend does not.
    2. Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
    3. Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
    4. MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].
    5. Cloud Protector Bug? - MQL4 programming forum (2020)
 
Anthony De Barros #:
Have you scheduled an order limit check?

Because a trading account cannot have an infinite number of order requests and it depends on the type of account and the broker.

look here : https://www.mql5.com/en/articles/2555#account_limit_pending_orders
does this work for mql4 also? 
 
Keith Watford #:

It is unlikely that a buy limit order will be placed at ask.

10 does not look like a valid stoploss to me if the TP is 0.89980

Even if i replace the 'Ask' with a number it still doesn't work 
 
William Roeder #:
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. Be careful with NULL.

    1. On MT4, you can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, iCustom does, MarketInfo does not, OrderSend does not.
    2. Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
    3. Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
    4. MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].
    5. Cloud Protector Bug? - MQL4 programming forum (2020)

1. Apology Im new here and I didn't notice that there is two different pages for mql4 and mql5...

2. 1. I used it because the instructor did.. I will fix it..

2. I will 


hmmm but these didn't solve the issue :/ 

Reason: