Question about cfd in metatradr

 

Hi i saw in metatrader  4 the CFD  like  brent or index , but  many broker call in diffrents mode , and i want  compare with some string example

 if ((Symbol()=="BRENT.CMD")

this is correct for broker dukas, but  for example  fxopen no because BRENT call in differents name exist a mode for  locate the name ? or i must insert all possible ticket  ?? thanks



 
  1. Broker's use a variety of naming patterns: EURUSD, EURUSDb, EURUSDc, EURUSDcheck, EURUSDct, EURUSDecn, EURUSDf, EURUSDh, EURUSDi, EURUSDm, EURUSDme, EURUSDmicro, EURUSDpro, EURUSDt, EURUSDx. “EUR.USD”, “EUR/USD”, “EUR/USD_ecn”, “EURUSD!”, “EURUSD#”, “EURUSD..”, “EURUSD.”, “EURUSD.a”, “EURUSD.ax/a>”, “EURUSD.c”, “EURUSD.cfx”, “EURUSD.ecn” and “EURUSD.ECN”, “EURUSD.G”, “EURUSD.i”, “BTCUSD.lts”, “EURUSD.m”, “EURUSD.p”, “EURUSD.pro”, “EURUSD.r”, “EURUSD.t/a>”, “EURUSD.SBe”, “EURUSD.stp”, “EURUSD.z”, “EURUSD'”, “EURUSD@”, “EURUSD_i”, “EURGBP_0s”, “EURUSD-5”, “EURUSD-g”, “EURUSD-m”, “EURUSD-sb”, “BRENT.cmd”, “#XAUUSD”, “#FB”, “#TSLA”, and Financial symbols with “-”, “=”, “_”, and “+”

    If the pattern your broker uses doesn't match the pattern of your signal provider's broker, you can't copy the signal/open a trade. Switch brokers to one that has that adornment.

    If the naming pattern of your charts isn't exactly “BasQuo” then hard coded symbols fails. Don't hard code things; just use the predefined _Symbol, or add/remove the adornments during processing.
              I need to know how to fill an enum or get a drop down list, with a string array :)) - MQL4 programming forum #10 (2020)


  2.  if ((Symbol()=="BRENT.CMD")

    Why are you checking the symbol? Code your EA to trade the current symbol, put it on the chart, done.