• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by levikNT, Today, 07:36 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post levikNT
                            by levikNT
                             
                            Started by TazoTodua, Today, 07:27 AM
                            0 responses
                            4 views
                            0 likes
                            Last Post TazoTodua  
                            Started by KennyK, Yesterday, 09:47 PM
                            1 response
                            6 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by Dogmatichacker, Yesterday, 03:52 PM
                            1 response
                            13 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by Trino, 03-23-2019, 09:26 AM
                            1 response
                            4 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Working...
                            X