Download MetaTrader 5

Enumerated lists code chunks, by category (MQL4 and MQL5)

To add comments, please log in or register
No time to learn MQL5? The source code library is at your service!
JD4
1101
JD4 2015.07.10 23:13 

Code examples for Enumerated lists of currency pairs. Mods and admins, if there is a better place in code base for this, please feel free to move it (other than to the trash can). I did not see one specific section that stood out to me, and I also think it doesn't belong on only MQL4 or only MQL5.  It would be a good idea if you could also select both.  I believe this works with MQL4 and MQL5, and is not a complete code example of anything other than an enumerated list.


These enum code chunks are for the currency pairs that are traded in ForEx.  I am giving permission to use this code at no charge, as long as you give me credit in the comments within your program.  To make this easier I have included a comment header within each code section.


This is not an endorsement of or a recommendation to trade any of the currency pairs listed below.  Use at your own risk.


That being said, I am giving this information freely and in good faith.  I am not responsible for the use (or misuse) of this information.  Do not come to me if you make use of this code and lose money on trades.


This code is given as is, no warranty expressed or implied, and is not guaranteed to be suitable for any particular use.  These code stubs are intentionally incomplete (as in, not a trading program or script or indicator).  By using this code, you understand and accept that the order of the pairs might not fit what your specific broker uses, and that the code presented below has not been tested under any situation at all or found to be of any specific use to anyone whatsoever.  You may still need to tweak it before it will work with your code, trading platform, and broker.  If you have any questions on that, please refer to the documentation for the code used by your specific trading platform.


The categories and pair order are from http://www.babypips.com/school/preschool/what-is-forex/currencies-are-traded-in-pairs.html.

The code style is (sort of) from https://www.mql5.com/en/docs/basis/types/integer/enumeration.



Major Currency Pairs


/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MajorCurrencyPairs   //  List of Major Currency Pairs
{
     EURUSD,
     USDJPY,
     GBPUSD,
     USDCHF,
     USDCAD,
     AUDUSD,
     NZDUSD
};

Major Cross-Currency Pairs or Minor Currency Pairs

Euro Crosses

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum EURCrossCurrencyPairs   //  EUR Minor Currency Pairs
{
     EURCHF,
     EURGBP,
     EURCAD,
     EURAUD,
     EURNZD
};

Yen Crosses

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum JPYCrossCurrencyPairs  // JPY Minor Currency Pairs
{
     EURJPY,
     GBPJPY,
     CHFJPY,
     CADJPY,
     AUDJPY,
     NZDJPY
};

Pound Crosses

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum GBPCrossCurrencyPairs  // GBP Cross Currency Pairs
{
     GBPCHF,
     GBPAUD,
     GBPCAD,
     GBPNZD
};

Other Crosses

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MinorCrossCurrencyPairs  // Minor Currency pairs other than those in EUR, GBP, or JPY
{
     AUDCHF,
     AUDCAD,
     AUDNZD,
     CADCHF,
     NZDCHF,
     NZDCAD
};


List of all Minor Currency Pairs

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MinorCurrencyPairs  // List of Minor Currency (Major-Cross) Pairs
{  
     EURCHF,             //  EUR Cross Currency Pair
     EURGBP,             //  EUR Cross Currency Pair
     EURCAD,             //  EUR Cross Currency Pair
     EURAUD,             //  EUR Cross Currency Pair
     EURNZD,             //  EUR Cross Currency Pair

     EURJPY,             //  JPY Cross Currency Pair
     GBPJPY,             //  JPY Cross Currency Pair
     CHFJPY,             //  JPY Cross Currency Pair
     CADJPY,             //  JPY Cross Currency Pair
     AUDJPY,             //  JPY Cross Currency Pair
     NZDJPY,             //  JPY Cross Currency Pair

     GBPCHF,             //  GBP Cross Currency Pair
     GBPAUD,             //  GBP Cross Currency Pair
     GBPCAD,             //  GBP Cross Currency Pair
     GBPNZD,             //  GBP Cross Currency Pair

     AUDCHF,             //  Major Cross Currency Pair other than EUR, JPY, or GBP
     AUDCAD,             //  Major Cross Currency Pair other than EUR, JPY, or GBP
     AUDNZD,             //  Major Cross Currency Pair other than EUR, JPY, or GBP
     CADCHF,             //  Major Cross Currency Pair other than EUR, JPY, or GBP
     NZDCHF,             //  Major Cross Currency Pair other than EUR, JPY, or GBP
     NZDCAD              //  Major Cross Currency Pair other than EUR, JPY, or GBP
};


