Currency v1.0

Download script
Author: Copyright � 2009, toxa.forex
Currency v1.0

This script is designed to automatically scan and identify available currency trading pairs on your specific trading platform. Instead of requiring a user to manually input every possible combination of currencies, the tool automates this discovery process.

Here is a breakdown of how the logic works:

1. Comprehensive Database Initialization

The script begins by creating an extensive internal list containing standard three-letter currency codes (such as USD, EUR, GBP, JPY, etc.). It populates these into a structured list that serves as the foundation for all further actions.

2. Automated Pair Generation

Once the base list of currencies is loaded, the script performs a "cross-comparison" logic. It takes every currency in its database and attempts to match it against every other currency in that same list. This creates a theoretical matrix of every possible trading pair (e.g., matching "USD" with "EUR", "JPY", "GBP", and so on).

3. Real-Time Market Verification

This is the core functional step of the script:

  • Filtering: The script checks each theoretical pair against your actual live broker feed.
  • Trade Availability: It specifically looks for pairs where trading is actually permitted (enabled) on your account.
  • Validation: If a pair exists in the database and is active on your platform, the script "captures" it.

4. Dynamic Results Collection

Rather than just listing everything it finds, the script compiles these verified, tradable pairs into a single organized list (a dynamic array). This final list represents all the specific instruments you are currently authorized to trade based on the global currency codes provided in the initial database.

In summary: The script acts as an automated "scout." It looks at a massive dictionary of global currencies, tries every possible combination, and then filters out everything except for the specific trading pairs that your broker actually allows you to trade.

7 Views
0 Downloads
0 Favorites
Currency v1.0
//=============================================================
//Currency 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[],
       c1[182],
       c2[182];
//=============================================================
//expert initialization function
//=============================================================
int init()
  {
   //==========================================
   
   //==========================================
   return(0);
  }
//============================================================= " 
//expert deinitialization function
//=============================================================
int deinit()
  {
   //==========================================
   
   //==========================================
   return(0);
  }
