Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating Stochastics of CCI

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

    Creating Stochastics of CCI

    I am trying to create an indicator of an indicato and cant figure it out I followed the example of the SMA of Volume but would like help on the Wizzard.
    Thanks

    #2
    Hi designer,

    Thanks for the post. Please tell us at what step you run into trouble following the tutorial and we will gladly assist you. Here is the tutorial link - http://www.ninjatrader-support.com/H...verview22.html
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,
      I am trying to create an indicator which is the Stochastics of the CCI. I was able to create all the parameters from the wizzard but when I get to the code portion i'm not sure where to insert the code from the CCI and the Stochastics. I guess I have to insert the CCI code...
      Thanks

      Comment


        #4
        Hi designer,
        First you will have to create a DataSeries object, because the Stochastics takes only a DataSeries input. In the Variables section add

        Code:
         private new DataSeries cciValue;
        Then in the Initialize add

        Code:
         cciValue = new DataSeries(this);
        Then you can use the Set() method to fill the DataSeries in the OnBarUpdate section

        Code:
         cciValue.Set(CCI(Close, MyPeriod)[0]);
        Finally you can create your Stochastic CCI calculation

        Code:
         double stochCCI = Stochastics(cciValue, MyPeriodD, MyPeriodK, MySmoothingPeriod)[0];
        Please also review this link -
        http://www.ninjatrader-support.com/H...iesObject.html
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks,
          Do you suggest a similar indicator I can use as a template for the NT code?

          Comment


            #6
            Hi designer,

            Please check out the following thread, the indicator posted there should give a good starting point for what you want to do -

            http://www.ninjatrader-support2.com/...ead.php?t=3952


            Originally posted by designer View Post
            Thanks,
            Do you suggest a similar indicator I can use as a template for the NT code?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Would I be able to use the StochRSI code (attached)and just replace RSI with CCI in the code?
              Thanks
              Attached Files

              Comment


                #8
                I don't see why not. It should work fine. I have replaced RSI with CCI in indicators before and it was very simple and effective.

                Comment


                  #9
                  Hi,

                  Yes, this indicator can easily be modified to produce a Stochastic CCI.

                  Your minimum, maximum and rsi sets would then look like this -

                  Code:
                  minimum.Set( MIN(CCI(PeriodRsi), LookBack)[0]);
                  maximum.Set( MAX(CCI(PeriodRsi), LookBack)[0]);
                  rsi.Set( CCI(PeriodRsi)[0]);
                  
                  Of course for better style you would want to change the PeriodRSI variable name into PeriodCCI (in the Variables and Properties sections), same with the rsi.Set dataseries.


                  Originally posted by Elliott Wave View Post
                  I don't see why not. It should work fine. I have replaced RSI with CCI in indicators before and it was very simple and effective.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Thanks,
                    I was able to paste your CCI code as shown below (see attachment) then i saved it but when I try to import the saved file into the chart i do not see it in the Indicators list...please check if i placed in the right location.
                    Thanks
                    Attached Files

                    Comment


                      #11
                      Save this file in

                      My Documents\NinjaTrader 6.5\bin\Custom\Indicator

                      Then in NT select, Tools > Edit NinjaScript > Indicator and select this indicator.
                      Then compile it by pressing the F5 key in the Editor.
                      Now this indicator will be available in NT.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Ray thanks I did as sugested but get the following errors in lines 50-56
                        Error CS0103

                        Thanks

                        Comment


                          #13
                          You would then have to debug the error, I would not know what the problem is since its not my code.

                          Here is a help resource that may provide some guidance - http://www.ninjatrader-support2.com/...ead.php?t=3418
                          RayNinjaTrader Customer Service

                          Comment


                            #14
                            Hi designer,

                            Please check out this debugged and commented code of the StocCCI and let me know if you have questions.


                            Originally posted by designer View Post
                            Ray thanks I did as sugested but get the following errors in lines 50-56
                            Error CS0103

                            Thanks
                            Attached Files
                            BertrandNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Revazi123, Today, 08:48 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post Revazi123  
                            Started by M_ichel, Today, 08:38 AM
                            1 response
                            4 views
                            0 likes
                            Last Post NinjaTrader_ChrisL  
                            Started by soon123, Today, 12:18 AM
                            1 response
                            22 views
                            0 likes
                            Last Post NinjaTrader_PaulH  
                            Started by space_trader, Today, 12:52 AM
                            1 response
                            20 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by ybhx0315, Yesterday, 09:06 PM
                            0 responses
                            21 views
                            0 likes
                            Last Post ybhx0315  
                            Working...
                            X