Automated system vs Backtest

Forums ProRealTime English forum ProOrder support Automated system vs Backtest

Viewing 10 posts - 1 through 10 (of 10 total)
  • #206550

    Dear All,

    I have just started for the first time ever an auto trading strategy.  It’s been running for about a week and the results are largely in line with expectations I have from backtesting using PRC.

    However, today the System (live, automated) did not generate the same trades as the backtest.  The code is identical – I run a backtest with the code from the System.  I cannot understand why the two would differ, so I wonder what I have missed and if anyone else has encountered such a conundrum.  Aggravatingly the System did not profit today whereas the backtest says today was quite good.  This is not an execution or timing problem – the System was not short when the Backtest was.

    Many thanks for reading and for any guidance you may have.

    Happy New Year,

    Rufus

    #206552

    Don’t get disheartened, it happens to all of us, it could be one of a whole host of reasons …

    https://www.prorealcode.com/topic/real-trading-does-not-match-the-backtest/#post-175189

    1 user thanked author for this post.
    #206554

    Thanks GraHal,  Not disheartened, more frustrated… great link for me to explore, thank you.

    My suspicions are this reason:

    • Starting a strategy at a different time (1 hour or even 1 minute later): depending on the code of the strategy, the results of some calculations could be different.

    The IG server thing is a worry, but the system was short and then closed by a PRC instruction which the backtest does not show… so it points to the above.  I will check.

    1 user thanked author for this post.
    #206555

    If I select the same start date and time for the backtest, it results in no trades since then whatsoever… confused

    #206558

    same start date and time for the backtest

    Same as what? Same date and time as the System started in Live ProOrder?
    And did the exact same System in Live ProOrder take any trades?

     

    #206560

    Yes, correct – same start date as the live system and the live system did make trades yet the backtest with now identical start time made none.

    #206565

    Hi Rufus,

    You can not let start the backtest at the exact same time as the first trade you saw occurring in Live (or Demo-Live). Instead you must start the backtest so much in advance as the system requires to grab the same trade.

    Now that was confusing … 🙂

    Your system will work with averages and you need to give it the time to “develop”. Is that 100 bars ? then start the system 100 bars (e.g. minutes – that depends on your TimeFrame) earlier than the first trade occurring in Live. In general it requires a bit of wiggling to get it done, but once you got the hang of that, it will be easy a next time.
    Once that first trade is synchronised, the remaining trades should too. If they don’t, then it’s your turn to sort out the why of it.

    1 user thanked author for this post.
    #206567

    Peter you may have your wires crossed 😉 (or I may have?) …  I assumed that Rufus had changed the start date &time of backtest to read same as the date&time shown on the version running Live on Proorder?

    now identical start time made none

    What value spread did you input to the backtest engine and what Instrument are you testing on?

    1 user thanked author for this post.
    #206573

    I think you may have nailed the issue with spread.  Spread size has made a difference to how short the backtest was at the time in question, although it was short nonetheless whereas the live system closed the short.  So it looks like the spread may have widened at that point in real life.  This would be consistent with the lower liquidity present at this time of year and explains why this hasn’t happened before.  Thanks v much.

    1 user thanked author for this post.
    #206576

    @GraHal, always having my wires crossed … and in that case I read too fast (I somehow read that it was about the start of the trade in Live; and mind you on the longer term this is never about having the backtest starting at the same time of the Live system because it is always about individual trades which may not be in sync. Thus for example, if the first trade would have been OK and the next one not (synced), then what ?)

    I better use those wires to fire some fireworks tonight !

     

    1 user thanked author for this post.
Viewing 10 posts - 1 through 10 (of 10 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login