3
$\begingroup$

I am coding some simple .mql4 program, you know, the fx market is offline on weekend, and the market will be not shown in Meta trader 4 platform. I wanna test my program in meta trader 4 on weekend. If you know how to test it when the market offline, please let me how to do this?

$\endgroup$

2 Answers 2

1
$\begingroup$

You need to use the strategy tester. It is a built in feature of mt4 and well known and documented.

For more information you can google "mt4 strategy tester" or just check mql4.com (or mql5.com.... they are starting to merge pages from mql4 to mql5).

You can start here:

http://www.investopedia.com/university/forex-software-metatrader-4-advanced-guide/strategy-testing-and-optimization.asp

$\endgroup$
1
$\begingroup$

If you want to test actually trading functions (simulate indicator's visual calculations) in a simulated market environment, then you need to use the built-in 'Tester' function to backtest your strategy or indicator (indicator backtesting is limited to visual mode only).

edit: to maximize the accuracy of the test, consider running the test using the every tick Model. Now mt4 will generate its own simulated ticks based on the OHLC of the bars of the data range. This could take a while. Much more accurate to use actual ticks. Mt4 does not support direct import of sub-minute/tick data, but this can be "injected" using Birt's Tick Data Suite. v2 has pretty much automated the tick collection, and integration into mt4 tester process. Before, you had to manually create the fxt files by hand, copy them to the terminal(s) you wanted to test on. And you had to recreate the fxt files anytime you want to run on more recent data than the existing fxt had.. That could be every day.

If you want to make sure EA can initialize properly, you can use a fake tick sender program like Ticker or MT4Bar. It simulates ticks being sent to mt4 client so the EA can initialize properly and run certain calculations that require onTick().

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.