Keltner Channel 200 SMA Period for ThinkorSwim

germanburrito

Active member
This is pretty much a keltner channel set to a 200 period expanded, this is a way that Mr. yen trades the channels need to be adjusted for each individual stock, I know its a pain, but I believe to be worth it, the setting are for the QQQ and SPY.

zIBcDpa.png


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
#

declare weak_volume_dependency;

input displace = 0;
input factor = 5.0;
input length = 200;
input price = close;
input averageType = AverageType.SIMPLE;
input trueRangeAverageType = AverageType.SIMPLE;

def shift = factor * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);

def average = MovingAverage(averageType, price, length);

plot Avg = average[-displace];
Avg.SetDefaultColor(GetColor(1));

plot Upper_Band = average[-displace] + shift[-displace];
Upper_Band.SetDefaultColor(GetColor(8));

plot Lower_Band = average[-displace] - shift[-displace];
Lower_Band.SetDefaultColor(GetColor(5));

plot Upper_Band2 = average[-displace] + 2* shift[-displace];
Upper_Band.SetDefaultColor(GetColor(8));

plot Lower_Band2 = average[-displace] -  2* shift[-displace];
Lower_Band.SetDefaultColor(GetColor(5));

plot Upper_Band3 = average[-displace] + 3* shift[-displace];
Upper_Band.SetDefaultColor(GetColor(8));

plot Lower_Band3 = average[-displace] -  3* shift[-displace];
Lower_Band.SetDefaultColor(GetColor(5));

avg.setdefaultColor(color.yellow);
upper_Band.SetDefaultColor(Color.white);
upper_Band2.SetDefaultColor(Color.red);
upper_Band3.SetDefaultColor(Color.red);
lower_Band.SetDefaultColor(Color.White);
lower_Band2.SetDefaultColor(Color.green);
upper_Band3.SetDefaultColor(Color.white);
lower_Band3.SetDefaultColor(Color.white);

avg.Setlineweight(2);
upper_Band2.Setlineweight(2);
lower_Band2.Setlineweight(2);

AddCloud( upper_Band2, upper_Band, Color.LIGHT_ORANGE );
AddCloud( lower_Band, lower_Band2, Color.LIGHT_ORANGE );

AddCloud( upper_Band2, upper_Band3, Color.light_RED );
AddCloud( lower_Band2, lower_Band3, Color.light_green );
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

so what prefer settings for other stocks? any examples?
it works on a lot of tickers those settings, but for example snap has bigger swings, so i would do something like 6.5 factor, what i usually change is the factor, and the time frame i use is a 5 minute is a really powrful tool.
 
Can you please explain where to enter and exit lil bit in detail will be helpful? thanks
well basically the idea behind this indicator is with a counter reversal trend strategy, thats how i trade, I trade against the trend (trend is relative to the time frame you are watching) basically if the price is moving between those levels then is not ready to reverse yet, what you can do is wait for price to go into those levels those levels are a sign the stock is over extended, you can combine this with an oscilator, i would look at a higher time frame to make sure that the ticker didnt just break any major levels, because if it did it might just ride the bands and not come back into the middle or center of the bands and it will tend to ride the outer bands. look at this it helps filter bad trades sometimes.
7qoiqo2.jpg

heres a video on how to set it up on a tick chart, this is the man behind this idea.

 
@germanburrito Thanks for this. I trade similarly.
Looks like the Exponential setting works a bit better for the index futures on the lower timeframes.
Question -- is there a way to disable the cloud and just have the bands?
 
@DPM No problem, and yeah just delete

Code:
AddCloud( upper_Band2, upper_Band, Color.LIGHT_ORANGE );
AddCloud( lower_Band, lower_Band2, Color.LIGHT_ORANGE );

AddCloud( upper_Band2, upper_Band3, Color.light_RED );
AddCloud( lower_Band2, lower_Band3, Color.light_green );
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
385 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top