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

Grafici KAGI (Real-Time / Backtest)

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

    Grafici KAGI (Real-Time / Backtest)

    Hello,
    I kept it in real time on graphics KAGI (15 sec . reversal 2 -ticks ) some of the strategies with futures for about a week . I took notes of each individual trades in real time ( entry- exit- avg price etc. .. ) . Next, I did the test back to make a comparison . There are a few trades that do not match , including real - time and backtesting . Others are shown in real time , but not in the backtest . Some do not correspond with the time . how can I do to solve this problem ?
    thanks
    Roberto

    #2
    Hi Roberto, generall speaking discrepancies between realtime and historical backtest would be expected, the most common reasons were collected here for review - http://www.ninjatrader.com/support/h...ime_vs_bac.htm

    This effect would be expected stronger even on the more exotic bars types like Pnf and Kagi - http://www.ninjatrader.com/support/h.../bar_types.htm

    To backtest those more accurately we normally suggest either running in Market Replay or submitting for example orders to an added 1 tick series in backtesting, so a higher fidelity fill can be worked with.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,
      observing the behavior of the code on Kagi charts I noticed that one of the big problems was the Setstoploss that could give the differences between real-time and backtest. I have eliminated this problem by putting a normal output in Loss to market when you see the new toolbar. However, there are trades that occur for example in real-time and does not occur in the backtest. This I can not understand!
      Hello.
      Roberto.

      Comment


        #4
        Roberto, are you running your scripts with CalculateOnBarClose = false?

        Even with true for the exotic types having a base period to historically build the bar until you hit realtime data, slightly different bars formations would be expected unless the base period would be 1 tick. This is one of the limitations known working with those types, hence Market Replay testing for systems would be more accurate here.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi Bertrand.
          Yes I put "false".
          However, doing the test with "true" does not change the result.
          Thank you.
          Ciao.
          Roberto

          Comment


            #6
            That could very well be the case Roberto, CalculateOnBarClose settings are one factor contributing generally to discrepancies you would see comparing realtime to backtest runs. For your specific exotic bars type issue, I would expect it for any setup that is not run on the base period of 1 tick as you otherwise not have enough granularity in the historicla chart setup to simulate the bars formation. For that reason best is doing the testing in speeded up replay for example.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rdtdale, Today, 01:02 PM
            0 responses
            3 views
            0 likes
            Last Post rdtdale
            by rdtdale
             
            Started by alifarahani, Today, 09:40 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by RookieTrader, Today, 09:37 AM
            4 responses
            18 views
            0 likes
            Last Post RookieTrader  
            Started by PaulMohn, Today, 12:36 PM
            0 responses
            7 views
            0 likes
            Last Post PaulMohn  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            41 views
            0 likes
            Last Post love2code2trade  
            Working...
            X