Author: Copyright � 2009, toxa.forex
CFD v1.0

This script is designed to automatically scan and identify tradable financial instruments (symbols) within your trading platform. Instead of requiring you to manually enter every available asset, the tool systematically explores the market to build a comprehensive list of options for your use.

How the Logic Works:

1. Systematic Market Scanning The script operates by generating combinations of characters based on specific numerical ranges (standard keyboard symbols and letters). It essentially "builds" names one character at a time to see what exists in your broker's market.

2. Multilevel Combination Discovery The tool searches for assets through four levels of complexity:

  • Single Character: It first checks for symbols starting with a single prefix (e.g., #A).
  • Two-Character: It then checks for combinations of two characters (e.g., #AB).
  • Three-Character: It expands further to three-character combinations (e.g., #ABC).
  • Four-Character: Finally, it checks for four-character combinations (e.g., #ABCD).

3. Permission Verification The script doesn't just list every possible combination of letters; it performs a live "handshake" with your broker. It asks the platform: "Is this specific symbol actually allowed for trading?" Only if the broker confirms that the symbol is active and tradable does the script add it to its internal list.

4. Automatic List Building As the script successfully identifies these valid symbols, it stores them in a master list (an array). This allows the software to "map out" your available trading environment automatically, ensuring that any instruments supported by your broker are captured without manual configuration.

Summary for the User

Essentially, this is an auto-discovery tool. It acts like a scout that runs through all possible naming conventions provided by your broker to create a complete directory of tradable assets, making it easier for the system to recognize what you can actually trade.

9 Views
0 Downloads
0 Favorites
CFD v1.0
//=============================================================
//CFD v1.0.mq4
//Copyright © 2009, toxa.forex
//toxa.forex@mail.ru
//=============================================================
#property copyright "Copyright © 2009, toxa.forex"
#property link   "toxa.forex@mail.ru"
//=============================================================
extern string prefix = "#";
string symbols[];
//=============================================================
//expert initialization function
//=============================================================
int init()
  {
   //==========================================
   
   //==========================================
   return(0);
  }
//============================================================= " 
//expert deinitialization function
//=============================================================
int deinit()
  {
   //==========================================
   
   //==========================================
   return(0);
  }
//=============================================================
//expert start function
//=============================================================
int start()
  {
   //==========================================
   if(ArraySize(symbols)==0)
   {
      for(int s1=48; s1<91; s1++)
      {
         if((s1<58)||(s1>64))  
         {
            if(MarketInfo(StringConcatenate(prefix, CharToStr(s1)), MODE_TRADEALLOWED)==1)
            {
               ArrayResize(symbols, ArraySize(symbols)+1);
               symbols[ArraySize(symbols)-1] = StringConcatenate(prefix, CharToStr(s1));
            }
            //====================================================
            for(int s2=35; s2<91; s2++)
            {
               if((s2<58)||(s2>64))  
               {
                  if(MarketInfo(StringConcatenate(prefix, CharToStr(s1), CharToStr(s2)), MODE_TRADEALLOWED)==1)
                  {
                     ArrayResize(symbols, ArraySize(symbols)+1);
                     symbols[ArraySize(symbols)-1] = StringConcatenate(prefix, CharToStr(s1), CharToStr(s2));

                  }
                  //====================================================
                  for(int s3=35; s3<91; s3++)
                  {
                     if((s3<58)||(s3>64))  
                     {
                        if(MarketInfo(StringConcatenate(prefix, CharToStr(s1), CharToStr(s2), CharToStr(s3)), MODE_TRADEALLOWED)==1)
                        {
                           ArrayResize(symbols, ArraySize(symbols)+1);
                           symbols[ArraySize(symbols)-1] = StringConcatenate(prefix, CharToStr(s1), CharToStr(s2), CharToStr(s3));

                        }
                        //====================================================
                        for(int s4=35; s4<91; s4++)
                        {
                           if((s2<58)||(s2>64))  
                           {
                              if(MarketInfo(StringConcatenate(prefix, CharToStr(s1), CharToStr(s2), CharToStr(s3), CharToStr(s4)), MODE_TRADEALLOWED)==1)
                              {
                                 ArrayResize(symbols, ArraySize(symbols)+1);
                                 symbols[ArraySize(symbols)-1] = StringConcatenate(prefix, CharToStr(s1), CharToStr(s2), CharToStr(s3), CharToStr(s4));

                              }
                              //====================================================
                           
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }
   //==========================================
   return(0);
  }
//=============================================================

Comments