Problems between simulation results and actual trading result. Below are some issue that need to be address.
a) Bid-Ask spread.
This spread is normally between 2 to 4 pips for major currency pair USDJPY, EURUSD, USDCHF, GBPUSD, etc but when there are news and major movement, the spread will increase to 5 to 9 pips and 10 - 15 pips and even 16+ pips and more. This means when you buy, you already receive negative 16+ pips on that trade.
Simulation does not cover this spread as the bid-ask is always base on the latest spread in the MT4 server. Thus, news created wide pips spread are not able to capture and the buy-sell trade are not accurately simulated. This change in pips has to be taken into account when simulating by taking 2 measures. Number 1 is to set the spread limited in your EA to below 8 pips to execute a trade. Anything more then 8 will not execute any trade. Number 2 is to set your profit or trigger level -9 pips then your usual profit level when simulating. This will make sure the spread is take into account.
b) Server availability.
This is limited to the market demand, as more trade enter, the server will be overloaded and cause server busy when you want to buy or sell a currency. Then you have to execute the trade again. In case, the spread will change and affect your trade profits. Different server will have various spread and ask at the same time.Server busy will cause your trade to be invalid.
Simulate does not cover the server busy. So you have to code in a server busy reply from server and to wait 1 or 2 seconds before retry executing the trade again using "IsTradeContextBusy()". This will allow your EA to retry again when encounter server busy. You may want to have up to 5 times or 1 minute of retry.
c) Log in.
This is due to the internet connection with the MT4 server. The account is consistently ping to maintain its loggin status. When internet connection is disrupted, the auto log in will continue and at times you will see a couple of login entry in your journal.
Simulate does not over this login portion. So you have to code in to get data from the server via "RefreshRates()", This will allow the EA to try login your account prior to executing any trade.
Lastly, if you take into account the above issue, your simulation results can be a benchmark to your live trading result. Thank you.
Finally, the first comprehensive guide to MQL programming is here! Expert Advisor Programming guides you through the process of developing robust automated forex trading systems for the popular MetaTrader 4 platform. In this book, the author draws on several years of experience coding hundreds of expert advisors for retail traders worldwide. You'll learn how to program these common trading tasks, and much more: - Place market, stop and limit orders. - Accurately calculate stop loss and take profit prices. - Calculate lot size based on risk. - Add flexible trailing stops to your orders. - Count, modify and close multiple orders at once. - Verify trading conditions using indicators and price data. - Create flexible and reusable source code functions. - Add advanced features such as timers, email alerts and Martingale lot sizing. - Avoid common trading errors and easily troubleshoot your programs. - Adjustments for fractional pip brokers and FIFO. - Plus, learn how to create your own custom indicators and scripts! Whether you're a beginner or an experienced programmer, Expert Advisor Programming can help you realize your automated trading ideas in the shortest amount of time. This book features dozens of code examples with detailed explanations, fully-functioning example programs, and reusable functions that you can use in your own expert advisors!
Algorithmic trading and Direct Market Access (DMA) are important tools helping both buy and sell-side traders to achieve best execution.
This book starts from the ground up to provide detailed explanations of both these techniques:
- An introduction to the different types of execution is followed by a review of market microstructure theory. Throughout the book examples from empirical studies bridge the gap between the theory and practice of trading.
- Orders are the fundamental building blocks for any strategy. Market, limit, stop, hidden, iceberg, peg, routed and immediate-or-cancel orders are all described with illustrated examples.
- Trading algorithms are explained and compared using charts to show potential trading patterns. TWAP, VWAP, Percent of Volume, Minimal Impact, Implementation Shortfall, Adaptive Shortfall, Market On Close and Pairs trading algorithms are all covered, together with common variations.
- Transaction costs can have a significant effect on investment returns. An in-depth example shows how these may be broken down into constituents such as market impact, timing risk, spread and opportunity cost and other fees.
- Coverage includes all the major asset classes, from equities to fixed income, foreign exchange and derivatives. Detailed overviews for each of the world's major markets are provided in the appendices.
- Order placement and execution tactics are covered in more detail, as well as potential enhancements (such as short-term forecasts), for those interested in the specifics of implementing these strategies.
- Cutting edge applications such as portfolio and multi-asset trading are also considered, as are handling news and data mining/artificial intelligence.
Algorithmic Trading and DMA: An introduction to direct access trading strategies.
Getting Started in Currency Trading: Winning in Today's Forex Market Click here to see 4 customer reviews and choose from 39 suppliers