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

CCI with changing color

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

    CCI with changing color

    Hi everyone,

    I am new to ninjatrader having some difficulty, I would like to know if anyone has the cci indicator with changing color when over bought and over sold.

    #2
    Hello Bdg820,
    Thanks for posting today.

    We do not do custom coding on the support side. However, this is easy enough that I created a sample CCI indicator for you with the desired behavior.

    The SampleCCIColored indicator will change the plot to green when the CCI drops below 0 and plots red when the CCI indicator is above 0 after the bar update. You can change these colors by adapting the code to your needs.

    To import this NinjaScript follow these steps.
    1. From the Control Center window select the menu File > Utilities > Import NinjaScript to open the Import NinjaScript dialog window
    2. Select the file you want to import
    3. Press the "Open" button

    Please let us know if we may be of further assistance for anything NinjaTrader.
    Attached Files
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      cci color change

      Hi Alex,

      Thanks for responding. i wanted the color to change above +100 and below -100.
      thanks

      Comment


        #4
        Hello Bdg820,
        Thanks for the reply.

        This change can be made inside the code of the indicator provided.
        • From the Control Center>Tools>Edit NinjaScript>Indicators
        • Double mouse click the SampleCCIColored indicator
        • Locate lines 58 and 62 with this code.
        • Code:
          if(Value[0] > 0)
        • Code:
          if(Value[0] < 0)
        • Change the value of the conditional statement from 0 to 100 and -100 like the code below
        • Code:
          if(Value[0] > 100)
        • Code:
          if(Value[0] < -100)
        • Right mouse click>Compile
        • Close the Indicator editor


        Reload the indicator on the chart or press F5 on the chart to reload the active indicator.

        These values can be changed to match which ever CCI level you wish to change the color of plot on.

        Please let us know if we may be of further assistance for anything NinjaTrader.
        Alex G.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          I downloaded the Sample CCI COloured Indicator and it is fine. However, i would like to have the GREEN colour above and the REd below. I went into the editor and I changed this and saved it. I guessed that just changing the colours it woudl work but still it appears with red on the top and green below. How can I do it please? many thanks
          }
          //condition statement to change color of CCI plot if over bought or over sold
          if(Value[0] > 0)
          {
          PlotColors[0][0] = Color.Green;
          }
          if(Value[0] < 0)
          {
          PlotColors[0][0] = Color.Red;

          Comment


            #6
            Hello,
            Can you verify that you also compiled the indicator after making the change and reloaded the NinjaScript on the chart by right clicking on the chart and selecting Reload NinjaScript?
            The code provided should produce your desired result.
            Cody B.NinjaTrader Customer Service

            Comment


              #7
              Thanks. I just saved it.

              How do I compile it?

              Comment


                #8
                I got it ! Right click button on the mouse Compile! =)
                Many thanks

                Comment


                  #9
                  Hi,
                  Another question.

                  If I use the CCI, the Williams and the Heiken Ashi with Range bars, shall I put all of them as "Calculate on bar close" as False or True. Since they are Range bars, I am not sure what will be best.
                  Many thanks

                  Comment


                    #10
                    Hello,
                    Can you clarify if you are adding this indicators in a strategy or are you adding them to a chart through the indicators menu?
                    Cody B.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_CodyB View Post
                      Hello,
                      Can you clarify if you are adding this indicators in a strategy or are you adding them to a chart through the indicators menu?
                      Hi,
                      I am adding it to a Range chart with the indicator menu. On top of the chart,

                      Actually, I add the Heiken Ashi, the CCI and the Williams %R on the chart.

                      I am not sure if I should use True or False on Calculate to close bar.

                      many thanks

                      Comment


                        #12
                        Hello,,
                        Unfortunately we can not make a recommendation on which one to use as this is decision is completely up to the user. This depends on if you want the calculations to occur intrabar or if you want them to occur at the end of every bar. If you decide to have CalculateOnBarClose set to false I would like to note that this is more performance intensive.
                        Cody B.NinjaTrader Customer Service

                        Comment


                          #13
                          Ok, Cody,

                          Many thanks

                          Comment


                            #14
                            Originally posted by NinjaTrader_AlexG View Post
                            Hello Bdg820,
                            Thanks for posting today.

                            We do not do custom coding on the support side. However, this is easy enough that I created a sample CCI indicator for you with the desired behavior.

                            The SampleCCIColored indicator will change the plot to green when the CCI drops below 0 and plots red when the CCI indicator is above 0 after the bar update. You can change these colors by adapting the code to your needs.

                            To import this NinjaScript follow these steps.
                            1. From the Control Center window select the menu File > Utilities > Import NinjaScript to open the Import NinjaScript dialog window
                            2. Select the file you want to import
                            3. Press the "Open" button

                            Please let us know if we may be of further assistance for anything NinjaTrader.
                            Hi AlexG,

                            I'm trying to import the indicator sampleCciColored into Ninjatrader 8, it's saying its incompatible. Can you please help.

                            Thanks,
                            Bdg820

                            Comment


                              #15
                              Originally posted by NinjaTrader_AlexG View Post
                              Hello Bdg820,
                              Thanks for posting today.

                              We do not do custom coding on the support side. However, this is easy enough that I created a sample CCI indicator for you with the desired behavior.

                              The SampleCCIColored indicator will change the plot to green when the CCI drops below 0 and plots red when the CCI indicator is above 0 after the bar update. You can change these colors by adapting the code to your needs.

                              To import this NinjaScript follow these steps.
                              1. From the Control Center window select the menu File > Utilities > Import NinjaScript to open the Import NinjaScript dialog window
                              2. Select the file you want to import
                              3. Press the "Open" button

                              Please let us know if we may be of further assistance for anything NinjaTrader.
                              Can anyone convert the file to be compatible with NT8. TIA

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by techgetgame, Yesterday, 11:42 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post techgetgame  
                              Started by sephichapdson, Yesterday, 11:36 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post sephichapdson  
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,613 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Yesterday, 05:56 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              20 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Working...
                              X