SymbolList_fromSet

Download script
Author: Copyright � 2006, komposter
SymbolList_fromSet

This script is designed to automate the process of gathering detailed market data for a specific group of trading symbols. Instead of manually looking up information for every currency pair or asset, this tool extracts that data into an organized spreadsheet format automatically.

How it works:

1. Identifying your Watchlist The script starts by looking for a pre-defined configuration file (specifically a ".set" file) on your computer. This file acts as a master list containing the names of all the trading symbols you are interested in.

2. Collecting Market Specifications Once the script reads your list of symbols, it goes into "research mode." It connects to the market data to pull the specific technical requirements for every single symbol identified in your list. This includes vital information such as:

  • Pricing Details: Points, digits, spreads, and tick values.
  • Trading Rules: Minimum and maximum lot sizes, lot steps, and trade permissions.
  • Contract Specifics: Swap rates (long and short), starting prices, and expiration details.

3. Generating the Report After gathering all this information, the script compiles everything into a clean, structured format. It automatically creates a new CSV file (which can be opened in programs like Microsoft Excel).

4. Organizing the Output The final result is a organized table where the first row contains headers (like "SYMBOL", "SPREAD", "LOTSIZE", etc.), and every subsequent row contains the corresponding data for each asset on your list.

5. Visual Confirmation While the process runs, the script also displays the list of symbols it found directly on your trading platform's screen, providing a quick visual confirmation that the tool is working correctly.

Summary for the User:

Essentially, this is a data-gathering utility. You provide a list of assets you want to track, and the script generates a comprehensive "fact sheet" in an Excel-friendly format, saving you from the tedious task of manually copying and pasting technical specifications for dozens of different instruments.

Miscellaneous
Uses files from the file systemIt reads information from a fileIt writes information to file
12 Views
0 Downloads
0 Favorites
SymbolList_fromSet
//+------------------------------------------------------------------+
//|                                           SymbolList_fromSet.mq4 |
//|                                      Copyright © 2006, komposter |
//|                                      mailto:komposterius@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, komposter"
#property link      "mailto:komposterius@mail.ru"
#property show_inputs
//----
extern string	SetFile_name = "forexall";
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
	  int file_handle = FileOpen(SetFile_name + ".set", FILE_READ);
	  //---- Åñëè âîçíèêëà îøèáêà
	  if(file_handle < 0)
	    {
		     Print("Îøèáêà ¹", GetLastError(), " ïðè îòêðûòèè ôàéëà!!!");
		     return(-1);
	    }
	  string Symbols[1];
	  int SymbolsCount = 0;
	  while(true)
	    {
		     Symbols[SymbolsCount] = FileReadString(file_handle);
		     //---- Åñëè äîñòèãíóò êîíåö ôàéëà, îñòàíàâëèâàåìñÿ
		     if(GetLastError() == 4099) 
		         break;
		     if(FileIsEnding(file_handle)) 
		         break;
		     SymbolsCount ++;
		     ArrayResize(Symbols, SymbolsCount + 1);
	    }
	  FileClose(file_handle);
	  string str;
	  for(int s = 0; s < SymbolsCount; s ++)
	    {
		     str = str + Symbols[s] + "\n";
	    }
	  Comment(str);	
	  file_handle = FileOpen(StringConcatenate("SymbolList(", AccountServer(), ").csv"), 
	                         FILE_CSV | FILE_WRITE );
	  if(file_handle < 0)
	    {
		     Print("Îøèáêà ¹", GetLastError(), " ïðè îòêðûòèè ôàéëà!!!");
		     return(-1);
	    }
	  FileWrite(file_handle,
					        "SYMBOL",
					        "POINT",
					        "DIGITS",
					        "SPREAD",
					        "STOPLEVEL",
					        "LOTSIZE",
					        "TICKVALUE",
					        "TICKSIZE",
					        "SWAPLONG",
					        "SWAPSHORT",
					        "STARTING",
					        "EXPIRATION",
					        "TRADEALLOWED",
					        "MINLOT",
					        "LOTSTEP",
					        "MAXLOT");
	  for(s = 0; s < SymbolsCount; s ++)
	    {
		     if(MarketInfo(Symbols[s], MODE_POINT) <= 0) 
		         continue;
		     FileWrite(file_handle, Symbols[s],
						           MarketInfo(Symbols[s], MODE_POINT),
						           MarketInfo(Symbols[s], MODE_DIGITS),
						           MarketInfo(Symbols[s], MODE_SPREAD),
						           MarketInfo(Symbols[s], MODE_STOPLEVEL),
						           MarketInfo(Symbols[s], MODE_LOTSIZE),
						           MarketInfo(Symbols[s], MODE_TICKVALUE),
						           MarketInfo(Symbols[s], MODE_TICKSIZE),
						           MarketInfo(Symbols[s], MODE_SWAPLONG),
						           MarketInfo(Symbols[s], MODE_SWAPSHORT),
						           MarketInfo(Symbols[s], MODE_STARTING),
						           MarketInfo(Symbols[s], MODE_EXPIRATION),
						           MarketInfo(Symbols[s], MODE_TRADEALLOWED),
						           MarketInfo(Symbols[s], MODE_MINLOT),
						           MarketInfo(Symbols[s], MODE_LOTSTEP),
						           MarketInfo(Symbols[s], MODE_MAXLOT));
	    }
	  FileClose(file_handle);
	  return(0);
  }
//+------------------------------------------------------------------+


Comments