I would like to develop a script that would create the list of all symbols with the first day of quotation available.

Pierre Rougier
802
Pierre Rougier  
Hello,
I would like to develop a script that would create the list of all symbols with the first day of quotation available.

Any ideas ?

Thanks,
Pierre

Pierre Rougier
802
Pierre Rougier  

It's almost good, I found a code that I had developed.  ;-D


//+------------------------------------------------------------------+
//|                                                stListSymbols.mq5 |
//|                                   Copyright 2019, Pierre Rougier |
//|                           https://www.mql5.com/en/users/pierre8r |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, Pierre Rougier"
#property link      "https://www.mql5.com/en/users/pierre8r"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   const   bool  inWatch=true;      // True - only symbols in MarketWatch 
   const   bool  allSymbols=false;  // False - all symbols 

   int handleFile=FileOpen("ListSymbols.csv",FILE_WRITE|FILE_ANSI|FILE_CSV,",");
   if(handleFile==INVALID_HANDLE)
     {
      Alert("Error opening file");
      return;
     }

   FileWrite(handleFile,"Symbol","ISIN");
   for(int i=0;i<SymbolsTotal(inWatch);i++)
     {
      FileWrite(handleFile,SymbolName(i,inWatch),
                SymbolInfoString(SymbolName(i,inWatch),SYMBOL_ISIN),
                SymbolInfoString(SymbolName(i,inWatch),SYMBOL_PAGE),
                SymbolInfoString(SymbolName(i,inWatch),SYMBOL_PATH));
     }

   FileClose(handleFile);
   Alert("File created");

  }
//+------------------------------------------------------------------+
Pierre Rougier
802
Pierre Rougier  

Final.


//+------------------------------------------------------------------+
//|                                          stListSymbols_iBars.mq5 |
//|                                   Copyright 2019, Pierre Rougier |
//|                           https://www.mql5.com/en/users/pierre8r |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, Pierre Rougier"
#property link      "https://www.mql5.com/en/users/pierre8r"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   const   bool  inWatch=true;      // True - only symbols in MarketWatch 
   const   bool  allSymbols=false;  // False - all symbols 

   int handleFile=FileOpen("ListSymbols.csv",FILE_WRITE|FILE_ANSI|FILE_CSV,",");
   if(handleFile==INVALID_HANDLE)
     {
      Alert("Error opening file");
      return;
     }

   FileWrite(handleFile,"Symbol","ISIN");
   for(int i=0;i<SymbolsTotal(inWatch);i++)
     {
      FileWrite(handleFile,SymbolName(i,inWatch),
                TimeToString(iTime(SymbolName(i,inWatch),PERIOD_D1,iBars(SymbolName(i,inWatch),PERIOD_D1)-1)),
                //  iBars(SymbolName(i,inWatch),PERIOD_D1),
                //  SymbolInfoString(SymbolName(i,inWatch),SYMBOL_PAGE),
                SymbolInfoString(SymbolName(i,inWatch),SYMBOL_PATH));
     }

   FileClose(handleFile);
   Alert("File created");

  }
//+------------------------------------------------------------------+