SymbolList_fromSet_mini

Download script
Author: Copyright � 2006, komposter
SymbolList_fromSet_mini

This script is designed to automate the process of gathering technical data for multiple trading symbols from an external list and exporting that information into a structured spreadsheet format. Essentially, it acts as a data harvester that bridges the gap between your saved preference files and a usable CSV report.

How the Logic Works

1. Reading the Source List The process begins by looking for a specific configuration file (defined by the user) that contains a list of currency pairs or trading symbols. The script opens this file and reads through it line by line, identifying every individual symbol you have listed.

2. Data Validation As the script moves through your list, it checks each symbol against the live market environment. It specifically looks for "Point" values to ensure that the symbol is valid and active. If a symbol in your list is not recognized by the trading platform, the script intelligently skips it and moves on to the next one to prevent errors.

3. Harvesting Market Specifications For every valid symbol found, the script pulls a comprehensive suite of technical specifications. Rather than just grabbing the name of the currency pair, it retrieves deep-level market data, including:

  • Pricing Mechanics: Point values, decimal digits, and current spreads.
  • Trading Limits: Minimum and maximum lot sizes, lot steps, and trade permissions.
  • Contract Details: Tick values, tick sizes, and swap rates for long and short positions.
  • Margin & Risk Requirements: Initial margin, maintenance margins, required margin, and expiration details.

4. Generating the Output Report Once the data has been collected, the script compiles all this information into a new file named Symbols_Mini.csv. It organizes the data into a clean, comma-separated format that can be easily opened in software like Microsoft Excel or Google Sheets.

5. Visual Confirmation In addition to creating the file, the script provides immediate feedback on your chart screen by displaying the list of symbols it processed, allowing you to quickly verify which assets were included in the final report.

Miscellaneous
Uses files from the file systemIt reads information from a fileIt writes information to file
10 Views
0 Downloads
0 Favorites
SymbolList_fromSet_mini
//+------------------------------------------------------------------+
//|                                           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("Symbols_Mini.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",
					        "MARGININIT",
					        "MARGINMAINTENANCE",
					        "MARGINREQUIRED"
					        
					        );
*/					        
	  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),
						           MarketInfo(Symbols[s], MODE_MARGININIT),
						           MarketInfo(Symbols[s], MODE_MARGINMAINTENANCE),
						           MarketInfo(Symbols[s], MODE_MARGINREQUIRED));
	    }
	  FileClose(file_handle);
	  return(0);
  }
//+------------------------------------------------------------------+


Comments