问题
Say I have an EA that executes based on tick-level ( Bid, Ask ) information, is there a way to backtest it with tick-level information in MetaTrader Terminal's Strategy Tester?
There are two problems:
a. it seems MetaTrader only supports 1 min charts and tick-level data are re-simulated (not accurate)
b. where could I get the tick-level data?
If the answer is no for MetaTrader, is there other way I could backtest it (free better, but paid solutions are alright) with tick-level information?
回答1:
b) Tick-data - from Ducascopy and LMAX
a) injecting of tick-data into MT4 - tick-data suite (paid version), but maybe you will manage to write your own solution
回答2:
Answer on b) determines the whole sense of doing any BackTest:
Why? Because the market access provider ( the Broker ) ecosystem, incl. their respective Liquidity Provider(s)' capacities, reflect the very environment, in which a backtested trading model ought survive in live-trading.
Thus trying to backtest a trading model on tick-data from Broker-X does not make sense if planning to trade real equity live at Broker-Y. Failure to respect this could be a last mistake.
A professional Broker can provide tick-data from web-site, or upon request.
A professional Trader routinely collects tick-data for a fair validation of any model backtesting. This answers the a) indirectly, as one can compare synthetic ticks against recorded flow of real ticks this way and integrate this into Expert Advisor code.
回答3:
Using MT4 your choices are tickstory or tick data suite. Both download tick data and create new history data files.
Alternatively you develop cross-compatible EAs to run on MT5. MT5 has in built real tick data support.
As others have said, it is best to have tick data from the broker and on the same platform you want to run on, but this is difficult using the MT4 platform.
回答4:
Import Tick Data into mt4
It is true that mt4 natively only supports 1 minute data import, simulates ticks, and stores these ticks in fxt file. Tick Data Suite v2 and TickStory are off-the-shelf solutions. They essentially inject themselves into mt4 so that you can run custom fxt
files, so you store your own tick data and convert it yourself and "import" it via the fxt file.
TDS v1 was comprehensive for its time, but it was tedious because you had to re-run the CSV2FXT script every time you wanted to use updated data. I had several separate terminals to have FXT files in 2 year increments so that I did not have to do the entire database over (just the last year), but it was a chore. v2 streamlined the entire process (compressed tick database + on-the-fly decompression + injection of ticks into fxt + automated update options for tick database + your own); you are lucky now you just check mark 'use tick data' and wait about 40 seconds the first time you use an non-updated symbol and your test begins. There are some additional features like
Same with TickStory, which was free so it was even more tricky to get a consistent setup (to scale across multiple symbols).
Where to get tick data:
Normally you would use DukasCopy** Darwinex to give you a pretty good idea of how it would perform on tick level data. It's free, accurate, large symbol range, and updated with appx 4-6 hour delay from real time. More recently TrueFX has begun releasing their own tick data database, updated monthly.
No one mentioned the tick collector EA (by GeekTrader) which will collect and store ticks in csv format. Mt4 usually will 1/2 the number of ticks it collects if there are 2 or more symbols in the market watch. So for highest accuracy, limit collection to one symbol per terminal (make sure market watch only shows one terminal). Sounds like a lot of work. Much easier if the broker does it on their end, and then allows you to download it later at your convenience.
MT5
has native tick collection on a per-broker basis (broker controls how much history to allow, but the trade-off is that you cannot import your own data into mt5 (you may be able to export mt5 >> mt4 :) and mt5
is not yet as popular.
Side comment: I believe mt5 may eventually become more popular in 2 ways:
1) MQ allows ex4 or mql4
to run emulated within mt5
with 100% compatibility.
2) People very slowly migrate their mql4
code to mql5
** Dukascopy has recently increased their spreads compared to TrueFx or Darwinex. That doesn't mean you cannot use them to test.
What this means is that you should test across 2-3 different "true" DMA pricing providers to see if there is a significant change in entry/exit points. and if the difference has a rational explanation in relation to your strategy.
来源:https://stackoverflow.com/questions/44095934/how-to-do-a-backtesting-with-tick-level-data-in-metatrader-terminal