• 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

Keltner channel color

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

  • nikodine
    started a topic Keltner channel color

    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?

  • nikodine
    replied
    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.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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))

    Leave a comment:


  • nikodine
    replied
    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

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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;

    Leave a comment:


  • nikodine
    replied
    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!

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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.

    Leave a comment:


  • nikodine
    replied
    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

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by indy73, Today, 04:42 PM
0 responses
2 views
0 likes
Last Post indy73
by indy73
 
Started by Italianforex, Today, 06:20 AM
2 responses
9 views
0 likes
Last Post gplatis
by gplatis
 
Started by alextrd, Today, 01:51 PM
1 response
8 views
0 likes
Last Post NinjaTrader_JoshG  
Started by Boonfly8, Today, 12:10 PM
1 response
5 views
0 likes
Last Post NinjaTrader_Jesse  
Started by NinjaTrader_PaulH, Today, 11:24 AM
0 responses
6 views
0 likes
Last Post NinjaTrader_PaulH  
Working...
X