Metatrader5 expert not receiving last price and volume.

 

HI. 

I am running the following code for GBP/JPY:

void OnTick() {
   // get last tick
   double last=SymbolInfoDouble(_Symbol, SYMBOL_LAST);
   Print(last);

or:

MqlTick last_tick; 
   if(SymbolInfoTick(Symbol(),last_tick)) { 
      Print(last_tick.time,": Bid = ",last_tick.bid, " Ask = ",last_tick.ask,"  Time = ",last_tick.time,"  Volume = ",last_tick.volume,"  Last = ",last_tick.last,
            "  time_msc = ",last_tick.time_msc,"  flags = ",last_tick.flags);

In both cases all the info is ok except last price which is always zero (and volume also zero en the 2nd example).

I have run to see if there were errors with GetLastError() but it gives 0 as LastError.

How can I get the last price?

Thanks.

 
There is no Last price or Volume for forex symbols tick.
 
Alain Verleyen:
There is no Last price or Volume for forex symbols tick.

Thanks for the answer.

But the graph keeps changing showing the last price. 

How do I get it?

Maybe (bid +`ask)/2? Would that be a sensible thing to do?

thanks again.

Reason: