Returning a string of the first 3 letters of a currency pair

 

Hi,

I am struggling to find a method that will return a string with the first 3 letters of a currency pair.

Similar to how the SYMBOL_CURRENCY_BASE returns the final 3 letters of a pair.

Any help or advise would be greatly appreciated! 

 
  1. When in doubt, THINK. StringSubstr

  2. Broker's use a variety of naming patterns: EURUSD, EURUSDc, EURUSDct, EURUSDecn, EURUSDi, EURUSDm, EURUSDme, EURUSDpro, EURUSDt, "EUR.USD", "EUR/USD", "EURUSD!", "EURUSD#", "EURUSD.", "EURUSD..", "EURUSD.c", "EURUSD.cfx", "EURUSD.G", "EURUSD.i", "EURUSD.r", "EURUSD.SBe", "EURUSD.stp", "EURUSD+", "EURUSD-5", "EURUSD-m", "EURUSD-sb", etc., 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.

    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 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.06.12

Reason: