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

What's the benefit of the intra-bar granularity sample?

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

    What's the benefit of the intra-bar granularity sample?

    The sample found here: http://www.ninjatrader-support.com/v...ead.php?t=6652

    I am not clear on the benefit. If you're getting your signals from the 5 minute bar, what purpose does submitting the order on the 1 minute bar serve? Wouldn't the order be submitted at roughly the same time if you had just done it on the 5 minute bar?

    #2
    The sample is for backtesting. In backtesting you can't submit an order until the next bar. This poses a substantial gap between entry signal and order time if your bars are 5min bars. Having intrabar granularity allows you to mimic more closely how it would behave in realtime by submitting orders to say the 1min bars.

    There is not as much use in doing this in realtime since you can simply use CalculateOnBarClose = false in realtime.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      The sample is for backtesting. In backtesting you can't submit an order until the next bar. This poses a substantial gap between entry signal and order time if your bars are 5min bars. Having intrabar granularity allows you to mimic more closely how it would behave in realtime by submitting orders to say the 1min bars.

      There is not as much use in doing this in realtime since you can simply use CalculateOnBarClose = false in realtime.
      If you have 5 minute bars that calculate on close, and you get an entry signal at the end of the 1st bar, isn't the entry made at the open price of the 2nd bar, which should begin at 5:01?

      Comment


        #4
        Without intrabar granularity:
        5:00 = 5min signal bar
        5:05 = trade bar
        earliest possible Exit() = 5:10

        With intrabar granularity:
        5:00 = 5min signal bar
        5:01 = trade bar
        5:02 = earliest possible exit (aside from profit target/stop loss)
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          Without intrabar granularity:
          5:00 = 5min signal bar
          5:05 = trade bar
          earliest possible Exit() = 5:10

          With intrabar granularity:
          5:00 = 5min signal bar
          5:01 = trade bar
          5:02 = earliest possible exit (aside from profit target/stop loss)
          Right but the 5:05 tradebar the entry is made at the open of that bar, which almost always is the same as the close of the previous bar (entry signal bar).

          Maybe I'm missing something. Also, will this be necessary in NT 7?

          Comment


            #6
            The entry is not the issue. It is the benefits in exiting. Again, this is only for a seemingly more realistic backtest result and has limited implications for real world trading.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              The entry is not the issue. It is the benefits in exiting. Again, this is only for a seemingly more realistic backtest result and has limited implications for real world trading.
              In other words this would be one way to simulate the OnMarketUpdate() during backtesting, if you would set the 2nd bar to be 1 Tick series?

              Comment


                #8
                Essentially yes. Keep in mind that 1 tick time frame takes a ton of computing resources though.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                19 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                45 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                21 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X