NexusFi: Find Your Edge


Home Menu

 





Triple keltner


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 8 posts (44 thanks)
    2. looks_two booker777 with 5 posts (0 thanks)
    3. looks_3 Silvester17 with 2 posts (5 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 7,163 views
    2. thumb_up 49 thanks given
    3. group 6 followers
    1. forum 16 posts
    2. attach_file 13 attachments




 
Search this Thread

Triple keltner

  #1 (permalink)
 booker777 
Augusta, GA
 
Experience: Advanced
Platform: NT
Trading: ES, TF
Posts: 100 since Feb 2011
Thanks Given: 36
Thanks Received: 24

Futurestrader posted TOS code below in the create indicator for free thread, looking for his TOS code converted to NT. It is a Triple Keltner. Does anyone know if it was done or how to do it.

declare weak_volume_dependency;
input displace = 0;
input displace2 = 0;
input displace3 = 0;
input factor = 1.75;
input factor2 = 2.5;
input factor3 = 4;
input length = 45;
input price = close;
def shift = factor * AvgTrueRange(high, close, low, length);
def shift2 = factor2 * AvgTrueRange(high, close, low, length);
def shift3 = factor3 * AvgTrueRange(high, close, low, length);
def average = ExpAverage(price, length);
plot Avg = average[-displace];
Avg.SetDefaultColor(GetColor(7));
plot Upper_Band = average[-displace] + shift[-displace];
Upper_Band.SetDefaultColor(GetColor(7));
plot Lower_Band = average[-displace] - shift[-displace];
Lower_Band.SetDefaultColor(GetColor(7));
plot Upper_Band2 = average[-displace] + shift2[-displace];
Upper_Band2.SetDefaultColor(GetColor(7));
plot Lower_Band2 = average[-displace] - shift2[-displace];
Lower_Band2.SetDefaultColor(GetColor(7));
plot Upper_Band3 = average[-displace] + shift3[-displace];
Upper_Band3.SetDefaultColor(GetColor(7));
plot Lower_Band3 = average[-displace] - shift3[-displace];
Lower_Band3.SetDefaultColor(GetColor(7));

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



booker777 View Post
Futurestrader posted TOS code below in the create indicator for free thread, looking for his TOS code converted to NT. It is a Triple Keltner. Does anyone know if it was done or how to do it.

declare weak_volume_dependency;
input displace = 0;
input displace2 = 0;
input displace3 = 0;
input factor = 1.75;
input factor2 = 2.5;
input factor3 = 4;
input length = 45;
input price = close;
def shift = factor * AvgTrueRange(high, close, low, length);
def shift2 = factor2 * AvgTrueRange(high, close, low, length);
def shift3 = factor3 * AvgTrueRange(high, close, low, length);
def average = ExpAverage(price, length);
plot Avg = average[-displace];
Avg.SetDefaultColor(GetColor(7));
plot Upper_Band = average[-displace] + shift[-displace];
Upper_Band.SetDefaultColor(GetColor(7));
plot Lower_Band = average[-displace] - shift[-displace];
Lower_Band.SetDefaultColor(GetColor(7));
plot Upper_Band2 = average[-displace] + shift2[-displace];
Upper_Band2.SetDefaultColor(GetColor(7));
plot Lower_Band2 = average[-displace] - shift2[-displace];
Lower_Band2.SetDefaultColor(GetColor(7));
plot Upper_Band3 = average[-displace] + shift3[-displace];
Upper_Band3.SetDefaultColor(GetColor(7));
plot Lower_Band3 = average[-displace] - shift3[-displace];
Lower_Band3.SetDefaultColor(GetColor(7));


I have once taken the Keltner Universal Indicator and created volatility channels by adding it three times. This indicator is more versatile than a simple Keltner.

-> you can use 27 different moving averages for the midband
-> the offset can be calculated from either the simple range or the average true range
-> midband and channel lines can be further smoothed

However, the indicator uses a single offset multiplier, which means that the channel lines are equidistant. If you wish I can modify it to allow for three different multipliers, which can then be set to your default values 1.75, 2.5 and 4.0.


Reply With Quote
Thanked by:
  #4 (permalink)
 booker777 
Augusta, GA
 
Experience: Advanced
Platform: NT
Trading: ES, TF
Posts: 100 since Feb 2011
Thanks Given: 36
Thanks Received: 24

Fats, I have no idea what any of that means unfortunately,lol, but sounds great. Will it be easy to plot and use for someone not familiar with the indicator or coding. Tks again .

Started this thread Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


booker777 View Post
Fats, I have no idea what any of that means unfortunately,lol, but sounds great. Will it be easy to plot and use for someone not familiar with the indicator or coding. Tks again .

Can you post a chart from TOS? I have now added the variable offsets. The code from TOS specifies an EMA(45) as the midband. It further uses an ATR(45). The problem here is that I do not know, whether the definition of the ATR from TOS follows the original formula by Welles Wilder or not. If I remember, TOS has both formulas. If this is the regular EMA(45) of the true range, it means that it is an ATR(23) in NinjaScript.

Chart attached. It is now possible to select different offset multipliers. Will post in the downloads, as soon as I have tested it.

What do you intend to use this indicator for?


Reply With Quote
Thanked by:
  #6 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


Fat Tails View Post
Can you post a chart from TOS? I have now added the variable offsets. The code from TOS specifies an EMA(45) as the midband. It further uses an ATR(45). The problem here is that I do not know, whether the definition of the ATR from TOS follows the original formula by Welles Wilder or not. If I remember, TOS has both formulas. If this is the regular EMA(45) of the true range, it means that it is an ATR(23) in NinjaScript.

Chart attached. It is now possible to select different offset multipliers. Will post in the downloads, as soon as I have tested it.

What do you intend to use this indicator for?

@Fat Tails,

it looks like it's not the wilder atr:



just in case. here's tos atr wilder:



and here's the other average true range indicator:


Reply With Quote
Thanked by:
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Silvester17 View Post
@Fat Tails,

it looks like it's not the wilder atr:



You are right. It is not the Wilder ATR. However, I am a bit confused. If I look at the TOS chart, the EMA(45) seems to be correct, but the Keltner Channels come out too narrow.

I have checked my version against the classic Keltner Channel (with SMA / simple range setting) and it perfectly matches the original Keltner Channel. Can you tell me, why the TOS bands are narrower and have a different shape? Or is there anything that I have overlooked?


Below are the two charts again for comparison:




Reply With Quote
Thanked by:
  #8 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


Fat Tails View Post
You are right. It is not the Wilder ATR. However, I am a bit confused. If I look at the TOS chart, the EMA(45) seems to be correct, but the Keltner Channels come out too narrow.

I have checked my version against the classic Keltner Channel (with SMA / simple range setting) and it perfectly matches the original Keltner Channel. Can you tell me, why the TOS bands are narrower and have a different shape? Or is there anything that I have overlooked?


Below are the two charts again for comparison:

@Fat Tails,

I noticed that too.

I also checked against the original keltner channel from tos and they match as well. so not sure, but will investigate further.


Reply With Quote
Thanked by:
  #9 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Silvester17 View Post
@Fat Tails,

I noticed that too.

I also checked against the original keltner channel from tos and they match as well. so not sure, but will investigate further.


I just found out the reason. The average true range from TOS is a SMA(True Range), not an EMA. If I set the smoothing for the true range of my indicator to "SMA", then the two charts show a perfect match....



Reply With Quote
Thanked by:
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Testing done, it should now reproduce the TOS indicator with the default settings.

I am sure that there are better settings than the default settings.

Attached Files
Elite Membership required to download: VolaChannels.zip
Reply With Quote




Last Updated on January 7, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts