Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adaptive CCI

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

    Adaptive CCI

    This was created by Mike Winfrey and I. Mike gives the following description :

    The adaptive CCI is based on formulas published in John Ehler's book, "Rocket Science for Traders". You can also visit his website at mesasoftware.com which he has much to read. Also visit tuckerreport.com. Very good articles about the CCI and making it better. In fact, I suggest you read tuckerreport.com to get a better explanation of the adaptive CCI than what I can give. However, the basic idea of the John Ehlers CCI is to dynamically adjust the CCI period based on the market cycle. The period will range from 6 to 50 or in my case I allow it to go even higher to let it minimize the effects of divergence as much as possible. You may not be bothered by divergence but I am. This version of the adaptive CCI also has the same 2 features that the LinRegMulti has, up to 4 alternate CCIs overlayed with the main CCI and also smoothing. Smooth is easier to explain so I will start there. Smooth is a setting that allows you reduce the humps and bumps of the normal CCI. Using this feature applies to all the CCIs, the main one and the alternates. The alternate CCIs are adaptive as well but they use a different formula to calculate the CCI. Typical price is calculated using (High + Low + Close) /3. We modified that as follows. High and Low aren't the high and low of the current bar. High is the highest high for the previous N bars and Low is the lowest low of the previous N bars. Close is just the close of the current bar. Again, this alternate formula is only used for the alternate CCI plots. The main CCI uses the standard formula for the CCI. You can select the number of bars that each of the alternate CCIs will sample. I use 2, 4, 6, and 8. Can go even wider if you like. Experiment with it to see which you like better. This difference causes some disparity between the alternate CCIs and the main CCI which gives me a heads up as to the direction price is more likely to move. The alternate CCIs really give a pretty good idea when you get those fakeout patterns. Obviously not a certainty but if you can stay out of enough of those fakeouts, you might have a profitable day.

    You will notice the bars aren't the same as the normal Woodie CCI. They are like the LinRegMulti bars. Green means all the alternate CCIs are pointing up. Red means all the alternate CCIs are pointing down. Gray means the alternate CCIs are pointing in different directions. Be cautious using them as they don't always refresh properly during the live market. I use them for confirmation but I also have to reload the script to be sure.



    Note : If you just want to see the Adaptive CCI on its own you can remove all the additional features within the properties pane.


    To import:

    - Download the file contained in this thread to your desktop
    - From the Control Center window select the menu File > Utilities > Import NinjaScript
    - Select the downloaded file
    Attached Files

    #2
    Thanks Gumphrie!
    RayNinjaTrader Customer Service

    Comment


      #3
      Thank You Gumphire, I like that!

      Comment


        #4
        This is really neat. Thanks to Gumphrie AND to Mike Winfrey.

        Has anyone tested building this on 6.5?

        I get errors (see screen clip) when I try compiling this on 6.5 but no errors on 6.0.1000.7.

        I find that if I comment out the following lines of code the problem goes away:

        Code:
        [Description("Number of Adaptive Alternative plots to plot")]
        [Category("Parameters")]
        public AdaptiveCCIPlots AdaptiveCCIPlotNo
        {
           get { return noPlots; }
           set { noPlots = value; }
        }
        I also found a similar error in another indicator with 6.5 (I think it was one of TRO's indicators), thus I suspect there is a bug in the current 6.5 beta test which causes this compile error.
        Attached Files
        Last edited by KBJ; 12-28-2007, 01:26 AM.

        Comment


          #5
          Thanks KBJ, not running the 6.5 yet, couldn't get the installer downloader to work...

          Comment


            #6
            If you use self defined types/enums in 6.5 you need to write the whole namespace name in the properties section. I think this is necessary for the auto generated code.


            E.g. NinjaTrader.Indicator.AdaptiveCCI.AdaptiveCCIPlots

            Comment


              #7
              Thanks. Based on your advice, I found that the following syntax fixes the problem:

              Code:
              [Description("Number of Adaptive Alternative plots to plot")]
              [Category("Parameters")]
              public NinjaTrader.Indicator.Adaptive_CCI.AdaptiveCCIPlots AdaptiveCCIPlotNo
              {
                 get { return noPlots; }
                 set { noPlots = value; }
              }

              Comment


                #8
                Hi Gumphrie,

                Thank you very much for your work on adaptive cci. I have a question, can it be modified to shorten the cycle?

                Right now it resembles CCI 14 periods and I would like it to resemble CCI 6 periods. Ideally, I would want to display both lines in the indicator.

                Thanks,
                redduke

                Comment


                  #9
                  Thank You

                  Thank You

                  Comment


                    #10
                    Hello,

                    Can anyone answer my question below?

                    Thanks,
                    redduke

                    Comment


                      #11
                      Red Duke,

                      The adaptive cci is just that, adaptive based on the cycle of the market. There are times when the adpative will look like a 14 and other times it will look like a 50 or anything in between. You can look at the code and feel free to modify it any way you like. Take a look at the code and you will see that the period is calculated as opposed to being static. When you ask is there any way to change the cycle, what you're really asking is can I change the period. The period IS the cycle for the sake of this discussion. If that's what you really want then just use the CCI indicator as provided with NT. As you probably know, the market oscillates in wavelike patterns or in a cycle. The calculations in the adaptive cci are an attempt to determine what the cycle is and apply the appropriate period to the CCI. That about sums it up. YOu can read more by googleing John Ehlers adaptive cci.

                      Hope this helps.
                      Mike Winfrey

                      Comment


                        #12
                        Hi Mike,

                        Thanks for your reply. It makes sense what you wrote, and I was thinking along the same lines. However, I have never seen adaptive CCI move faster then 14 CCI, and that is the basis of my question. Is there anything in a code that can change it? Or is the smallest cycle 14?

                        Regards,
                        redduke

                        Comment


                          #13
                          Redduke,

                          No, there isn't any current way to do what you ask...you can certainly modify the code to fit your needs. However, based on my experience with the adaptive code, I don't know what you would gain. If you want a faster CCI period then just use a static period .

                          good Luck,
                          Mike

                          Comment


                            #14
                            Redduke, I've done a little with adaptive stochastics (easylanguage not NT) and you may get what you want if you use a 1/2 cycle length.

                            Comment


                              #15
                              Thanks a lot guys for this info.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by zstheorist, Today, 07:52 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post zstheorist  
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              149 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post tkaboris  
                              Working...
                              X