Keltner Channel indicator
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
Show Keltner Band Spread Calculations
Collapse
X
-
Show Keltner Band Spread Calculations
How can I get an indicator that tells me the distance in points, between the upper Keltner band and the lower Keltner band?
Keltner Channel indicator -
Vizard,
I am not aware of a specific indicator that does this. You may have some luck searching in the User App Share section.
I can help you modify the existing Keltner Channel indicator to provide that information fairly easily. How would this value be displayed on the chart?Josh G.NinjaTrader Customer Service
Comment
-
Thanks for the help.
I have ended up asking in this section, because I have been searching for it for several days without success on the Internet, in the forum and User Application Section as well.
I have a capture, as it is in the graphic, I attach it to you.
It is a panel, like a box, located on the upper left of the graph, what it does is measure the width of the entire channel and shows you at each moment how large the points in the Keltner Channel is, where B.Sp. 10.68 in the image.
This Keltner indicator in particular is called KeltnerChannelEMA to nijatrader 7
Comment
-
Vizard,
You can open and edit the built in Keltner Indicator by going to your Control Center>>Tools>>Edit NinjaScript>>Indicator...>>select "KeltnerChannel"
You could add the difference value to the top left by simply adding something similar to the following at the bottom of OnBarUpdate() and the right-clicking to select "compile".
Code:DrawTextFixed("tag", "Difference: "+diff[0], TextPosition.TopLeft);
Josh G.NinjaTrader Customer Service
Comment
-
Hello JoshG,
It would be like this the modification ??, the box I do not care with that it appears the value of the channel in the left would serve to me, comfirmame that is well and I modify it in the indicator.
Code:protected override void OnBarUpdate() DrawTextFixed("tag", "Difference: "+diff[0], TextPosition.TopLeft); { diff.Set(High[0] - Low[0]); double middle = EMA(Typical, Period)[0]; double offset = EMA(diff, Period)[0] * offsetMultiplier; double upper = middle + offset; double lower = middle - offset; Midline.Set(middle); Upper.Set(upper); Lower.Set(lower); }
Comment
-
Vizard,
It would go inside the OnBarUpdate() method. It would be something like this:
Code:protected override void OnBarUpdate() { diff.Set(High[0] - Low[0]); double middle = EMA(Typical, Period)[0]; double offset = EMA(diff, Period)[0] * offsetMultiplier; double upper = middle + offset; double lower = middle - offset; Midline.Set(middle); Upper.Set(upper); Lower.Set(lower); [B] DrawTextFixed("tag", "Difference: "+diff[0], TextPosition.TopLeft); [/B] }
Josh G.NinjaTrader Customer Service
Comment
-
Vizard,
You would need to do your own math to get that value. I was able to use the following snippet to calculate that. I suggest putting this where you currently have the DrawTextFixed method
Code:double BaseValue = Bars.Instrument.MasterInstrument.PointValue*TickSize; double numTicks = diff[0]*TickSize; double final = numTicks*BaseValue; DrawTextFixed("tag", "Difference: "+final, TextPosition.TopLeft);
Josh G.NinjaTrader Customer Service
Comment
-
SK615, Welcome to the NinjaTrader Forum.
The code discussed in this post is for NinjaTrader 7 and will not work for NinjaTrader 8.
There are a few key items to look for when converting your scripts from NinjaTrader 7 format to NinjaTrader 8, and we keep a Code Breaking Changes table updated in the NinjaTrader 8 Help Guide to assist in identifying changes or new implementations of familiar methods and properties from NinjaTrader 7: http://ninjatrader.com/support/helpG...ng_changes.htm
The names of many methods and properties have changed slightly, so you will need to refactor these in your code. The Code Breaking Changes table can make this task much easier, and there is also an alphabetical reference in the Help Guide that can help to find new method/property names: http://ninjatrader.com/support/helpG..._reference.htm
You will want to start by converting all of your NT7 Data Series Objects to Series<t>. Also, the DrawTextFixed() method has been changed as well.
I suggest creating another post in the NT8 forum if you would like to discuss this further.
Josh G.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, Today, 10:13 AM
|
0 responses
2 views
0 likes
|
Last Post
by samish18
Today, 10:13 AM
|
||
Started by kenz987, Yesterday, 10:20 AM
|
2 responses
12 views
0 likes
|
Last Post
by kenz987
Today, 10:13 AM
|
||
Started by nicthe, 08-23-2023, 07:53 AM
|
7 responses
196 views
0 likes
|
Last Post
by nicthe
Today, 09:26 AM
|
||
Started by nicthe, Today, 09:24 AM
|
0 responses
5 views
0 likes
|
Last Post
by nicthe
Today, 09:24 AM
|
||
Started by stalt, 12-28-2015, 01:36 PM
|
6 responses
1,536 views
0 likes
|
Last Post
by giulyko00
Today, 09:16 AM
|
Comment