Download MetaTrader 5
To add comments, please log in or register
Use MQL5 Cloud Network. Test robots at a super speed!
tbalazs
109
tbalazs 2010.12.22 00:38 

Hi!

The following code always prints 0.0000

Is there something I don't know about? Seemed to work before! 

So my question is: Is tick.last working as intended? 

MqlTick tick;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {  
   SymbolInfoTick(Symbol(),tick);  
   Print(DoubleToString(tick.last,5));   
  }
//+------------------------------------------------------------------+
Forgot to mention, that tick.bid and tick.ask works perfectly fine.
Valerii Mazurenko
3484
Valerii Mazurenko 2010.12.22 14:30  
tbalazs:

So my question is: Is tick.last working as intended? 

No Last price at forex. But futures, shares & options has it.
/
To add comments, please log in or register