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

Intrabar granularity

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

    Intrabar granularity

    I was trying to run intrabar granularity for backtesting, and downloaded the script from http://www.ninjatrader-support.com/v...ead.php?t=6652
    I think I understood everything pretty well, but while trying the script, I just get trades if I choose one minute in the strategy backtest box, but this makes the script work as with a single bar series.
    If I choose 5 minutes in the strategy backtest box, no trades are done at all.
    Any idea about what am I doing wrong?
    Thanks a lot!

    PS: By the way, why does the backtest chart draw two SMA lines (5 and 50) while figures are suposed to be calculated with EMA's??

    #2
    Hi eswap0,

    In the example you want to set the time to be 5min for your primary bar series. Trades should occur under this scenario if you have the data. If you are experiencing otherwise it would be great if you could check your Control Center logs and let us know of any fishy errors.

    The chart is suppose to draw EMA of 10 and 25 by default. Are you sure you are testing the right strategy? Please try it again with default settings.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      There's a smily missing: the ashamed one.
      Sorry: I shouldn't test scripts that late. The script runs perfectly.
      Sorry for my stupid mistake: I choosed a diferent strategy..
      Thanks so much,

      PS: it might be usefull to somebody that trades run ok, at the right minute, althougt the chart is plotting them in the wrong bar.

      Comment


        #4
        The charting happens on the 5min bar, but your trades are in the 1mins. Since there are less 5min bars then there are 1min bars they get squished when plotting.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Last question (I hope).
          I realize I can use different minute periods, and everything works, but as soon as I choose "1 day" in the strategy backtest box (instead of n minutes) the script for intrabar granularity shows no trades.
          Is there any way to mix days and minutes?
          Thanks a lot!

          Comment


            #6
            That is the nature of using daily bars. From a daily bar there is no way you can determine intrabar price action so there is no way you can trade intrabar. The only way you can do this is through a multi-time frame strategy. Please see the Help Guide on Multi-Time Frame for more information.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Sorry but, isn't the script from http://www.ninjatrader-support.com/v...ead.php?t=6652 aldready based in Multi-time frame?
              I checked the script and instructions and saw that fit the Help Guide on Multi-Time Frame (like Add(PeriodType.Minute, n) and if (BarsInProgress == n))
              Again in that Guide minutes are not mixed with days...
              Thanks again!

              Comment


                #8
                The best way for you to understand how it works is just to try it for yourself. Please keep in mind the instructions (outlined in the reference sample) on which series needs to be the primary and which needs to be the secondary. Daily and intraday time frames will mix.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by maybeimnotrader, Today, 05:46 PM
                0 responses
                6 views
                0 likes
                Last Post maybeimnotrader  
                Started by quantismo, Today, 05:13 PM
                0 responses
                6 views
                0 likes
                Last Post quantismo  
                Started by AttiM, 02-14-2024, 05:20 PM
                8 responses
                166 views
                0 likes
                Last Post jeronymite  
                Started by cre8able, Today, 04:22 PM
                0 responses
                8 views
                0 likes
                Last Post cre8able  
                Started by RichStudent, Today, 04:21 PM
                0 responses
                5 views
                0 likes
                Last Post RichStudent  
                Working...
                X