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

Cumulative Tick Indicator

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

    Cumulative Tick Indicator

    There is an indicator that Brett Steenbarger has discussed on his blog site called the cumulative tick index. I am new to Ninja Trader and can't quite get my head around indicator programming just yet, so was wondering if anyone out there could code it or at least give some pointers.

    The steps are:

    1. Indicator is on the 1 minute $Tick index.
    2. Calculate the average of (High, Low and Close)/3 for each bar
    3. Calculate the average of the previous 2030 bars of the above before current day (this is 5 days (5 x 406 bars)(Brett uses 20 days instead).
    4. Take the close of current 1 minute Tick bar and minus the value calculated in 3.
    5. Add the the current value in 4 to the last value calculated, making it cumulative. Start the day at zero, although maybe that isn't important.

    As you can see this is not totally straight forward.

    Any help you can provide would be great.

    #2
    You can try one of our NinjaScript consultants as a last resort: http://www.ninjatrader.com/webnew/pa...injaScript.htm
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Any one?

      So does anyone have any ideas for how i might implement this indicator?

      Comment


        #4
        I normally don't do this, but since it was a quick indicator here it is. You will need to adjust it yourself if it is wrong. I have not tested or done anything with the indicator.
        Attached Files
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Legend

          Josh - you're a legend - i'll give it a try

          Comment


            #6
            Code bug?

            Hi Josh,

            In lines 53-54:
            for (int x = 0; x < (Period * 406); x++)
            typAvg += Typical[0];

            Shuoldn't it be typAvg += Typical[x]; ??

            That's how I use it, for the TICK.Z symbol (NYSE TICK, IQFeed).
            Tx.

            Comment


              #7
              I don't recall the underlying logic for this indicator, but I would think it is a bug as you have stated.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by techgetgame, Today, 11:42 PM
              0 responses
              6 views
              0 likes
              Last Post techgetgame  
              Started by sephichapdson, Today, 11:36 PM
              0 responses
              1 view
              0 likes
              Last Post sephichapdson  
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,612 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              9 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              19 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Working...
              X