Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Backtesting vs reality

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Backtesting vs reality

    Hi Ninja team,

    When I do backtesting and apply the same strategy in real time chart I find a big difference (~28%) that I think inhent to backtesting engine
    after deep analysis I think it's due to the fact in back testing when stop loss is hit, the value logged in the trade is the next bar input, in remk bars, it the next bar is green, the loss is half

    My strategy
    i sbased on renko bars

    Here is an example of the issue

    Click image for larger version

Name:	image.png
Views:	145
Size:	31.9 KB
ID:	1285893

    As you can see when the SL is hit and only if the next bar is green the stop loss level exit is wrong (lose one block) and different from real time (lose tow blocks)
    Here is an example of a curve when adjusted by correcting manually this backtesting error

    Click image for larger version

Name:	image.png
Views:	124
Size:	42.4 KB
ID:	1285894


    1- How can I trick the script or the platform to take in accounnt this eeror and have a more realistic results ?

    2- Another topic , is it possible to change the text in the entry/exit lablels

    Click image for larger version

Name:	image.png
Views:	122
Size:	4.8 KB
ID:	1285895

    Thanks for your support

    #2
    Hello bourasrafik,

    Thanks for your post.

    Standard Renko bars can be challenging for backtesting as the barstypes use functionality to remove the last bar in the data series and replace the bar with a new Open price. This is done with reversals and cannot be simulated historically, because the bars are already built. Testing may be done with the Playback Connection to fully simulate standard Renko bars with accurate reversals and order fills.

    Please review the help guide document on the differences on real-time vs backtest (historical).


    You could consider using Exit methods for your stops/targets such as ExitLongLimit() and ExitLongStopLimit() instead of using Set methods.

    This would allow you to specify a signal name for the Exit methods which would display on the chart. For example, you could give the Exit method a signal name of "Long Stop" and "Long Stop" would display on the chart instead of "Stop loss".

    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Brandon,
      The issue with playback is I'm only able to download day by day, I want to do massive testing tests with 1 or 2 years tick data, is there a way to download massively data (without files as it's not permitted by my data provider) as I do with backtest ?
      Thanks​

      Comment


        #4
        Hello bourasrafik,

        MarketReplay data are large files and must be downloaded one day at a time.
        You might consider using a 3rd party to obtain the MarketReplay data.


        While less accurate, the Playback connection can also playback historical tick data.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello bourasrafik,

            MarketReplay data are large files and must be downloaded one day at a time.
            You might consider using a 3rd party to obtain the MarketReplay data.


            While less accurate, the Playback connection can also playback historical tick data.
            https://ninjatrader.com/support/help...data_files.htm
            Hi Chelsea, thanks for the info. All I can find so far are "paid" services to accomplish this task of downloading multiple days of data at one time vs the tedious one day at a time that currently exists inside the platform.
            I'm curious why doesn't NT build this into the platform instead of referring clients to third party "paid" for services?

            Comment


              #7
              Hello sonia0101,

              Thanks for your notes.

              At this time, the Development team has not added the ability to download more than one day of Market Replay data at a time.

              Any features added to NinjaTrader platform are at the discretion of the Development team.

              Brandon H.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_BrandonH View Post
                Hello sonia0101,

                Thanks for your notes.

                At this time, the Development team has not added the ability to download more than one day of Market Replay data at a time.

                Any features added to NinjaTrader platform are at the discretion of the Development team.
                Hi Brandon hmm didn't even attempt to answer my question instead responded with what I already know, that is why I asked the question.
                But thanks anyway.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by fx.practic, 10-15-2013, 12:53 AM
                5 responses
                5,406 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by Shai Samuel, 07-02-2022, 02:46 PM
                4 responses
                98 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by DJ888, Yesterday, 10:57 PM
                0 responses
                8 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by MacDad, 02-25-2024, 11:48 PM
                7 responses
                160 views
                0 likes
                Last Post loganjarosz123  
                Started by Belfortbucks, Yesterday, 09:29 PM
                0 responses
                9 views
                0 likes
                Last Post Belfortbucks  
                Working...
                X