SymbolExist

Belirtilen ada sahip bir sembol olup olmadığını kontrol eder.

bool  SymbolExist(
   const string  name,    // sembol adı
   bool&   is_custom      // kullanıcı tanımlı sembol adı
   );

Parametreler

name

[in]  Sembol adı.

is_custom

[out]  Başarılı yürütmenin akabinde ayarlanan kullanıcı tanımlı sembol özelliği. Eğer doğruysa, algılanan sembol bir kullanıcı tanımlı semboldür.

Geri dönüş değeri

Eğer yanlışsa, sembol standart ve kullanıcı tanımlı semboller arasında bulunmaz.

Örnek:

#define SYMBOL_NAME "GBPUSDn"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- özel sembol bayrağını bildir ve adı SYMBOL_NAME'de belirtilen sembolün varlığını kontrol et
   bool custom = false;
   bool result = SymbolExist(SYMBOL_NAMEcustom);
   
//--- varsayılan 'sembol bulunamadı' mesaj metnini bildir
   string text = StringFormat("The symbol '%s' was not found among either the standard or custom symbols."SYMBOL_NAME);
   
//--- sembol bulunursa, sembolün hangi listede bulunduğuna bağlı olarak bir mesaj metni oluştur
   if(result)
     {
      //--- eğer bu standart bir sembol ise
      if(!custom)
         text = StringFormat("The '%s' symbol is available on the server."SYMBOL_NAME);
      //--- eğer bu özel bir sembol ise
      else
         text = StringFormat("The symbol '%s' was found in the list of custom symbols."SYMBOL_NAME);
     }
     
//--- kontrol sonucuyla ilgili mesajı günlüğe gönder
   Print(text);
   /*
   standart 'GBPUSD' sembolü için sonuç:
   The 'GBPUSDsymbol is available on the server.
   
   özel 'GBPUSDx' sembolü için sonuç:
   The symbol 'GBPUSDxwas found in the list of custom symbols.
   
   olmayan 'GBPUSDn' sembolü için sonuç:
   The symbol 'GBPUSDnwas not found among either the standard or custom symbols.
   */
  }

Ayrıca bakınız

SymbolsTotal, SymbolSelect, Kullanıcı tanımlı semboller