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

Keltner channel color

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

    Keltner channel color

    Hi, may someone help me to make keltner channel to color the lines when the price is above the upper and below the bottom line?

    #2
    Hello nikodine,

    Thanks for your post.

    Is this something you want to create yourself and just need assistance to know what methods to use or are you looking to have someone create it for you?

    Just to be clear the NinjaTrader support team does not provide coding services. We can provide links to 3rd party providers that can provide the indicator coding service.or we can provide you with educational links to get you started and references to applicable help guide sections but you would need to do the actual coding, debugging and testing.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello nikodine,

      Thanks for your post.

      Is this something you want to create yourself and just need assistance to know what methods to use or are you looking to have someone create it for you?

      Just to be clear the NinjaTrader support team does not provide coding services. We can provide links to 3rd party providers that can provide the indicator coding service.or we can provide you with educational links to get you started and references to applicable help guide sections but you would need to do the actual coding, debugging and testing.
      I will make duplicate of current Keltner channel in NT7 and I need just to add the right syntax to make this happend. If you show me an example of the idea will be perfect.
      Thanks

      Comment


        #4
        Hello nikodine,

        Thanks for your reply.

        To change the color of the Keltner plots when price is above the Upper or Lower plots you will need to use PlotColors and assign the color to use based on the logic you create. Here is a link to PlotColors in the Help guide which shows an example of coloring plots: https://ninjatrader.com/support/help...plotcolors.htm

        Note that PlotColors[][] uses two indexes, the first index is the plot number. The plot number starts at 0 and increments 1 for each plot and would be in the order as they are listed in the indicator. The KeltnerChannel has three plots in the order of Midline, Upper, lower, meaning the plot indexes will be [1] for the upper and [2] for the lower ([0] is the midline). The 2nd index is the bars ago which typically would be 0 (zero).

        An example of the logic (assuming you are working in a copy of KeltnerChannel) would be:

        if (Close[0] > Upper[0])
        {
        PlotColors[1][0] = Color.Red; // current bar price is above upper, color upper plot red.
        }

        edit: Original answer referenced NT8, changed to NT7.
        Last edited by NinjaTrader_PaulH; 09-25-2018, 07:04 AM.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello nikodine,

          My previous reply contained references to NinjaTrader8 help guide and methods. I have corrected my reply (post #4) to show the NinjaTrader7 references and methods. Sorry for any confusion.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Paul View Post
            Hello nikodine,

            My previous reply contained references to NinjaTrader8 help guide and methods. I have corrected my reply (post #4) to show the NinjaTrader7 references and methods. Sorry for any confusion.
            Thank you Paul, that's work very well.
            May I ask you one more thing, what I must add to make that if the price is trending up for example, the lines of the channel to be colored, and if the price is trending down to be in different color?
            I tried with rising method, but it seems I miss something.... here is what I tried to impl:

            if (Rising(Upper[0]))
            PlotColors[0][0] = upColor;
            else
            PlotColors[0][0] = downColor;

            Thanks again!

            Comment


              #7
              Hello nikodine,

              Thanks for your reply.

              In your example, you are using PlotColors[0][0] which would point to the Keltner midline, not the upper which would be PlotColors [1][0].

              Also, have you defined upColor and downColor? Something like this in Region variables:

              private Color upColor = Color.Green;
              private Color downColor = Color.Red;
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Paul View Post
                Hello nikodine,

                Thanks for your reply.

                In your example, you are using PlotColors[0][0] which would point to the Keltner midline, not the upper which would be PlotColors [1][0].

                Also, have you defined upColor and downColor? Something like this in Region variables:

                private Color upColor = Color.Green;
                private Color downColor = Color.Red;

                Hm.. yes?
                But why it doesn't allow the rising arg? Have a look:
                Attached Files

                Comment


                  #9
                  Hello nikodine,

                  Thanks for your reply.

                  The Rising() method require the input of a data series which would be Upper. When using Upper[0] you are providing a specific value of the current bar of the data series Upper.

                  Try: if (Rising(Upper))
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_Paul View Post
                    Hello nikodine,

                    Thanks for your reply.

                    The Rising() method require the input of a data series which would be Upper. When using Upper[0] you are providing a specific value of the current bar of the data series Upper.

                    Try: if (Rising(Upper))

                    Yes! That's it, thank you very much.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by CortexZenUSA, Today, 12:53 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by CortexZenUSA, Today, 12:46 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by usazencortex, Today, 12:43 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post usazencortex  
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,265 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    12 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Working...
                    X