Tick Data Backtesting In Metatrader

Discussion in 'Automated Trading' started by LondonPete, Apr 14, 2012.

  1. My first post so forgive a 'noob' question....

    I've writen a strategy in MQL and I'm testing in Metatrader 4. I'd like to understand why I get diferent results on the M1 and M5 timeframes in the Strategy Tester in Metatrader.

    Before someone states the obvious:

    (i) I have a month of tick date from Dukascopy that's been converted using Birt's scripts to Metatrader format

    (ii) I'm running a trial version of Birt's Tick Data Suite that allows the use of this tick data in Metatrader

    (iiii) my MQL strategy makes no assumptions about the timeframe of the chart it's running on i.e. indicators like EMA specify the timeframe, as does my use of the closng price of the last bar function.

    Running a backtest on M1 and M5 both show the same number of ticks - around 1.6 Million for March '12 - but I get different results.


  2. my understanding of both 'ticks' and volume in MT 4 are that they are price changes
    only - not trades. also whatever trades are going thru, one doesn't know the quantity
    of the order, it could be 1 micro lot or 10 lots, and the total isn't known until the end of
    the price bar - 1 or 5min for eg

    using the 'smallest 'timeframe'' to develop a strategy in MT4 doesn't cut it imo, if you
    want to trade tick or 1 second trades or develop a strategy based on such timeframes
    you'll have to trade futures and use a program such as NinjaTrader

    pdf illustrates 5 charts from AMP's NinjaTrader/CQG feed of the 6E Euro FX contract:
    1 sec, 1 tick, 10 volume, 1 min, 5 min. the white vertical lines are 1 minute apart for
    the first 3 charts, then 5 and 15mins apart. the start time of the charts are about 7am
    PST, a high volume period, and the 5min chart illustrates most of the European and
    US sessions
    chart to chart you'll see how the price range changes as the volume increases and
    that the price movement is relative to the Chart Type being used and trades volume
    going thru at any particular time

    Oanda has the largest fx client base, so in theory, more trades
    the 6E Euro FX futures contract is of course traded on the CME Globex exchange with
    a constant contract size, the volume is accurate and individual trades are recorded
    down to microseconds
    AMP futures allows daytrades at $500 per contract for the 6E, minimum account size
    $500 using the free NinjaTrader with the CQG data feed. the Bid/Ask spread is a min-
    imum of 1 pip/tick, a Market Order may get filled at a greater spread, but sometimes
    at a better price if the price is jumping around. rt commission is $5.64 and the value
    of 1 pip/tick is $12.50 , so the leverage is about 500:1 using $500 margin
    Globex closes for 1 hour at 2pm PST otherwise same hours as the fx brokers
    not sure about strategies but many MT4 indicators have been successfully converted
    to NinjaTrader
    futures brokers including AMP offer fx trading based on the links NinjaTrader has with
    some fx brokers, not sure if Second, Tick, Volume charts can be used with the fx data

    http://www.ninjatrader.com/support/forum/index.php - various indicators/strategies etc
    to get an idea of the Daily volume of the various currencies traded on the Globex see:
    http://www.barchart.com/futures/ - right side of page, Links, click on first icon or, use
    the CME Globex site: http://www.cmegroup.com/globex/introduction/
  3. Thanks for a prompt and comprehensive reply. I'll investigate those links.

    I agree about 'smallest timeframe' testing. My strategy actually uses EMA on timeframes from M5 to D50.

    It turns out I did have a 'noob' issue. My tick data obviously has the real spread within in but the importing script I used does not use this by default. Meaning Meatader was using the broker spread at the time the tests were run....and which vary and get quite large at the weekends. So tests a few hours apart gave very different results.

    I now get the same results on M1, M5 and M15 tests with 99% modelling accuracy. This is what I expected as the strategy has no interest in the chart timeframe. The chart is only there as Metatrader needs a strategy to run against a chart.