Which platforms can I use expert advisors (EAs) on?
You can use an EA on MT4, MT5 & cTrader. The MT4 coding language is called MQL4, and is based on C++, whereas the coding language for MT5 is MQL5 which is a more specialised version of C++ built specifically for trading.
Generally, MQL4 is considered easier for beginner coders and those new to trading. cTrader uses the C# coding language.
In terms of cross compatibility, neither MT4 or MT5 EAs can be used on cTrader, and vice versa. MT5 EAs can be used on MT4, however MT4 EAs cannot be used on MT5. A translation from the MQL4 to the MQL5 language is required for MT4 EAs to work on MT5.
Will my EA perform in the same way in a live and demo environment?
EAs are programmed to open, close or modify trades based on numerous criteria and parameters. These can range from price action, to changes in account metrics like drawdown and equity, and can be more complex to include indicator thresholds, trend analysis and other statistical points of interest. This means that, given all of the same criteria and parameters are applied to the EA on the demo and live environment, and with the accounts containing the exact same characteristics, there should not be any significant differences in performance. But there are some caveats.
The exception is where conditions of liquidity and order execution dynamics differ between demo and live environments. In the demo environment, you essentially have unlimited liquidity. There is no order book, the top of book price is the price that prevails for all order sizes. Be it 0.1, 1, 10 or even 100 lots of any instrument traded, the price that is available at the time your order is sent will apply to the execution price. This means you can’t incur VWAP (value weighted average price) slippage on your orders, which is not the case in a live environment.
In a live environment there is only so much liquidity at each level of the order book, and so your orders will always be matched off against prices dependent on the size of your order. In this way, the exact same order for 10 lots on a demo account may show a significantly different outcome to one in the live environment if there is not enough liquidity at the top of book price to completely fill your order. Your entry and exit prices may be worse off than in the simulated demo environment where you have been filled at only the best price available. This will directly reduce the profit, or increase the loss, on the live account trade relative to the demo account trade.
Where the conditions also differ is in execution dynamics. Orders in a live environment are sent to a server to be matched against the relevant liquidity provider’s quote, and each order is processed in time order. While our average execution speed is around 30ms*, which can be considered to be fast, prices can still change between when your order is sent from your platform (or from the server in the case of pending orders) and when it is received and executed at the server. This means that, in a live environment, your orders can also receive execution slippage as a result of latency. This is just a simple fact of trading in a constantly evolving online marketplace.
In the demo environment, however, orders are executed immediately and so there is no race to be filled at the bridge. An EA’s orders in a demo environment will therefore not be subject to execution or latency related slippage.
The final point to note is that there may be ever so slight differences in the way pricing is received to the demo and live platforms, such as the frequency and receipt time of ticks. Remember, the demo environment is just a limited, simulated trading environment, so its infrastructure is not as complex as the live environment.
*Order processing time once received in our bridge is approximately ~30 milliseconds for Pepperstone Markets Limited.Pepperstone doesn’t represent that the material provided here is accurate, current or complete, and therefore shouldn’t be relied upon as such. The information provided here, whether from a third party or not, isn’t to be considered as a recommendation; or an offer to buy or sell; or the solicitation of an offer to buy or sell any security, financial product or instrument; or to participate in any particular trading strategy. We advise any readers of this content to seek their own advice. Without the approval of Pepperstone, reproduction or redistribution of this information isn’t permitted.