Exotic Currency Pairs

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ExoticCurrencyPairs  // Other pairs with the USD and non-standard currencies
{
     USDHKD,
     USDSGD,
     USDZAR,
     USDTHB,
     USDMXN,
     USDDKK,
     USDSEK,
     USDNOK
};


List of all Currency Pairs

/*
 *   Created by MQL4 and MQL5 user JD4 on July 10, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum AllCurrencyPairs  // List of all currency pairs
{
     EURUSD,           //  Major Currency Pair
     USDJPY,           //  Major Currency Pair
     GBPUSD,           //  Major Currency Pair
     USDCHF,           //  Major Currency Pair
     USDCAD,           //  Major Currency Pair
     AUDUSD,           //  Major Currency Pair
     NZDUSD,           //  Major Currency Pair

     EURCHF,           //  EUR Cross Currency Pair
     EURGBP,           //  EUR Cross Currency Pair
     EURCAD,           //  EUR Cross Currency Pair
     EURAUD,           //  EUR Cross Currency Pair
     EURNZD,           //  EUR Cross Currency Pair

     EURJPY,           //  JPY Cross Currency Pair
     GBPJPY,           //  JPY Cross Currency Pair
     CHFJPY,           //  JPY Cross Currency Pair
     CADJPY,           //  JPY Cross Currency Pair
     AUDJPY,           //  JPY Cross Currency Pair
     NZDJPY,           //  JPY Cross Currency Pair

     GBPCHF,           //  GBP Cross Currency Pair
     GBPAUD,           //  GBP Cross Currency Pair
     GBPCAD,           //  GBP Cross Currency Pair
     GBPNZD,           //  GBP Cross Currency Pair

     AUDCHF,           //  Major Cross Currency Pair other than EUR, JPY, or GBP
     AUDCAD,           //  Major Cross Currency Pair other than EUR, JPY, or GBP
     AUDNZD,           //  Major Cross Currency Pair other than EUR, JPY, or GBP
     CADCHF,           //  Major Cross Currency Pair other than EUR, JPY, or GBP
     NZDCHF,           //  Major Cross Currency Pair other than EUR, JPY, or GBP
     NZDCAD,           //  Major Cross Currency Pair other than EUR, JPY, or GBP

     USDHKD,           // Exotic Pair
     USDSGD,           // Exotic Pair
     USDZAR,           // Exotic Pair
     USDTHB,           // Exotic Pair
     USDMXN,           // Exotic Pair
     USDDKK,           // Exotic Pair
     USDSEK,           // Exotic Pair
     USDNOK            // Exotic Pair
};
Buying And Selling In Currency Pairs
Buying And Selling In Currency Pairs
  • www.babypips.com
Forex trading is the simultaneous buying of one currency and selling another. Currencies are traded through a broker or dealer, and are traded in pairs; for example the euro and the U.S. dollar (EUR/USD) or the British pound and the Japanese yen (GBP/JPY). When you trade in the forex market, you buy or sell in currency pairs. Imagine each...
JD4
1101
JD4 2015.07.15 05:28  

After doing some more research within the specific MT4 and MT5 Trading platforms, I found the spot to list the pairs that are available on them.  The conditions for the above code stubs apply to these code stubs as well, they are intentionally incomplete (not functioning scripts or EAs) and free use of them is allowed under the GNU GPLv3 copyleft license to anyone who wishes to do so.  The use of this license to apply to these code stubs does not automatically extend that same license condition to any other materials listed on the MQ4.com and MQL5.com websites, or any other MetaQuotes websites, nor any copyrighted materials from MetaQuotes or any of their website or trading platform users.  As above, you accept that they may or may not work with your specific situation, and that I am not responsible for any money lost trading any and all of these pairs.  The symbol groupings in this post are from within the MT4 platform by using CTRL+U.


MT4 symbols in this list, MT5 in the next one

ForexPRO1

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO1  // MT4 section ForexPRO1
{
     CADCHFpro, // Canadian Dollar vs Swiss Franc
     EURCHFpro, // Euro vs Swiss Franc
     EURCZKpro, // Euro vs Czech Koruna
     EURDKKpro, // Euro vs Danish Krone
     EURHUFpro, // Euro vs Hungarian Forints
     EURNOKpro, // Euro vs Norwegian Krone
     EURPLNpro, // Euro vs Polish Zloty
     EURSEKpro, // Euro vs Swedish Krona
     SGDJPYpro, // Singapore Dollar vs Japanese Yen
     USDCNHpro, // US Dollar vs Chinese Yuan
     USDCZKpro, // US Dollar vs Czech Koruna
     USDHUFpro, // US Dollar vs Hungarian Forints
     USDMXNpro, // US Dollar vs Mexican Peso
     USDNOKpro, // US Dollar vs Norwegian Krone
     USDPLNpro, // US Dollar vs Polish Zloty
     USDRUBpro, // US Dollar vs Russian Ruble
     USDSEKpro, // US Dollar vs Swedish Krona
     USDTRYpro, // US Dollar vs Turkish Lira
     USDZARpro  // US Dollar vs South African Rand
};


ForexPRO2

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO2  // MT4 section ForexPRO2
{
     AUDJPYpro, // Australian Dollar vs Japanese Yen
     AUDNZDpro, // Australian Dollar vs New Zealand Dollar
     CADJPYpro, // Canadian Dollar vs Japanese Yen
     GBPAUDpro, // Great Britain Pound vs Australian Dollar
     GBPCHFpro, // Great Britain Pound vs Swiss Franc
     NZDJPYpro  // New Zealand Dollar vs Japanese Yen
};


ForexPRO3

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO3  // MT4 section ForexPRO3
{
     EURGBPpro, // Euro vs Great Britain Pound
     EURNZDpro, // Euro vs New Zealand Dollar
     GBPCADpro, // Great Britain Pound vs Canadian Dollar
     GBPJPYpro, // Great Britain Pound vs Japanese Yen
     NZDCADpro, // New Zealand Dollar vs Canadian Dollar
     NZDCHFpro, // New Zealand Dollar vs Swiss Franc
     USDDKKpro  // US Dollar vs Danish Krone
};

ForexPRO4

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO4  // MT4 section ForexPRO4
{
     EURAUDpro, // Euro vs Australian Dollar
     EURCADpro, // Euro vs Canadian Dollar
     GBPNZDpro  // Great Britain Pound vs New Zealand Dollar
};


ForexPRO5

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO5  // MT4 group ForexPRO5
{
     EURTRYpro, // Euro vs Turkish Lira
     GBPUSDpro, // Great Britain Pound vs US Dollar
     USDCADpro, // US Dollar vs Canadian Dollar
     USDJPYpro  // US Dollar vs Japanese Yen
};


ForexPRO6

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO6  // MT4 group ForexPRO6
{
     EURJPYpro, // Euro vs Japanese Yen
     EURUSDpro  // Euro vs US Dollar
};


ForexPRO7

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum ForexPRO7  // MT4 group ForexPRO7
{
     AUDCADpro, // Australian Dollar vs Canadian Dollar
     AUDCHFpro, // Australian Dollar vs Swiss Franc
     AUDUSDpro, // Australian Dollar vs US Dollar
     CHFJPYpro, // Swiss Franc vs Japanese Yen
     NZDUSDpro, // New Zealand Dollar vs US Dollar
     USDCHFpro, // US Dollar vs Swiss Franc
     USDSGDpro, // US Dollar vs Singapore Dollar
     ZARJPYpro  // South African Rand vs Japanese Yen
};


All MT4 ForexPRO Symbols, Groups 1-7

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum AllMT4ForexPROSymbols  // Groups 1-7
{
     // ForexPRO1
     CADCHFpro,             // Canadian Dollar vs Swiss Franc
     EURCHFpro,             // Euro vs Swiss Franc
     EURCZKpro,             // Euro vs Czech Koruna
     EURDKKpro,             // Euro vs Danish Krone
     EURHUFpro,             // Euro vs Hungarian Forints
     EURNOKpro,             // Euro vs Norwegian Krone
     EURPLNpro,             // Euro vs Polish Zloty
     EURSEKpro,             // Euro vs Swedish Krona
     SGDJPYpro,             // Singapore Dollar vs Japanese Yen
     USDCNHpro,             // US Dollar vs Chinese Yuan
     USDCZKpro,             // US Dollar vs Czech Koruna
     USDHUFpro,             // US Dollar vs Hungarian Forints
     USDMXNpro,             // US Dollar vs Mexican Peso
     USDNOKpro,             // US Dollar vs Norwegian Krone
     USDPLNpro,             // US Dollar vs Polish Zloty
     USDRUBpro,             // US Dollar vs Russian Ruble
     USDSEKpro,             // US Dollar vs Swedish Krona
     USDTRYpro,             // US Dollar vs Turkish Lira
     USDZARpro,             // US Dollar vs South African Rand

     // ForexPRO2
     AUDJPYpro,             // Australian Dollar vs Japanese Yen
     AUDNZDpro,             // Australian Dollar vs New Zealand Dollar
     CADJPYpro,             // Canadian Dollar vs Japanese Yen
     GBPAUDpro,             // Great Britain Pound vs Australian Dollar
     GBPCHFpro,             // Great Britain Pound vs Swiss Franc
     NZDJPYpro,             // New Zealand Dollar vs Japanese Yen

     // ForexPRO3
     EURGBPpro,             // Euro vs Great Britain Pound
     EURNZDpro,             // Euro vs New Zealand Dollar
     GBPCADpro,             // Great Britain Pound vs Canadian Dollar
     GBPJPYpro,             // Great Britain Pound vs Japanese Yen
     NZDCADpro,             // New Zealand Dollar vs Canadian Dollar
     NZDCHFpro,             // New Zealand Dollar vs Swiss Franc
     USDDKKpro,             // US Dollar vs Danish Krone

     // ForexPRO4
     EURAUDpro,             // Euro vs Australian Dollar
     EURCADpro,             // Euro vs Canadian Dollar
     GBPNZDpro,             // Great Britain Pound vs New Zealand Dollar

     // ForexPRO5
     EURTRYpro,             // Euro vs Turkish Lira
     GBPUSDpro,             // Great Britain Pound vs US Dollar
     USDCADpro,             // US Dollar vs Canadian Dollar
     USDJPYpro,             // US Dollar vs Japanese Yen

     // ForexPRO6
     EURJPYpro,             // Euro vs Japanese Yen
     EURUSDpro,             // Euro vs US Dollar

     // ForexPRO7
     AUDCADpro,             // Australian Dollar vs Canadian Dollar
     AUDCHFpro,             // Australian Dollar vs Swiss Franc
     AUDUSDpro,             // Australian Dollar vs US Dollar
     CHFJPYpro,             // Swiss Franc vs Japanese Yen
     NZDUSDpro,             // New Zealand Dollar vs US Dollar
     USDCHFpro,             // US Dollar vs Swiss Franc
     USDSGDpro,             // US Dollar vs Singapore Dollar
     ZARJPYpro              // South African Rand vs Japanese Yen
};
JD4
1101
JD4 2015.07.15 06:55  

The conditions for the above code stubs apply to these code stubs as well, they are intentionally incomplete (not functioning scripts or EAs) and free use of them is allowed under the GNU GPLv3 copyleft license to anyone who wishes to do so.  The use of this license to apply to these code stubs does not automatically extend that same license condition to any other materials listed on the MQ4.com and MQL5.com websites, or any other MetaQuotes websites, nor any copyrighted materials from MetaQuotes or any of their website or trading platform users.  As above, you accept that they may or may not work with your specific situation, and that I am not responsible for any money that you may lose trading any and all of these pairs.  The symbol groupings in this post are from within the MT5 platform by using CTRL+U.


MT5 symbols in these lists


MT5 Forex Symbols

Forex Majors

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MT5ForexMajorCurrencyPairsList  // MT5 Forex Majors
{
     AUDUSD,                         // Australian Dollar vs US Dollar
     EURUSD,                         // Euro vs US Dollar
     GBPUSD,                         // Great Britain Pound vs US Dollar
     NZDUSD,                         // New Zealand Dollar vs US Dollar
     USDCAD,                         // US Dollar vs Canadian Dollar
     USDCHF,                         // US Dollar vs Swiss Franc
     USDHKD,                         // US Dollar vs Hong Kong Dollar
     USDJPY,                         // US Dollar vs Japanese Yen
     USDMXN,                         // US Dollar vs Mexican Peso
     USDSEK,                         // US Dollar vs Swedish Krona
     USDTRY,                         // US Dollar vs Turkish Lira
     USDZAR                          // US Dollar vs South African Rand
};


Forex Crosses

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MT5ForexCrossesCurrencyPairsList // MT5 Forex Crosses
{
     AUDCAD,                          // Australian Dollar vs Canadian Dollar
     AUDCHF,                          // Australian Dollar vs Swiss Franc
     AUDJPY,                          // Australian Dollar vs Japanese Yen
     AUDNZD,                          // Australian Dollar vs New Zealand Dollar
     CADCHF,                          // Canadian Dollar vs Swiss Franc
     CHFJPY,                          // Swiss Franc vs Japanese Yen
     EURAUD,                          // Euro vs Australian Dollar
     EURCAD,                          // Euro vs Canadian Dollar
     EURCHF,                          // Euro vs Swiss Franc
     EURGBP,                          // Euro vs Great Britain Pound
     EURHKD,                          // Euro vs Hong Kong Dollar
     EURJPY,                          // Euro vs Japanese Yen
     EURNZD,                          // Euro vs New Zealand Dollar
     EURTRY,                          // Euro vs Turkish Lira
     GBPCHF,                          // Great Britain Pound vs Swiss Franc
     GBPJPY,                          // Great Britain Pound vs Japanese Yen
     NZDCAD,                          // New Zealand Dollar vs Canadian Dollar
     NZDCHF,                          // New Zealand Dollar vs Swiss Franc
     NZDJPY,                          // New Zealand Dollar vs Japanese Yen
     NZDSGD,                          // New Zealand Dollar vs Singapore Dollar
     SGDJPY                           // Singapore Dollar vs Japanese Yen
};

Forex Conversion

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MT5ForexConversionCurrencyPairsList
{
     EURRUR, // Euro vs Russian Ruble
     USDRUR  // US Dollar vs Russian Ruble
};


All MT5 Forex Currency Pair Symbols

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MT5ForexCurrencyPairsList // All MT5 Forex Currency Pairs list
{
     // Forex Major
     AUDUSD,                   // Australian Dollar vs US Dollar
     EURUSD,                   // Euro vs US Dollar
     GBPUSD,                   // Great Britain Pound vs US Dollar
     NZDUSD,                   // New Zealand Dollar vs US Dollar
     USDCAD,                   // US Dollar vs Canadian Dollar
     USDCHF,                   // US Dollar vs Swiss Franc
     USDHKD,                   // US Dollar vs Hong Kong Dollar
     USDJPY,                   // US Dollar vs Japanese Yen
     USDMXN,                   // US Dollar vs Mexican Peso
     USDSEK,                   // US Dollar vs Swedish Krona
     USDTRY,                   // US Dollar vs Turkish Lira
     USDZAR,                   // US Dollar vs South African Rand

     // Forex Crosses
     AUDCAD,                   // Australian Dollar vs Canadian Dollar
     AUDCHF,                   // Australian Dollar vs Swiss Franc
     AUDJPY,                   // Australian Dollar vs Japanese Yen
     AUDNZD,                   // Australian Dollar vs New Zealand Dollar
     CADCHF,                   // Canadian Dollar vs Swiss Franc
     CHFJPY,                   // Swiss Franc vs Japanese Yen
     EURAUD,                   // Euro vs Australian Dollar
     EURCAD,                   // Euro vs Canadian Dollar
     EURCHF,                   // Euro vs Swiss Franc
     EURGBP,                   // Euro vs Great Britain Pound
     EURHKD,                   // Euro vs Hong Kong Dollar
     EURJPY,                   // Euro vs Japanese Yen
     EURNZD,                   // Euro vs New Zealand Dollar
     EURTRY,                   // Euro vs Turkish Lira
     GBPCHF,                   // Great Britain Pound vs Swiss Franc
     GBPJPY,                   // Great Britain Pound vs Japanese Yen
     NZDCAD,                   // New Zealand Dollar vs Canadian Dollar
     NZDCHF,                   // New Zealand Dollar vs Swiss Franc
     NZDJPY,                   // New Zealand Dollar vs Japanese Yen
     NZDSGD,                   // New Zealand Dollar vs Singapore Dollar
     SGDJPY,                   // Singapore Dollar vs Japanese Yen


     // Forex Conversion
     EURRUR,                   // Euro vs Russian Ruble
     USDRUR                    // US Dollar vs Russian Ruble
};


MT5 CFD

- Note: You will probably  have to edit this file's symbols to allow use of the # sign as a part of the symbol name.

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MT5CFDSymbolList
{
     #AA   // Alcoa Inc
     #AIG  // American International Group Inc
     #AXP  // American Express Company
     #BA   // Boeing Company
     #BAC  // Bank of America
     #C    // Citigroup Inc
     #CAT  // Caterpillar Inc
     #CVX  // Chevron
     #DD   // DuPont, E. I. du Pont de Nemours and Com
     #DIS  // Walt Disney Company
     #EK   // Eastman Kodak Company
     #GE   // General Electric Corporation
     #HD   // Home Depot Inc
     #HON  // Honeywell International Inc
     #HPQ  // Hewlett-Packard Company
     #IBM  // IBM Corporation
     #INTC // Intel Corporation
     #IP   // International Paper Company
     #JNJ  // Johnson & Johnson
     #JPM  // JPMorgan Chase & Co
     #KFT  // Kraft Foods
     #KO   // Coca-Cola Company
     #MCD  // McDonald's Corporation
     #MMM  // 3M Company
     #MO   // Altria Group Inc
     #MRK  // Merck & Co Inc
     #MSFT // Microsoft Corporation
     #PFE  // Pfizer Inc
     #PG   // Proctor & Gamble Company
     #T    // AT&T Inc
     #TRV  // Travelers
     #UTX  // United Technologies Corporation
     #VZ   // Verizon Commincations Inc
     #WMT  // Wal-Mart Stores Inc
     #XOM  // ExxonMobil Corporation
};


Metals

/*
 *   Created by MQL4 and MQL5 user JD4 on July 14, 2015.  This code stub is provided as-is under the GNU GPLv3 license, and is just for proof
 *   of concept, and has not been tested or certified to be of any actual use to anybody on any specific trading platform.  JD4 is giving this
 *   code freely and in good faith and is not responsible for any use (or misuse) of this code and is not accountable for any resulting trading
 *   losses.
 *
 *   Free use of this code is permitted under the GPLv3 copyleft license and requires that this license statement remains with this code stub.  This
 *   license is for this specific code stub only, and does not automatically apply to any and all works by JD4.  It's appearance on a MetaQuotes
 *   website does not automatically grant the same license to any other code, software, or parts of the MQL4.com or MQL5.com website or any other
 *   material to which MetaQuotes and it's users retain their respective individual and collective copyrights for.
 */

enum MT5ForexMetalsSymbolsList
{
     XAGUSD // Silver (Spot)
     XAUUSD // Gold (Spot)
     XPDUSD // Pallidum
     XPTUSD // Platinum
};
Ex Ovo Omnia
3151
Ex Ovo Omnia 2015.07.16 06:58  
You name all your enums with a word "list", so you probably wanted to create lists rather than enums. I cannot figure out where your enums would be used.
JD4
1101
JD4 2015.07.17 07:35  
Ovo Cz:
You name all your enums with a word "list", so you probably wanted to create lists rather than enums. I cannot figure out where your enums would be used.

These posts were meant as enums, due to a conversation being had in another thread.  Do not remember where it is atm.  But your solution would work as well.


The way the original idea was, if I remember correctly, someone was using an enum, but then was converting the name to an ID number, instead of using the enum'd name as it was designed for.  So, to provide a (hopefully) complete list of pairs, I tracked down the above information.

Marco vd Heijden
Moderator
4701
Marco vd Heijden 2015.07.17 07:43  

this belongs in Code Base.

https://www.mql5.com/en/code

MQL5 Code Base
MQL5 Code Base
  • www.mql5.com
MQL5 Source Code Library for MetaTrader 5
JD4
1101
JD4 2015.07.17 08:17  
Marco vd Heijden:

