I would like to develop a script that would create the list of all symbols with the first day of quotation available.
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"); } //+------------------------------------------------------------------+
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"); } //+------------------------------------------------------------------+

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