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 algospoke, Yesterday, 06:40 PM
              2 responses
              23 views
              0 likes
              Last Post algospoke  
              Started by ghoul, Today, 06:02 PM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              46 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              23 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