this belongs in Code Base.

https://www.mql5.com/en/code

More than happy to, except there is not a section that stood out to me, as I said in the first post of this thread.  It is not a complete example of anything, they are code stubs, and unless there is a section for them that I didn't see, IDK where they would fit.  I also asked the mods and admins to move them there it if they knew of a better place for it.
JD4
1101
JD4 2015.07.17 08:37  
Marco vd Heijden:

So you actually believe the admins are going to move all of this to a suited place because you don't know where to put it ? ...the sheer work involved !

There is a section that stands out to me.

I am not sure why it does not stand out to you... maybe it's time you open your eyes.

MQL4 Source Codes of Libraries for MetaTrader 4

Libraries are small sub-programs that can be used for developing new applications.

They do not execute trading or analytical functions and cannot be run in MetaTrader 4.

Their purpose is to simplify development of new applications in MQL4.

These applications can be downloaded and used in the editor of trading strategies MetaEditor.

https://www.mql5.com/en/code/mt4/libraries

I am more than happy to move it myself, if they think it is better there.  I did not think libraries would work as it is not a complete coded section, and not in a DLL format either.
Marco vd Heijden
Moderator
4701
Marco vd Heijden 2015.07.17 08:40  

why you could make your own.

a detector of such kind can come in real handy.

To add comments, please log in or register