ChartClose

Belirtilen çizelgeyi kapatır.

bool  ChartClose(
   long  chart_id=0      // Çizelge tanımlayıcı
   );

Parametreler

chart_id=0

[in]  Çizelge tanımlayıcısı. 0, mevcut çizelge anlamına gelir.

Dönüş değeri

Başarılı sonuç durumunda 'true', aksi durumda 'false' dönüşü yapar.

Örnek:

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- mevcut grafikle aynı sembol ve zaman dilimine sahip yeni bir grafik aç
   long chart_id=ChartOpen(_Symbol_Period);
   if(chart_id==0)
     {
      Print("ChartOpen() failed. Error "GetLastError());
      return;
     }
 
//--- açılan grafiğin parametrelerini günlüğe yazdır
   PrintFormat("A new chart of the %s symbol has been opened with a period of %s and ChartID %I64u",
               _SymbolStringSubstr(EnumToString(_Period), 7), chart_id);
 
//--- iki saniye bekle ve yeni açılan grafiği kapat
   PrintFormat("Waiting 3 seconds before closing a newly opened chart with ID %I64d ..."chart_id);
   Sleep(3000);
   ResetLastError();
   if(!ChartClose(chart_id))
     {
      Print("ChartClose() failed. Error "GetLastError());
      return;
     }
 
//--- günlüğe başarılı grafik kapatma mesajı yazdır
   PrintFormat("The chart with ID %I64d was successfully closed"chart_id);
   /*
   sonuç:
   A new chart of the GBPUSD symbol has been opened with a period of M1 and ChartID 133346697706632016
   Waiting 3 seconds before closing a newly opened chart with ID 133346697706632016 ...
   The chart with ID 133346697706632016 was successfully closed
   */
  }