How to setup MT4 Expert Advisor Simulation?
Written by Sng Chong How
There are a few factors that you have to consider when setting up the Expert Advisor (EA) to run on your MT4 simulator. With proper setup and configuration, the simulated result will yield positive result when run the EA on live account.
Below are some configurations for your consideration.
1) The choice of simulation chart period. The commonly used charting period is 1 minute chart (M1), 5 minutes chart (M5), 15 minutes chart (M15), 1 hour chart (H1), 4 hour chart (H4) and 1 day chart (D1). From my experiences, simulating with M1 period result will produce accurate results from your EA. Any chart time frame greater then 1M, will result in frame stepping by the simulator. The simulator will step thru the time frame and aggregate the closet to your number, which can cause false breakout and unrealistic result.
2) Use fully downloaded M1 result from a data server. Many broker nowadays support client to backwards download data from now to 2002 (at least last 10 years of data). Once full M1 data downloaded, you can use period converter to convert to M5, M15, H1, H4 and D1 database. This will complete the database that is used by simulator when called to run back testing for your EA.
3) Most EA are ready to be used for live and demo trading. However, if you are modifying a EA that is meant for live trading, you need to include below 3lines of code to let it run in back testing mode by the simulator.
line1: static datetime nextRund
line2: if( nextRund > TimeCurrent() ) return(0);
line3: nextRund = TimeCurrent() + 30;
The above codes with delay your program by 30 seconds before it proceed to executed the next program. You cannot use while loop or jump program as it is non static and will stop the moment the program executed the last line of code. The above actually set a static variable and this variable is match with the time in the PC. As this variable is static, it will stay in memory when your program exist and execute again. The 30 is default in terms of seconds. This may be difficult at first, but after some trial and error, you will get use to it and use different time seconds to your advantage.
4) Delay is non static but it can be use to temporarily stop the program while running other function. This is extremely using if you are running multiple EA and executing on a single data server. By setting different delays, your program will execute at different time thus not congesting the order send to your server. This act as multitasking your order and does average your CPU utilisation over time.
The above are some factor to consider. Thank your
Source http://www.bestforexranking.com
Article author
About the Author
I support green products and actively involved in recycling movement. Currently am blogging, affiliate marketing, selling holiday gifts online and trading Forex to earn extra income to support family on top of having a full-time job.
I am currently hosting a Forex review website at http://www.bestforexranking.com and also sharing Forex news, broker, trades and charting information. Last year, I started affiliate marketing and setup http://www.sngerge.com which features free tools and tips. My recent involvement is selling holiday gifts which provide world wide delivery at my personal blog http://LeYangShop.blogspot.com
Further reading
Further Reading
Article
How Should We Celebrate the Anniversary
How Should We Celebrate the Anniversary of the Birth of Prophet Muhammad (PBUH)? For Muslims, Prophet Muhammad (PBUH) is the best creature ever. He is the last messenger and prophet sent by the Almighty Allah to guide people from the darkness of ignorance to light of Divine guidance. At any human scale, he (PBUH) is a man of extraordinary achievements. This is a fact admitted not only by Muslims, but by non-Muslim thinkers and philosophers also. Having put Prophet Muhammad (P
August 25, 2023
Article
This is Jesus, Son of Mary, the Word of Truth
This is Jesus, Son of Mary, the Word of Truth rn Festivals and celebrations are considered one of the distinctive characteristics and key features of societies around the world as they constitute a major part of cultural fabric for people. This means that there is hardly any human society without festivals, whether they are related to religious occasions or non-religious ones. While there are some Islamic festivals like, Eid al-Fiá¹r and Eid al-Adha, there are also various c
August 14, 2023
Article
BRISE Token: How to buy Bitgert's Crypto Token
Why do traders buy native tokens of exchanges? Native tokens, often referred to as exchange tokens, are digital tokens that cryptocurrency exchanges issue to offer their users a variety of advantages. These tokens can be exchanged for access to premium services, a reduction in trading fees, and payment for transaction costs. But what actually makes these tokens unique is their potential for value growth, which attracts investors as an appealing investment opportunity. Investo
May 19, 2023
Article
Customet satisfaction
Customer satisfaction Despite all the effort and money poured into CX tools by companies, customer satisfaction continues to decline. In the United States, it is now at its lowest level in nearly two decades, per data from the American Customer Satisfaction Index (ACSI). Consumer sentiment is also at its lowest in more than two decades. This negative dynamic in the customer-centric ecosystem in which we now live creates the challenge of figuring out what is going wrong and wh
March 18, 2023