difference limit order backtest and live

Forums ProRealTime English forum ProOrder support difference limit order backtest and live

  • This topic has 19 replies, 4 voices, and was last updated 6 years ago by avatarPaul.
Viewing 15 posts - 1 through 15 (of 20 total)
  • #80039

    Hi,

     

    It’s about the dax 30 cash €1,- at a 1 minute timeframe and the Big Line Strategy Code.

    To this code I’ve made small modifications compared to the one published in the library.

     

    The code of the Big Line Strategy, it works using a market order.

    But if you use a limit order then it works correctly in a live trading environment, but not in a back test.

     

    Tick mode on or off don’t show a difference.

     

    So why does the back test with a limit order not work correctly?

     

    More specific, i.e. why does the back test skip a trade at 5 September 2018 at 11.24, but the same code in a live trading environment gets correctly activated?

     

    Maybe I missed something and hope for some feedback.

     

     

    #80040

    What fixed spread did you have set on backtest?

    Maybe try 0.6 spread and run bt again (see if it makes any difference as that is what DAX usually is at 11:24 AM)?

     

    #80044

    Makes no difference, but I have got a trade opening on 5 Sep 18 10:24 (you are 1 hour ahead of me) but at 30 sec TF.

    This may be a red herring, but thought I’d post it anyway as I have spent time on it.

    #80047

    Makes no difference, but I have got a trade opening on 5 Sep 18 10:24 (you’re timezone is 1 hour ahead of me / UK) but at 30 sec TF.

    This may be a red herring, but thought I’d post it anyway as I have spent time on it.

    #80049

    Also I have got a trade opening on 5 Sep 18 10:24 (you are 1 hour ahead of me) but at 5 min TF.

    #80050

    Are you comparing live account backtest with demo account one? Or real live trading?

    #80052

    Mmm good point Nicolas!

    My tests were on Demo Backtest.

    #80061

    I asked Paul this question because of the 2 different version of the backtest engine that exist in demo and live account with IG.

    #80115

    Thanks for the help guys.

     


    @Nicolas

    I ‘am running version v10.3 – 1.8.0_45 on a Mac (last update 30 july  2018)

    That’s the version which does the backtest and the live trading.

    The code has 1 point spread and tickmode is activated.

     

    @GraHal

    For 30 sec TF, I got the same as you, it entered a trade.

    Also on 5 minutes it entered a trade at 11.25 my time  on 5 sept.

    But how’ is the 1 minute  10.24 your time zone?

     

    Of this code interesting timeframes are 1, 3 and 30 minutes with 200k backtest. I attached the screenshot. The 30min is a bit zoomed in.

     

    Also attached a screenshot of the 1 minute bar which is has my focus in this case.

    I need to understand why the trade got skipped in backtest and get’s activated correctly live. It renders the back-test useless otherwise.

    #80120

    ok so the order is not triggered only in the 1 minute TF, right?

    #80137

    Correct

    The order in a back test does not get triggered only on the 1-minute TF when it’s a limit order. (5 September 2018 11:24:00)

     

    details;

    Close crosses the big line at 11.23 and meets all criteria

    The limit order refers to high[1] which at 11.22 is 12.100,2.

    The low at 11.24 is 12.100,2

    A limit high[1] means buy at 12.100,2 or lower at the 11.24 bar, which traded 12.100.2

    #80140

    The spread on the DAX (DFB) is normally 1.0 at the time of the trade so this is the most likely reason that the trade did not open. The prices shown on the chart are mid prices (i.e halfway between the buy and sell prices). The mid price would need to have reached 12099.7 for a buy trade to have opened at 12100.2

    #80141

    What about a backtest without spread?

    #80151

    What about a backtest without spread?

    Sorry – too early and not enough coffee yet. I just re-read the posts and now see that the problem is ‘the trade got skipped in backtest and get’s activated correctly live’ and that the OP tested with a 1.0 pip spread. A back test without spread should open the trade and so would be a nice test to try.

    #80166

    Correct … at 0 / zero spread, I get a trade opening on Demo Backtest at 1 min at 10:24 (I am UK so 1 hour behind the OP).

    2 users thanked author for this post.
Viewing 15 posts - 1 through 15 (of 20 total)

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