├── .gitattributes ├── 1-mql4-mql5-differences-getting-started └── README.md ├── 2-accessing-ohlcv-bid-ask-prices-in-mql5 └── README.md ├── 3-accessing-symbol-information-in-mql5 ├── MQL4_SymbolInformation_Tests_1.mq4 ├── MQL_SymbolInformation_Tests_1.mq5 └── README.md ├── README.md └── resources └── images ├── README.md └── video-play-button.png /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-vendored 2 | *.mq5 linguist-vendored=false 3 | -------------------------------------------------------------------------------- /1-mql4-mql5-differences-getting-started/README.md: -------------------------------------------------------------------------------- 1 | ## Migrating from MQL4 to MQL5: Guidance for Algorithmic Traders 2 | ### Tutorial 1 - Differences between MetaTrader 4 and MetaTrader 5. 3 | 4 | With this series of tutorials, we aim to educate MetaTrader 4 (MQL4) users on the benefits of MetaTrader 5 over its predecessor MetaTrader 4. 5 | 6 | All content is specifically geared towards algorithmic traders currently using MQL4, with the aim of making a case for transition from MQL4 to MQL5, and providing the knowledge needed to ensure it is a smooth, educated endeavour. 7 | 8 | In this 1st video, we discuss the key differences between the two platforms that are relevant from an MQL programmer's perspective, and lay out the way forward. 9 | 10 | Enjoy! 11 | 12 | ### Video Tutorial: 13 | 14 | --- 15 | 16 | # Are you an algorithmic trader? 17 | 18 | We'd love to have your strategy listed on our Exchange, enabling you to earn performance fees on investor profits! 19 | 20 | More details here: 21 | https://www.darwinex.com/?utm_source=github&utm_medium=video-1-readme&utm_content=migrating-mql4-mql5-differences-between-platform 22 | 23 | 2.0M in performance fees paid to date: 24 | https://www.darwinex.com/darwinia/hall-of-fame/users?utm_source=github&utm_medium=video-1-readme&utm_content=migrating-mql4-mql5-differences-between-platform 25 | 26 | Topics: #algorithmictrading #mql4 #mql5 #metatrader4 #metatrader5 #metatrader #darwinex 27 | -------------------------------------------------------------------------------- /2-accessing-ohlcv-bid-ask-prices-in-mql5/README.md: -------------------------------------------------------------------------------- 1 | ## Migrating from MQL4 to MQL5: Guidance for Algorithmic Traders 2 | ### Tutorial 2 - Accessing OHLCV and Bid/Ask Prices in MQL5 vs MQL4 3 | 4 | This tutorial shows algorithmic traders using MetaTrader 4 (MQL4), how to retrieve current BID / ASK and historical OHLCV prices in MQL5 (MetaTrader 5). 5 | 6 | MQL4 makes these accessible via pre-defined variables Bid and Ask, and arrays Open, High, Low, Close, Time and Volume. 7 | 8 | ### In MQL5, the same prices can be retrieved in 3 ways, via: 9 | 10 | 1) iTime, iOpen, iHigh, iLow, iClose and iTickVolume 11 | 2) CopyTime, CopyOpen, CopyHigh, CopyLow, CopyClose, CopyTickVolume functions 12 | 3) CopyRates, using the MqlRates struct 13 | 14 | For further information on Time Series access in MQL5, please visit: 15 | https://www.mql5.com/en/docs/series 16 | 17 | All content is specifically geared towards algorithmic traders currently using MQL4, with the aim of making a case for transition from MQL4 to MQL5, and providing the knowledge needed to ensure it is a smooth, educated endeavour. 18 | 19 | Video Tutorial: 20 | -- 21 | 22 | 23 | All content is specifically geared towards algorithmic traders currently using MQL4, with the aim of making a case for transition from MQL4 to MQL5, and providing the knowledge needed to ensure it is a smooth, educated endeavour. 24 | 25 | 26 | # Are you an algorithmic trader? 27 | 28 | We'd love to have your strategy listed on our Exchange, enabling you to earn performance fees on investor profits! 29 | 30 | More details here: 31 | https://www.darwinex.com/?utm_source=github&utm_medium=video-2-readme&utm_content=accessing-ohlcv-bid-ask-prices-in-mql5 32 | 33 | 34 | 2.0M in performance fees paid to date: 35 | https://www.darwinex.com/darwinia/hall-of-fame/users?utm_source=github&utm_medium=video-2-readme&utm_content=accessing-ohlcv-bid-ask-prices-in-mql5 36 | 37 | Topics: #algorithmictrading #mql4 #mql5 #metatrader4 #metatrader5 #metatrader #darwinex 38 | -------------------------------------------------------------------------------- /3-accessing-symbol-information-in-mql5/MQL4_SymbolInformation_Tests_1.mq4: -------------------------------------------------------------------------------- 1 | //+------------------------------------------------------------------+ 2 | //| MQL4_SymbolInformation_Tests_1.mq4 | 3 | //| Copyright 2019, MetaQuotes Software Corp. | 4 | //| https://www.mql5.com | 5 | //+------------------------------------------------------------------+ 6 | #property copyright "Copyright 2019, MetaQuotes Software Corp." 7 | #property link "https://www.mql5.com" 8 | #property version "1.00" 9 | #property strict 10 | //+------------------------------------------------------------------+ 11 | //| Expert initialization function | 12 | //+------------------------------------------------------------------+ 13 | int OnInit() 14 | { 15 | //--- 16 | /* 17 | MarketInfo() - Examples 18 | https://docs.mql4.com/constants/environment_state/marketinfoconstants 19 | */ 20 | 21 | Print("Low day price=",MarketInfo(Symbol(),MODE_LOW)); 22 | Print("High day price=",MarketInfo(Symbol(),MODE_HIGH)); 23 | Print("The last incoming tick time=",(MarketInfo(Symbol(),MODE_TIME))); 24 | Print("Last incoming bid price=",MarketInfo(Symbol(),MODE_BID)); 25 | Print("Last incoming ask price=",MarketInfo(Symbol(),MODE_ASK)); 26 | Print("Point size in the quote currency=",MarketInfo(Symbol(),MODE_POINT)); 27 | Print("Digits after decimal point=",MarketInfo(Symbol(),MODE_DIGITS)); 28 | Print("Spread value in points=",MarketInfo(Symbol(),MODE_SPREAD)); 29 | Print("Stop level in points=",MarketInfo(Symbol(),MODE_STOPLEVEL)); 30 | Print("Lot size in the base currency=",MarketInfo(Symbol(),MODE_LOTSIZE)); 31 | Print("Tick value in the deposit currency=",MarketInfo(Symbol(),MODE_TICKVALUE)); 32 | Print("Tick size in points=",MarketInfo(Symbol(),MODE_TICKSIZE)); 33 | Print("Swap of the buy order=",MarketInfo(Symbol(),MODE_SWAPLONG)); 34 | Print("Swap of the sell order=",MarketInfo(Symbol(),MODE_SWAPSHORT)); 35 | Print("Market starting date (for futures)=",MarketInfo(Symbol(),MODE_STARTING)); 36 | Print("Market expiration date (for futures)=",MarketInfo(Symbol(),MODE_EXPIRATION)); 37 | Print("Trade is allowed for the symbol=",MarketInfo(Symbol(),MODE_TRADEALLOWED)); 38 | Print("Minimum permitted amount of a lot=",MarketInfo(Symbol(),MODE_MINLOT)); 39 | Print("Step for changing lots=",MarketInfo(Symbol(),MODE_LOTSTEP)); 40 | Print("Maximum permitted amount of a lot=",MarketInfo(Symbol(),MODE_MAXLOT)); 41 | Print("Swap calculation method=",MarketInfo(Symbol(),MODE_SWAPTYPE)); 42 | Print("Profit calculation mode=",MarketInfo(Symbol(),MODE_PROFITCALCMODE)); 43 | Print("Margin calculation mode=",MarketInfo(Symbol(),MODE_MARGINCALCMODE)); 44 | Print("Initial margin requirements for 1 lot=",MarketInfo(Symbol(),MODE_MARGININIT)); 45 | Print("Margin to maintain open orders calculated for 1 lot=",MarketInfo(Symbol(),MODE_MARGINMAINTENANCE)); 46 | Print("Hedged margin calculated for 1 lot=",MarketInfo(Symbol(),MODE_MARGINHEDGED)); 47 | Print("Free margin required to open 1 lot for buying=",MarketInfo(Symbol(),MODE_MARGINREQUIRED)); 48 | Print("Order freeze level in points=",MarketInfo(Symbol(),MODE_FREEZELEVEL)); 49 | 50 | //--- 51 | return(INIT_SUCCEEDED); 52 | } 53 | //+------------------------------------------------------------------+ 54 | //| Expert deinitialization function | 55 | //+------------------------------------------------------------------+ 56 | void OnDeinit(const int reason) 57 | { 58 | //--- 59 | 60 | } 61 | //+------------------------------------------------------------------+ 62 | //| Expert tick function | 63 | //+------------------------------------------------------------------+ 64 | void OnTick() 65 | { 66 | //--- 67 | 68 | } 69 | //+------------------------------------------------------------------+ 70 | -------------------------------------------------------------------------------- /3-accessing-symbol-information-in-mql5/MQL_SymbolInformation_Tests_1.mq5: -------------------------------------------------------------------------------- 1 | //+------------------------------------------------------------------+ 2 | //| MQL_SymbolInformation_Tests_1.mq5 | 3 | //| Copyright 2018, Darwinex Labs | 4 | //| https://www.darwinex.com | 5 | //+------------------------------------------------------------------+ 6 | #property copyright "Copyright 2019, Darwinex Labs." 7 | #property link "https://www.darwinex.com" 8 | #property version "1.00" 9 | //+------------------------------------------------------------------+ 10 | //| Expert initialization function | 11 | //+------------------------------------------------------------------+ 12 | 13 | int OnInit() 14 | { 15 | //--- 16 | 17 | /***************************************************** 18 | * VIDEO 3: Getting Symbol Information in MQL5 vs MQL4 19 | *****************************************************/ 20 | 21 | /* SymbolInfoString() */ 22 | 23 | Print("** SymbolInfoString() in BOTH MQL4 and MQL5 **"); 24 | 25 | PrintFormat("SYMBOL_CURRENCY_BASE: %s", SymbolInfoString(_Symbol, SYMBOL_CURRENCY_BASE)); 26 | PrintFormat("SYMBOL_CURRENCY_PROFIT: %s", SymbolInfoString(_Symbol, SYMBOL_CURRENCY_PROFIT)); 27 | PrintFormat("SYMBOL_CURRENCY_MARGIN: %s", SymbolInfoString(_Symbol, SYMBOL_CURRENCY_MARGIN)); 28 | PrintFormat("SYMBOL_DESCRIPTION: %s", SymbolInfoString(_Symbol, SYMBOL_DESCRIPTION)); 29 | PrintFormat("SYMBOL_PATH: %s", SymbolInfoString(_Symbol, SYMBOL_PATH)); 30 | 31 | Print("** SymbolInfoString() only in MQL5 **"); 32 | 33 | PrintFormat("SYMBOL_BASIS: %s", SymbolInfoString(_Symbol, SYMBOL_BASIS)); 34 | PrintFormat("SYMBOL_BANK: %s", SymbolInfoString(_Symbol, SYMBOL_BANK)); 35 | PrintFormat("SYMBOL_FORMULA: %s", SymbolInfoString(_Symbol, SYMBOL_FORMULA)); 36 | PrintFormat("SYMBOL_ISIN: %s", SymbolInfoString(_Symbol, SYMBOL_ISIN)); 37 | PrintFormat("SYMBOL_PAGE: %s", SymbolInfoString(_Symbol, SYMBOL_PAGE)); 38 | 39 | /* SymbolInfoDouble() */ 40 | 41 | Print("** SymbolInfoDouble() in BOTH MQL4 and MQL5 **"); 42 | 43 | PrintFormat("SYMBOL_BID: %G", SymbolInfoDouble(_Symbol, SYMBOL_BID)); 44 | PrintFormat("SYMBOL_ASK: %G", SymbolInfoDouble(_Symbol, SYMBOL_ASK)); 45 | PrintFormat("SYMBOL_POINT: %G", SymbolInfoDouble(_Symbol, SYMBOL_POINT)); 46 | PrintFormat("SYMBOL_TRADE_TICK_VALUE: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE)); 47 | PrintFormat("SYMBOL_TRADE_TICK_SIZE: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE)); 48 | PrintFormat("SYMBOL_TRADE_CONTRACT_SIZE: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_CONTRACT_SIZE)); 49 | PrintFormat("SYMBOL_VOLUME_MIN: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN)); 50 | PrintFormat("SYMBOL_VOLUME_MAX: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX)); 51 | PrintFormat("SYMBOL_VOLUME_STEP: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP)); 52 | PrintFormat("SYMBOL_SWAP_LONG: %G", SymbolInfoDouble(_Symbol, SYMBOL_SWAP_LONG)); 53 | PrintFormat("SYMBOL_SWAP_SHORT: %G", SymbolInfoDouble(_Symbol, SYMBOL_SWAP_SHORT)); 54 | PrintFormat("SYMBOL_MARGIN_INITIAL: %G", SymbolInfoDouble(_Symbol, SYMBOL_MARGIN_INITIAL)); 55 | PrintFormat("SYMBOL_MARGIN_MAINTENANCE: %G", SymbolInfoDouble(_Symbol, SYMBOL_MARGIN_MAINTENANCE)); 56 | 57 | Print("** SymbolInfoDouble() only in MQL5 **"); 58 | 59 | PrintFormat("SYMBOL_BIDHIGH: %G", SymbolInfoDouble(_Symbol, SYMBOL_BIDHIGH)); 60 | PrintFormat("SYMBOL_BIDLOW: %G", SymbolInfoDouble(_Symbol, SYMBOL_BIDLOW)); 61 | PrintFormat("SYMBOL_ASKHIGH: %G", SymbolInfoDouble(_Symbol, SYMBOL_ASKHIGH)); 62 | PrintFormat("SYMBOL_ASKLOW: %G", SymbolInfoDouble(_Symbol, SYMBOL_ASKLOW)); 63 | PrintFormat("SYMBOL_LAST: %G", SymbolInfoDouble(_Symbol, SYMBOL_LAST)); 64 | PrintFormat("SYMBOL_LASTHIGH: %G", SymbolInfoDouble(_Symbol, SYMBOL_LASTHIGH)); 65 | PrintFormat("SYMBOL_LASTLOW: %G", SymbolInfoDouble(_Symbol, SYMBOL_LASTLOW)); 66 | PrintFormat("SYMBOL_VOLUME_REAL: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_REAL)); 67 | PrintFormat("SYMBOL_VOLUMEHIGH_REAL: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUMEHIGH_REAL)); 68 | PrintFormat("SYMBOL_VOLUMELOW_REAL: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUMELOW_REAL)); 69 | PrintFormat("SYMBOL_OPTION_STRIKE: %G", SymbolInfoDouble(_Symbol, SYMBOL_OPTION_STRIKE)); 70 | PrintFormat("SYMBOL_TRADE_TICK_VALUE_PROFIT: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE_PROFIT)); 71 | PrintFormat("SYMBOL_TRADE_TICK_VALUE_LOSS: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE_LOSS)); 72 | PrintFormat("SYMBOL_TRADE_ACCRUED_INTEREST: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_ACCRUED_INTEREST)); 73 | PrintFormat("SYMBOL_TRADE_FACE_VALUE: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_FACE_VALUE)); 74 | PrintFormat("SYMBOL_TRADE_LIQUIDITY_RATE: %G", SymbolInfoDouble(_Symbol, SYMBOL_TRADE_LIQUIDITY_RATE)); 75 | PrintFormat("SYMBOL_VOLUME_LIMIT: %G", SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_LIMIT)); 76 | PrintFormat("SYMBOL_SESSION_VOLUME: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_VOLUME)); 77 | PrintFormat("SYMBOL_SESSION_TURNOVER: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_TURNOVER)); 78 | PrintFormat("SYMBOL_SESSION_INTEREST: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_INTEREST)); 79 | PrintFormat("SYMBOL_SESSION_BUY_ORDERS_VOLUME: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_BUY_ORDERS_VOLUME)); 80 | PrintFormat("SYMBOL_SESSION_SELL_ORDERS_VOLUME: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_SELL_ORDERS_VOLUME)); 81 | PrintFormat("SYMBOL_SESSION_OPEN: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_OPEN)); 82 | PrintFormat("SYMBOL_SESSION_CLOSE: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_CLOSE)); 83 | PrintFormat("SYMBOL_SESSION_AW: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_AW)); 84 | PrintFormat("SYMBOL_SESSION_PRICE_SETTLEMENT: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_PRICE_SETTLEMENT)); 85 | PrintFormat("SYMBOL_SESSION_PRICE_LIMIT_MIN: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_PRICE_LIMIT_MIN)); 86 | PrintFormat("SYMBOL_SESSION_PRICE_LIMIT_MAX: %G", SymbolInfoDouble(_Symbol, SYMBOL_SESSION_PRICE_LIMIT_MAX)); 87 | PrintFormat("SYMBOL_MARGIN_HEDGED: %G", SymbolInfoDouble(_Symbol, SYMBOL_MARGIN_HEDGED)); 88 | 89 | 90 | /* SymbolInfoInteger() */ 91 | 92 | Print("** SymbolInfoInteger() in BOTH MQL4 and MQL5 **"); 93 | 94 | PrintFormat("SYMBOL_SELECT: %i", SymbolInfoInteger(_Symbol, SYMBOL_SELECT)); 95 | PrintFormat("SYMBOL_VISIBLE: %i", SymbolInfoInteger(_Symbol, SYMBOL_VISIBLE)); 96 | PrintFormat("SYMBOL_TIME: %i", SymbolInfoInteger(_Symbol, SYMBOL_TIME)); 97 | PrintFormat("SYMBOL_DIGITS: %i", SymbolInfoInteger(_Symbol, SYMBOL_DIGITS)); 98 | PrintFormat("SYMBOL_SPREAD_FLOAT: %i", SymbolInfoInteger(_Symbol, SYMBOL_SPREAD_FLOAT)); 99 | PrintFormat("SYMBOL_SPREAD: %i", SymbolInfoInteger(_Symbol, SYMBOL_SPREAD)); 100 | PrintFormat("SYMBOL_TRADE_CALC_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_CALC_MODE)); 101 | PrintFormat("SYMBOL_TRADE_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_MODE)); 102 | PrintFormat("SYMBOL_START_TIME: %i", SymbolInfoInteger(_Symbol, SYMBOL_START_TIME)); 103 | PrintFormat("SYMBOL_EXPIRATION_TIME: %i", SymbolInfoInteger(_Symbol, SYMBOL_EXPIRATION_TIME)); 104 | PrintFormat("SYMBOL_TRADE_STOPS_LEVEL: %i", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL)); 105 | PrintFormat("SYMBOL_TRADE_FREEZE_LEVEL: %i", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL)); 106 | PrintFormat("SYMBOL_TRADE_EXEMODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_EXEMODE)); 107 | PrintFormat("SYMBOL_SWAP_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_SWAP_MODE)); 108 | PrintFormat("SYMBOL_SWAP_ROLLOVER3DAYS: %i", SymbolInfoInteger(_Symbol, SYMBOL_SWAP_ROLLOVER3DAYS)); 109 | 110 | Print("** SymbolInfoInteger() only in MQL5 **"); 111 | 112 | PrintFormat("SYMBOL_CUSTOM: %i", SymbolInfoInteger(_Symbol, SYMBOL_CUSTOM)); 113 | PrintFormat("SYMBOL_BACKGROUND_COLOR: %i", SymbolInfoInteger(_Symbol, SYMBOL_BACKGROUND_COLOR)); 114 | PrintFormat("SYMBOL_CHART_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_CHART_MODE)); 115 | PrintFormat("SYMBOL_EXIST: %i", SymbolInfoInteger(_Symbol, SYMBOL_EXIST)); 116 | PrintFormat("SYMBOL_SESSION_DEALS: %i", SymbolInfoInteger(_Symbol, SYMBOL_SESSION_DEALS)); 117 | PrintFormat("SYMBOL_SESSION_BUY_ORDERS: %i", SymbolInfoInteger(_Symbol, SYMBOL_SESSION_BUY_ORDERS)); 118 | PrintFormat("SYMBOL_SESSION_SELL_ORDERS: %i", SymbolInfoInteger(_Symbol, SYMBOL_SESSION_SELL_ORDERS)); 119 | PrintFormat("SYMBOL_VOLUME: %i", SymbolInfoInteger(_Symbol, SYMBOL_VOLUME)); 120 | PrintFormat("SYMBOL_VOLUMEHIGH: %i", SymbolInfoInteger(_Symbol, SYMBOL_VOLUMEHIGH)); 121 | PrintFormat("SYMBOL_VOLUMELOW: %i", SymbolInfoInteger(_Symbol, SYMBOL_VOLUMELOW)); 122 | PrintFormat("SYMBOL_TICKS_BOOKDEPTH: %i", SymbolInfoInteger(_Symbol, SYMBOL_TICKS_BOOKDEPTH)); 123 | PrintFormat("SYMBOL_MARGIN_HEDGED_USE_LEG: %i", SymbolInfoInteger(_Symbol, SYMBOL_MARGIN_HEDGED_USE_LEG)); 124 | PrintFormat("SYMBOL_EXPIRATION_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_EXPIRATION_MODE)); 125 | PrintFormat("SYMBOL_FILLING_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_FILLING_MODE)); 126 | PrintFormat("SYMBOL_ORDER_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_ORDER_MODE)); 127 | PrintFormat("SYMBOL_ORDER_GTC_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_ORDER_GTC_MODE)); 128 | PrintFormat("SYMBOL_OPTION_MODE: %i", SymbolInfoInteger(_Symbol, SYMBOL_OPTION_MODE)); 129 | PrintFormat("SYMBOL_OPTION_RIGHT: %i", SymbolInfoInteger(_Symbol, SYMBOL_OPTION_RIGHT)); 130 | 131 | 132 | 133 | 134 | 135 | 136 | //--- 137 | return(INIT_SUCCEEDED); 138 | } 139 | //+------------------------------------------------------------------+ 140 | //| Expert deinitialization function | 141 | //+------------------------------------------------------------------+ 142 | void OnDeinit(const int reason) 143 | { 144 | //--- 145 | 146 | } 147 | //+------------------------------------------------------------------+ 148 | //| Expert tick function | 149 | //+------------------------------------------------------------------+ 150 | void OnTick() 151 | { 152 | //--- 153 | 154 | } 155 | //+------------------------------------------------------------------+ 156 | -------------------------------------------------------------------------------- /3-accessing-symbol-information-in-mql5/README.md: -------------------------------------------------------------------------------- 1 | ## Migrating from MQL4 to MQL5: Guidance for Algorithmic Traders 2 | ### Tutorial 3 - Accessing Symbol Information in MQL5 vs MQL4 3 | 4 | This tutorial describes how to access Symbol data in MQL5. 5 | 6 | #### Specifically, we discuss: 7 | 8 | 1) The differences between MQL4 and MQL5 in the context of the: 9 | 10 | - SymbolInfoDouble 11 | - SymbolInfoString and, 12 | - SymbolInfoInteger functions. 13 | 14 | 2) MQL4's MarketInfo function 15 | 16 | 3) The additional property identifiers that MQL5 brings to the table in the SymbolInfo___ functions 17 | 18 | 4) Why and how the above render the MarketInfo function unnecessary (hence it being deprecated) in MQL5 19 | 20 | 5) How having the extra detail in MQL5 can benefit trading strategy developers currently using MQL4. 21 | 22 | Video Tutorial: 23 | -- 24 | 25 | 26 | Source Code Examples: 27 | -- 28 | https://github.com/darwinex/mql4-to-mql5-tutorials/tree/master/3-accessing-symbol-information-in-mql5 29 | 30 | All content is specifically geared towards algorithmic traders currently using MQL4, with the aim of making a case for transition from MQL4 to MQL5, and providing the knowledge needed to ensure it is a smooth, educated endeavour. 31 | 32 | --- 33 | 34 | # Are you an algorithmic trader? 35 | 36 | We'd love to have your strategy listed on our Exchange, enabling you to earn performance fees on investor profits! 37 | 38 | More details here: 39 | https://www.darwinex.com/?utm_source=github&utm_medium=video-3-readme&utm_content=mql4-mql5-accessing-symbol-information 40 | 41 | 2.0M in performance fees paid to date: 42 | https://www.darwinex.com/darwinia/hall-of-fame/users?utm_source=github&utm_medium=video-3-readme&utm_content=mql4-mql5-accessing-symbol-information 43 | 44 | Topics: #algorithmictrading #mql4 #mql5 #metatrader4 #metatrader5 #metatrader #darwinex 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Need help? Join the [Darwinex Collective Slack](https://join.slack.com/t/darwinex-collective/shared_invite/enQtNjg4MjA0ODUzODkyLWFiZWZlMDZjNGVmOGE2ZDBiZGI4ZWUxNjM5YTU0MjZkMTQ2NGZjNGIyN2QxZDY4NjUyZmVlNmU3N2E2NGE1Mjk) for Q&A, debug and more. 2 | -------------------------------------------------------------------------------- /resources/images/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/images/video-play-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darwinex/mql4-to-mql5-tutorials/a116489b664cd0bd8d18e31540017f8f563e38c0/resources/images/video-play-button.png --------------------------------------------------------------------------------