MarketBookRelease

Assure la clôture du profondeur de marché selon l'instrument indiqué, ainsi qu'élimine la souscription sur la réception des avis du changement du profondeur de marché indiqué.

bool  MarketBookRelease(
   string  symbol      // nom du symbole
   );

Paramètres

symbol

[in] Le nom du symbole.

La valeur rendue

La valeur true en cas de la clôture fructueuse, autrement  false.

Note

Normalement, on doit appeler cette fonction de la fonction OnDeinit() dans le cas où dans la fonction OnInit() a été appelée la fonction MarketBookAdd(). Ou elle doit appeler du destructeur de la classe, si dans le constructeur de cette classe s'appelle la fonction correspondante MarketBookAdd().

Example:

#define SYMBOL_NAME "GBPUSD"
 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- open the market depth for SYMBOL_NAME symbol
   if(!MarketBookAdd(SYMBOL_NAME))
     {
      PrintFormat("MarketBookAdd(%s) failed. Error "SYMBOL_NAMEGetLastError());
      return;
     }
 
//--- send the message about successfully opening the market depth to the journal
   PrintFormat("The MarketBook for the '%s' symbol was successfully opened and a subscription to change it was received"SYMBOL_NAME);
   
//--- wait 2 seconds
   Sleep(2000);
   
//--- upon completion, unsubscribe from the open market depth
//--- send the message about successfully unsubscribing from the market depth or about the error to the journal
   ResetLastError();
   if(MarketBookRelease(SYMBOL_NAME))
      PrintFormat("MarketBook for the '%s' symbol was successfully closed"SYMBOL_NAME);
   else
      PrintFormat("Error %d occurred when closing MarketBook using the '%s' symbol"GetLastError(), SYMBOL_NAME);
      
   /*
   result:
   The MarketBook for the 'GBPUSDsymbol was successfully opened and a subscription to change it was received
   MarketBook for the 'GBPUSDsymbol was successfully closed
   */
  }

Voir aussi

La structure du profondeur de marché, Les structures et les classes