MarketBookRelease

선택된 심볼에 대해 시장의 깊이(Depth of Market)를 마감하고 DOM 변경 알림 수신을 위한 구독을 취소.

bool  MarketBookRelease(
   string  symbol      // 심볼
   );

매개변수

심볼

[in] 심볼 이름.

값 반환

성공적으로 닫히는 경우 true 값을, 그렇지 않은 경우 false 값.

주의

일반적으로 OnDeinit() 기능에서 해당 MarketBookAdd() 기능이 호출된 경우, 이 기능은 OnInit() 기능에서 호출되어야 합니다. 또는 해당 MarketBookAdd() 기능을 클래스 생성자에서 호출한 경우 클래스 소멸기에서 호출해야 합니다.

예:

#define SYMBOL_NAME "GBPUSD"
 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- SYMBOL_NAME 심볼에 대한 시장 심도를 엽니다.
   if(!MarketBookAdd(SYMBOL_NAME))
     {
      PrintFormat("MarketBookAdd(%s) failed. Error "SYMBOL_NAMEGetLastError());
      return;
     }
 
//--- 시장 심도를 성공적으로 열었다는 메시지를 저널에 보냅니다.
   PrintFormat("The MarketBook for the '%s' symbol was successfully opened and a subscription to change it was received"SYMBOL_NAME);
   
//--- 2초 기다립니다
   Sleep(2000);
   
//--- 완료되면 공개 시장 심도에서 구독을 취소하세요.
//--- 시장 심도에서 성공적으로 구독 취소되었거나 오류에 대한 메시지를 저널에 보냅니다.
   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);
      
   /*
  결과:
   The MarketBook for the 'GBPUSDsymbol was successfully opened and a subscription to change it was received
   MarketBook for the 'GBPUSDsymbol was successfully closed
   */
  }

추가 참조

마켓의 깊이의 구조, 구조 및 클래스