Error OP_BUY undeclared identifier

 

i am learning mql5 but when i use 'op_buy' or 'ask' it gives me this error .

this is the code :

int OnInit()
  { 
#property 
    OrderSend(Symbol(),OP_BUY,0.01,Ask);
  
  
  
  

   return(INIT_SUCCEEDED);
  }

this is the error:


'OP_BUY' - undeclared identifier DEMO8.mq5 12 24

if you can help me id appreciate it .

 
ilia hnz:

i am learning mql5 but when i use 'op_buy' or 'ask' it gives me this error .

this is the code :

this is the error:


'OP_BUY' - undeclared identifier DEMO8.mq5 12 24

if you can help me id appreciate it .

make sure you have correctly put all the parameters in as per the documentation


https://docs.mql4.com/trading/ordersend

OrderSend - Trade Functions - MQL4 Reference
OrderSend - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderSend - Trade Functions - MQL4 Reference
 
ilia hnz: i am learning mql5 but when i use 'op_buy' or 'ask' it gives me this error .
  1. Perhaps you should read the manual. OrderSendMqlTradeRequestENUM_ORDER_TYPE
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

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

Reason: