Automated system vs Backtest

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #206550 quote
    Rufus
    Participant
    Junior

    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 quote
    GraHal
    Participant
    Master

    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

    Rufus thanked this post
    #206554 quote
    Rufus
    Participant
    Junior

    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.

    GraHal thanked this post
    #206555 quote
    Rufus
    Participant
    Junior

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

    #206558 quote
    GraHal
    Participant
    Master

    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 quote
    Rufus
    Participant
    Junior

    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 quote
    PeterSt
    Participant
    Master

    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.

    Rufus thanked this post
    #206567 quote
    GraHal
    Participant
    Master

    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?

    Rufus thanked this post
    #206573 quote
    Rufus
    Participant
    Junior

    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.

    GraHal thanked this post
    #206576 quote
    PeterSt
    Participant
    Master

    @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 !

    GraHal thanked this post
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Automated system vs Backtest


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Rufus @rufus-round Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by PeterSt
3 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/30/2022
Status: Active
Attachments: No files
Logo Logo
Loading...