Select a symbol in the settings - page 7

 
Aleksey Mavrin:

1. It's already available.

Can you give me a link or where to look?

 
Alexey Viktorov:

This is the second option I have described. Trade currencies from the list prepared in a comma separated line. Only in my variant it is a bit different. The list looks like this

Then the array is filled from the list and we operate with array. And we also define currency suffix and automatically join it when filling the array. This is to avoid having to retype the list in different accounts.

It's been so long and I've only just realised it.

//+------------------------------------------------------------------+
//|                                            AccountInfoDouble.mq5 |
//|                        Copyright 2021, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property script_show_inputs
//+------------------------------------------------------------------+
//| ENUM_FOREX_CROSSES                                                 |
//+------------------------------------------------------------------+
enum Enum_Symbol {EURUSD,GBPUSD,USDCHF,USDJPY,USDCAD,AUDUSD,AUDNZD,AUDCAD,AUDCHF,AUDJPY,
                  CHFJPY,EURGBP,EURAUD,EURCHF,EURJPY,EURNZD,EURCAD,GBPCHF,GBPJPY,CADCHF
                 };
//+------------------------------------------------------------------+
input double      InpLots = 0.1;    // Lots
input Enum_Symbol Symb    = EURUSD; // Forex.crosses
//---
string symb_name[]= {"EURUSD","GBPUSD","USDCHF","USDJPY","USDCAD","AUDUSD","AUDNZD","AUDCAD","AUDCHF","AUDJPY",
                     "CHFJPY","EURGBP","EURAUD","EURCHF","EURJPY","EURNZD","EURCAD","GBPCHF","GBPJPY","CADCHF"
                    };
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   double priceL=0.0;
   double marginL=0.0;
//--- select lot size
   if(!SymbolInfoDouble(symb_name[Symb],SYMBOL_ASK,priceL))
      return;
   if(!OrderCalcMargin(ORDER_TYPE_BUY,symb_name[Symb],InpLots,priceL,marginL))
      return;
   if(marginL<=0.0)
      return;
   Alert(symb_name[Symb]," \\  ","price "," =  ",priceL);
   Alert(symb_name[Symb]," \\  ","margin"," =  ",marginL);
   printf("price  =  %G",priceL);
   printf("margin =  %G",marginL);
  }
//+------------------------------------------------------------------+