Take a buy on the movement of the last tick.(last_tick) - page 2

 

Thanks you sir 


Everything is fine now,

I created an indicator with 2 levels the low and the middle ca responds perfectly to what I wanted.

now i have a small problem on this code i want to retrieve the last tick (the last_tick) with the codes below,

in the back test last_tick it displays the value of the last_tick but on a Demo or real account last_tick does not display anything at all it is at 0

void OnTick()
  {
 MqlTick last_tick;
 
//---
   if(SymbolInfoTick(Symbol(),last_tick))
     {
      Print(": Last tick = ",last_tick.last);
     }
   else Print("SymbolInfoTick() failed, error = ",GetLastError());
//---
   
  }

how can i go about it please?


as you can see on the jointe file thanks

Files:
 
I would need to verify this, but as far as I am aware, last is a deal price, deals are not available on all symbols.

If my interpretation is correct, then the value given in last is taken from the market depth and decentralized markets, like forex, do not have a market depth.

That's why you get no values in last.