Symbol input

 

Hi there I need to select or avoid specific symbols through a string input to make different sets, so the question is how to make this.


For example:

I want to trade defaults for all 28 forex pairs  but EURUSD|USDJPY|EURJPY .

Then I want to trade only EURJPY through a custom set and EURUSD|USDJPY by a different one.


For this purpose I will write a enum definition with the following parameters:

0. ManageAll (not used in this case).

1. TradeCurrent (might be used for EURJPY).

2. TradeOnly (for EURJPY or EURUSD|USDJPY).

3. ManageAllBut (trade all pairs but the previous ones EURUSD|USDJPY|EURJPY).


So the question is how to make an input and how to apply those restrictions in the code, I'm thinking about something like this but not completely sure:

input STRADE TradePairs = 3; (ManageAllBut)
input string PairSelect = "EURUSD|USDJPY|EURJPY";
   for(int s=0;s<SymbolsTotal(true);s++){
      string SName=SymbolName(s,true);
      if(TradePairs==1){SName=_Symbol;}     (TradeCurrent)
      if(TradePairs==2){SName=PairSelect;}  (TradeOnly)
      if(TradePairs==3){SName!=PairSelect;} (ManageAllBut)
      // Code...