//=============================================================
//expert start function
//=============================================================
int start()
  {
   //==========================================
   c1[0] = "AED";
   c1[1] = "AFN";
   c1[2] = "ALL";
   c1[3] = "AMD";
   c1[4] = "ANG";
   c1[5] = "AOA";
   c1[6] = "ARS";
   c1[7] = "AUD";
   c1[8] = "AWG";
   c1[9] = "AZN";
   c1[10] = "BAM";
   c1[11] = "BBD";
   c1[12] = "BDT";
   c1[13] = "BGN";
   c1[14] = "BHD";
   c1[15] = "BIF";
   c1[16] = "BMD";
   c1[17] = "BND";
   c1[18] = "BOB";
   c1[19] = "BOV";
   c1[20] = "BRL";
   c1[21] = "BSD";
   c1[22] = "BTN";
   c1[23] = "BWP";
   c1[24] = "BYR";
   c1[25] = "BZD";
   c1[26] = "CAD";
   c1[27] = "CDF";
   c1[28] = "CHE";
   c1[29] = "CHF";
   c1[30] = "CHW";
   c1[31] = "CLF";
   c1[32] = "CLP";
   c1[33] = "CNY";
   c1[34] = "COP";
   c1[35] = "COU";
   c1[36] = "CRC";
   c1[37] = "CUC";
   c1[38] = "CUP";
   c1[39] = "CVE";
   c1[40] = "CZK";
   c1[41] = "DJF";
   c1[42] = "DKK";
   c1[43] = "DOP";
   c1[44] = "DZD";
   c1[45] = "EEK";
   c1[46] = "EGP";
   c1[47] = "ERN";
   c1[48] = "ETB";
   c1[49] = "EUR";
   c1[50] = "FJD";
   c1[51] = "FKP";
   c1[52] = "GBP";
   c1[53] = "GEL";
   c1[54] = "GHS";
   c1[55] = "GIP";
   c1[56] = "GMD";
   c1[57] = "GNF";
   c1[58] = "GTQ";
   c1[59] = "GWP";
   c1[60] = "GYD";
   c1[61] = "HKD";
   c1[62] = "HNL";
   c1[63] = "HRK";
   c1[64] = "HTG";
   c1[65] = "HUF";
   c1[66] = "IDR";
   c1[67] = "ILS";
   c1[68] = "INR";
   c1[69] = "INR";
   c1[70] = "IQD";
   c1[71] = "IRR";
   c1[72] = "ISK";
   c1[73] = "JMD";
   c1[74] = "JOD";
   c1[75] = "JPY";
   c1[76] = "KES";
   c1[77] = "KGS";
   c1[78] = "KHR";
   c1[79] = "KMF";
   c1[80] = "KPW";
   c1[81] = "KRW";
   c1[82] = "KWD";
   c1[83] = "KYD";
   c1[84] = "KZT";
   c1[85] = "LAK";
   c1[86] = "LBP";
   c1[87] = "LKR";
   c1[88] = "LRD";
   c1[89] = "LSL";
   c1[90] = "LTL";
   c1[91] = "LVL";
   c1[92] = "LYD";
   c1[93] = "MAD";
   c1[94] = "MDL";
   c1[95] = "MGA";
   c1[96] = "MKD";
   c1[97] = "MMK";
   c1[98] = "MNT";
   c1[99] = "MOP";
   c1[100] = "MRO";
   c1[101] = "MUR";
   c1[102] = "MVR";
   c1[103] = "MWK";
   c1[104] = "MXN";
   c1[105] = "MXV";
   c1[106] = "MYR";
   c1[107] = "MZN";
   c1[108] = "NAD";
   c1[109] = "NGN";
   c1[110] = "NIO";
   c1[111] = "NOK";
   c1[112] = "NPR";
   c1[113] = "NZD";
   c1[114] = "OMR";
   c1[115] = "PAB";
   c1[116] = "PEN";
   c1[117] = "PGK";
   c1[118] = "PHP";
   c1[119] = "PKR";
   c1[120] = "PLN";
   c1[121] = "PYG";
   c1[122] = "QAR";
   c1[123] = "RON";
   c1[124] = "RSD";
   c1[125] = "RUB";
   c1[126] = "RWF";
   c1[127] = "SAR";
   c1[128] = "SBD";
   c1[129] = "SCR";
   c1[130] = "SDG";
   c1[131] = "SEK";
   c1[132] = "SGD";
   c1[133] = "SHP";
   c1[134] = "SLL";
   c1[135] = "SOS";
   c1[136] = "SRD";
   c1[137] = "STD";
   c1[138] = "SVC";
   c1[139] = "SYP";
   c1[140] = "SZL";
   c1[141] = "THB";
   c1[142] = "TJS";
   c1[143] = "TMT";
   c1[144] = "TND";
   c1[145] = "TOP";
   c1[146] = "TRY";
   c1[147] = "TTD";
   c1[148] = "TWD";
   c1[149] = "TZS";
   c1[150] = "UAH";
   c1[151] = "UGX";
   c1[152] = "USD";
   c1[153] = "USN";
   c1[154] = "USS";
   c1[155] = "UYI";
   c1[156] = "UYU";
   c1[157] = "UZS";
   c1[158] = "VEF";
   c1[159] = "VND";
   c1[160] = "VUV";
   c1[161] = "WST";
   c1[162] = "XAF";
   c1[163] = "XAG";
   c1[164] = "XAU";
   c1[165] = "XBA";
   c1[166] = "XBB";
   c1[167] = "XBC";
   c1[168] = "XBD";
   c1[169] = "XCD";
   c1[170] = "XDR";
   c1[171] = "XFU";
   c1[172] = "XOF";
   c1[173] = "XPD";
   c1[174] = "XPF";
   c1[175] = "XPT";
   c1[176] = "XTS";
   c1[177] = "XXX";
   c1[178] = "YER";
   c1[179] = "ZAR";
   c1[180] = "ZMK";
   c1[181] = "ZWL";
   
   ArrayCopy(c2, c1);
   if(ArraySize(symbols)==0)
   {
      for(int s1=0; s1<ArraySize(c1); s1++)
      {
         for(int s2=0; s2<ArraySize(c2); s2++)
         {
            if((c1[s1] != c2[s2])&&(MarketInfo(StringConcatenate(prefix, c1[s1], c2[s2]), MODE_TRADEALLOWED) == 1))
            {
               ArrayResize(symbols, ArraySize(symbols)+1);
               symbols[ArraySize(symbols)-1] = StringConcatenate(prefix, c1[s1], c2[s2]);
            }
         }
      } 
   }
   //==========================================
   return(0);
  }
//=============================================================

Comments