SymbolInfoTick

Rend les prix courants pour le symbole indiqué dans la variable du type MqlTick.

bool  SymbolInfoTick(
   string    symbol,     // symbole
   MqlTick&  tick        // référence à la structure
   );

Paramètres

symbol

[in] Le nom du symbole.

tick

[out]  Le lien à la structure du type MqlTick, où seront placés les prix courants et le temps de la dernière mise à jour des prix.

La valeur rendue

Rend true en cas du succès, autrement - false.

Example:

#define SYMBOL_NAME "EURUSD"
 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- declare an array with the MqlTick structure type of dimension 1
   MqlTick tick[1]={};
   
//--- get the latest prices for the SYMBOL_NAME symbol into the MqlTick structure
   if(!SymbolInfoTick(SYMBOL_NAMEtick[0]))
     {
      Print("SymbolInfoTick() failed. Error "GetLastError());
      return;
     }
 
//--- send the obtained data to the journal
   PrintFormat("Latest price data for the '%s' symbol:"SYMBOL_NAME);
   ArrayPrint(tick);
   /*
   result:
   Latest price data for the 'EURUSDsymbol:
                    [time]   [bid]   [ask] [last] [volume]    [time_msc] [flags] [volume_real]
   [02024.05.17 23:58:54 1.08685 1.08695 0.0000        0 1715990334319       6       0.00000
   */
  }