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!
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
NinjaTrader
Keltner channel color
Collapse
X
-
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
-
Originally posted by NinjaTrader_Paul View PostHello 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.
Thanks
Comment
-
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
-
Originally posted by NinjaTrader_Paul View PostHello 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.
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
-
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
-
Originally posted by NinjaTrader_Paul View PostHello 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:
Comment
-
Originally posted by NinjaTrader_Paul View PostHello 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 traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
46 views
0 likes
|
Last Post Today, 02:36 PM | ||
Started by arvidvanstaey, Today, 02:19 PM
|
1 response
6 views
0 likes
|
Last Post Today, 02:33 PM | ||
Started by mmckinnm, Today, 01:34 PM
|
3 responses
5 views
0 likes
|
Last Post Today, 02:12 PM | ||
Started by f.saeidi, Today, 01:32 PM
|
2 responses
9 views
0 likes
|
Last Post
by f.saeidi
Today, 02:10 PM
|
Comment