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 chbruno, Today, 04:10 PM
              0 responses
              3 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              6 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by frslvr, 04-11-2024, 07:26 AM
              9 responses
              127 views
              1 like
              Last Post caryc123  
              Working...
              X