'Ask' - function not defined

 

Hello There I

I am new to coding ! I`ve been developing my EA

But I`m geting this error 'Ask' - function not defined !

The code is This 

if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))

  if(OrderMagicNumber()== MagicNumber)

    if(OrderType()==OP_SELL)

     if(OrderOpenPrice()-Ask> MoveToBreakeven*pips)

      if(OrderOpenPrice()>OrderStopLoss())

       if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-(PipsToLockIn*pips),OrderTakeProfit(),0,CLR_NONE))

        Print("Order",sellticket,"Was Successfully Modified");

         else Print("Order",sellticket,"Was Not Successfully Modified",GetLastError());

Please can someone tell me how you define Ask as a FUNCTION?


Regards


 
ulisses gomes:

But I`m geting this error 'Ask' - function not defined !

The code is This 

Please can someone tell me how you define Ask as a FUNCTION?

Please use the code button (Alt + S) when posting code. I have edited your post this time.

Your posted code will not produce this error, so it must be elsewhere in your code.

I will move this to the MQL4 sub forum.

 
It says function

Meaning somewhere in your code you have 

Ask()
 
Ask/Bid are builtin variables in MT4 but not MT5.
 
Hi, I am getting this error:
'Ask' - undeclared identifier MOV1.mq5 50 36
How can I solve it?
please help me.
 
Alireza Farajollahi #:
Hi, I am getting this error:
'Ask' - undeclared identifier MOV1.mq5 50 36
How can I solve it?
please help me.

As discussed above: Ask/Bid are builtin variables in MT4 but not MT5.

You need to define Ask in MQL5:

double Ask=SymbolInfoDouble(_Symbol, SYMBOL_ASK);
 
ulisses gomes:Please can someone tell me how you define Ask as a FUNCTION?
You can't. Ask is a predefined variable, not a function. Your posted code is not the problem. Post the lines where the error occurs.
Yashar Seyyedin #: As discussed above: Ask/Bid are builtin variables in MT4 but not MT5.

You need to define Ask in MQL5:

This is the MT4 forum and OPs question was MT4.