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 NinjaCustomer, 05-24-2018, 10:29 PM
              4 responses
              950 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by lucascirax, Today, 06:21 AM
              0 responses
              1 view
              0 likes
              Last Post lucascirax  
              Started by Naouss, Today, 05:43 AM
              1 response
              12 views
              0 likes
              Last Post KonstantinosNT  
              Started by kainermy, Today, 05:22 AM
              0 responses
              11 views
              0 likes
              Last Post kainermy  
              Started by KlausTheMause, Yesterday, 02:57 PM
              1 response
              32 views
              0 likes
              Last Post NinjaTrader_Jason  
              Working...
              X