hello, I'm trying to code multi currency EA. this code below works properly when I test it but my question is, is there any way of selecting All of the Major Pairs in Forex without making my code too long and if I try to change broker I don't want to start over again changing the symbol manually. because if I try to change broken some symbol don't work because the broker doesn't support that symbol
Files:
Screenshot_2022-05-26_172641.png
44 kb
- Coding help
- Indicator doesn't work properly in EA.
- EA on 3 pairs - magical problems
Karl Robeck: code too long and if I try to change broker I don't want to start over again
Make them an input,
input string majors="CADJPY,CHFJPY,EURCAD,EURCHF,EURGBP,EURJPY,CADCHF,EURUSD,USDJPY,GBPCAD,GBPCHF,GBPJPY,GBPUSD,USDCAD,USDCHF"; static string SymbolLoop[]; static int NumberOfForexSymbol; if(InpSymbol==Forex_Major) { NumberOfForexSymbol = StringSplit(majors, ',', SymbolLoop); }or read a file.
I tried it on my code and it works, but is this right? Thanks William!
enum TradingSymbol { Forex_Major,Forex_Minor,Forex_Exotic,All_Forex }; input TradingSymbol InpSymbol=Forex_Major; input string majors="CADJPY,CHFJPY,EURCAD,EURCHF,EURGBP,EURJPY,CADCHF,EURUSD,USDJPY,GBPCAD,GBPCHF,GBPJPY,GBPUSD,USDCAD,USDCHF"; input string minors="AUDCHF,AUDJPY,AUDNZD,AUDUSD,EURAUD,AUDCAD,EURNZD,NZDUSD,GBPAUD,GBPNZD,NZDCAD,NZDCHF,NZDJPY"; input string exotic="EURDKK,EURHKD,EURHUF,EURNOK,EURPLN,EURRUB,EURSEK,EURSGD,EURTRY,EURZAR,GBPDKK,GBPNOK,GBPSEK,CHFSGD,GBPSGD,USDZAR ,NZDSGD,SGDJPY,USDCNH,USDDKK,USDHKD,USDHUF,USDMXN,USDNOK,USDPLN,USDRUB,USDSEK,USDSGD,USDTRY"; static string SymbolLoop[]; static int NumberOfForexSymbol; if(InpSymbol==Forex_Major) { NumberOfForexSymbol = StringSplit(majors, ',', SymbolLoop); }else if(InpSymbol==Forex_Minor){ NumberOfForexSymbol = StringSplit(minors, ',', SymbolLoop); }else if(InpSymbol==Forex_Exotic){ NumberOfForexSymbol = StringSplit(exotic, ',', SymbolLoop); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register