Confirmation Candles Indicator For ThinkorSwim

I have been working on an Idea I am calling confirmation candles. I often times find myself trying to find agreement among the numerous indicators that I use to help guide my decisions. Unfortunately, a lot of the time this creates indicator overload and analysis paralysis. So I have included 13 indicators of trend within this indicator. You can choose how many of the 13 indicators have to be in agreement in order to confirm the trend. I may have gone a bit overboard here, however it makes it adaptable to individual risk tolerance and trading style. Checkout the image below. If anyone likes this idea/indicator, I am happy to share the script.

7ItcupI.png
Hi Christoper84, thank u very much in sharing this script. Shall try it out. May i know what is the indicator u r using that shows the red & green zone per your attached image ?

 
Hi Christoper84, thank u very much in sharing this script. Shall try it out. May i know what is the indicator u r using that shows the red & green zone per your attached image ?
Hi VickyVJ,
That script is the Average Price Movement Indicator and was written by @BenTen. Very useful indicator. Here's the code.
Code:
# Average Price Movements
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eHhGyI6R-CD-Average-Daily-Range-Zones-highs-and-lows-of-the-day/

input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def dayrange = (high - low);

def r1 = dayrange[1];
def r2 = dayrange[2];
def r3 = dayrange[3];
def r4 = dayrange[4];
def r5 = dayrange[5];
def r6 = dayrange[6];
def r7 = dayrange[7];
def r8 = dayrange[8];
def r9 = dayrange[9];
def r10 = dayrange[10];

def adr_10 = (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10;
def adr_5 = (r1 + r2 + r3 + r4 + r5) / 5;

def hl1 = (open + (adr_10 / 2));
def ll1 = (open - (adr_10 / 2));
def hl2 = (open + (adr_5 / 2));
def ll2 = (open - (adr_5 / 2));

def h1 = hl1;
def l1 = ll1;
def h2 = hl2;
def l2 = ll2;

AddCloud(h1, h2, Color.RED, Color.RED);
AddCloud(l1, l2, Color.GREEN, Color.GREEN);

#h1.SetDefaultColor(Color.dark_red);
#h2.SetDefaultColor(Color.DARK_RED);
#l1.SetDefaultColor(Color.dark_green);
#l2.SetDefaultColor(Color.dark_green);

#Edited By Playstation 23.05.2020
#You can set whether to show the bubbles. Change or add the h1,h2,l1,l2 values to your preference.

input showBubble = yes;
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

#This will show the price at the support and resistance levels.
#AddChartBubble(SR,h2,Concat("R: ",Round(h2)),Color.RED);
#AddChartBubble(SR,l2,Concat("S: ",Round(l2)),Color.GREEN);

#Swap hashtags if you want just the Resistance/Support words.
#AddChartBubble(SR, h2, "DAILY RESISTANCE", Color.RED);
#AddChartBubble(SR, l2, "DAILY SUPPORT", Color.GREEN);

#Edited By Playstation 26.05.2020
#Added Labels to indicate request of adding labels to show price when breakabove resistance or below support.
AddLabel(yes, if close > h1 == yes then "Prior Daily Resistance May Become Support" else "", color.YELLOW);
AddLabel(yes, if close < l1 == yes then "Prior Daily Support May Become Resistance" else "", color.YELLOW);
 
Hi VickyVJ,
That script is the Average Price Movement Indicator and was written by @BenTen. Very useful indicator. Here's the code.
Code:
# Average Price Movements
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eHhGyI6R-CD-Average-Daily-Range-Zones-highs-and-lows-of-the-day/

input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def dayrange = (high - low);

def r1 = dayrange[1];
def r2 = dayrange[2];
def r3 = dayrange[3];
def r4 = dayrange[4];
def r5 = dayrange[5];
def r6 = dayrange[6];
def r7 = dayrange[7];
def r8 = dayrange[8];
def r9 = dayrange[9];
def r10 = dayrange[10];

def adr_10 = (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10;
def adr_5 = (r1 + r2 + r3 + r4 + r5) / 5;

def hl1 = (open + (adr_10 / 2));
def ll1 = (open - (adr_10 / 2));
def hl2 = (open + (adr_5 / 2));
def ll2 = (open - (adr_5 / 2));

def h1 = hl1;
def l1 = ll1;
def h2 = hl2;
def l2 = ll2;

AddCloud(h1, h2, Color.RED, Color.RED);
AddCloud(l1, l2, Color.GREEN, Color.GREEN);

#h1.SetDefaultColor(Color.dark_red);
#h2.SetDefaultColor(Color.DARK_RED);
#l1.SetDefaultColor(Color.dark_green);
#l2.SetDefaultColor(Color.dark_green);

#Edited By Playstation 23.05.2020
#You can set whether to show the bubbles. Change or add the h1,h2,l1,l2 values to your preference.

input showBubble = yes;
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

#This will show the price at the support and resistance levels.
#AddChartBubble(SR,h2,Concat("R: ",Round(h2)),Color.RED);
#AddChartBubble(SR,l2,Concat("S: ",Round(l2)),Color.GREEN);

#Swap hashtags if you want just the Resistance/Support words.
#AddChartBubble(SR, h2, "DAILY RESISTANCE", Color.RED);
#AddChartBubble(SR, l2, "DAILY SUPPORT", Color.GREEN);

#Edited By Playstation 26.05.2020
#Added Labels to indicate request of adding labels to show price when breakabove resistance or below support.
AddLabel(yes, if close > h1 == yes then "Prior Daily Resistance May Become Support" else "", color.YELLOW);
AddLabel(yes, if close < l1 == yes then "Prior Daily Support May Become Resistance" else "", color.YELLOW);
Thank u Christopher. I have just started using your Confirmation Candles V.8.
How do U use in conjunction with this Average Price Movement Indicator? Say for instance the price is still within the band set up by the confirmation candle but it had crossed above the red zone of the Average Price Movement Indicator. Does it mean this is a possible signal to exit the position soon or scale out?
 
Last edited:
Thank u Christopher. I have just started using your Confirmation Candles V.8.
How do U use in conjunction with this Average Price Movement Indicator? Say for instance the price is still within the band set up by the confirmation candle but it had crossed above the red zone of the Average Price Movement Indicator. Does it mean this is a possible signal to exit the position soon or scale out?
Hi VickyVJ!
I used the APM to show support and resistance and give more validity to my signals. It works pretty well for that purpose since signals that trigger in and around support and resistance levels tend to be stronger signals. However, I currently use CC Candles (most recent adaptation of the Confirmation Candles) which includes support and resistance lines that are color coded to give insight to the trend environment. I like the additional insight, and it fits my trading style a little better.
 
@Christopher84 what time frames are you finding the best reads for this setup?
I like swing trading on 1 - 4 hour charts. Works well for scalping on 10 min chart. Honestly, it will work well on any time frame. It just depends how closely you want to monitor and get in and out of positions. Backtesting suggest that the 10 min chart gives the most profitability. Looking at the day chart to establish the overall trend environment before proceeding on a lower timeframe will yield better results.
 
Christopher some really nice work here.
Thank you! It's not without its shortcomings but I am continuing to make improvements. One of the reasons I took such an interest in your indicator "The One" was because I am working on a very similar problem with reversals at the moment. Its difficult since the candles already show reversals. Adding additional reversal signals is extremely challenging to do without creating too many false signals and creating confusion. I am hoping to release a new version of CC Candles next week with solid reversal signals. I can't wait to see how your indicator evolves.
 
Thank you! It's not without its shortcomings but I am continuing to make improvements. One of the reasons I took such an interest in your indicator "The One" was because I am working on a very similar problem with reversals at the moment. Its difficult since the candles already show reversals. Adding additional reversal signals is extremely challenging to do without creating too many false signals and creating confusion. I am hoping to release a new version of CC Candles next week with solid reversal signals. I can't wait to see how your indicator evolves.
Take what you need. I will print out your code and decipher it but i think they may compliment. Find something volatile and watch how they behave. I am watching MGI right now
 
Take what you need. I will print out your code and decipher it but i think they may compliment. Find something volatile and watch how they behave. I am watching MGI right now
I have loaded the new version of your code. Here's TSLA on a 2 min chart. In the uptrend, there are a lot of similarities in the signals. (see image) Looks nice!
4r6bS4x.png

The second image shows price in a downtrend. The One still missing exits in this trend environment. CC Candles are still showing some stray buy signals as well. (see image below)
O0JlVbF.png

The main problem is the difference in price action going up vs going down. The old adage, you take the stairs up and the elevator down sums it up pretty well. The quick thrust downward in price bottoms out the indicators resulting in buy signals at the wrong time. And price will continue throwing false signals as it bounces of the bottom and reverts to the mean. Its kind of like throwing a ball off of a staircase. Every time it bounces its a buy signal, and every time it bounces back high enough for you to catch it is your sell signal. Problem is, it never bounces high enough to come back to you (hence no sell signals). I'm sure we can figure out something that will work well. Definitely an interesting puzzle. I tend to lean on the CC Candles to confirm my reversal signals.
 
I have loaded the new version of your code. Here's TSLA on a 2 min chart. In the uptrend, there are a lot of similarities in the signals. (see image) Looks nice!
4r6bS4x.png

The second image shows price in a downtrend. The One still missing exits in this trend environment. CC Candles are still showing some stray buy signals as well. (see image below)
O0JlVbF.png

The main problem is the difference in price action going up vs going down. The old adage, you take the stairs up and the elevator down sums it up pretty well. The quick thrust downward in price bottoms out the indicators resulting in buy signals at the wrong time. And price will continue throwing false signals as it bounces of the bottom and reverts to the mean. Its kind of like throwing a ball off of a staircase. Every time it bounces its a buy signal, and every time it bounces back high enough for you to catch it is your sell signal. Problem is, it never bounces high enough to come back to you (hence no sell signals). I'm sure we can figure out something that will work well. Definitely an interesting puzzle. I tend to lean on the CC Candles to confirm my reversal signals.
LOL The solution is to discriminate against the buy signals if the stock is trending down. If you made the 7 day moving average have to be above the 50 days MA before a valid Buy signal was allowed or something like that so the stock must be in an uptrend condition. But some people like to catch a falling knife. I personally use to buy in 3 waves. 20% first, 30% second and if it fell more 50% so i would dollar cost down but that doesn't always work
 
I have loaded the new version of your code. Here's TSLA on a 2 min chart. In the uptrend, there are a lot of similarities in the signals. (see image) Looks nice!
4r6bS4x.png

The second image shows price in a downtrend. The One still missing exits in this trend environment. CC Candles are still showing some stray buy signals as well. (see image below)
O0JlVbF.png

The main problem is the difference in price action going up vs going down. The old adage, you take the stairs up and the elevator down sums it up pretty well. The quick thrust downward in price bottoms out the indicators resulting in buy signals at the wrong time. And price will continue throwing false signals as it bounces of the bottom and reverts to the mean. Its kind of like throwing a ball off of a staircase. Every time it bounces its a buy signal, and every time it bounces back high enough for you to catch it is your sell signal. Problem is, it never bounces high enough to come back to you (hence no sell signals). I'm sure we can figure out something that will work well. Definitely an interesting puzzle. I tend to lean on the CC Candles to confirm my reversal signals.
Whatcha think about some form of this code to validate a stock is in an uptrend. Almost like a master on/off to buy. This plots a 50 day and a 100 day moving over the 200 day MA but it could be finer toned then that. Just a thought.
Code:
Code:
#

#-----------------------------------------------------------------------
declare lower;

input fastLengthV = 15;
input slowLengthV = 40;
input MACDLengthV = 9;
input averageTypeV = AverageType.EXPONENTIAL;

def    fastAvgV = MovingAverage(averageTypeV, close, fastLengthV);
def    slowAvgV = MovingAverage(averageTypeV, close, slowLengthV);

def MacdValue = (fastAvgV - slowAvgV) * 100;


input price = close;
input length8 = 5;
input length14 = 14;
input length50 = 50;
input length100 = 100;
input length200 = 200;
input displace = 0;
input showBreakoutSignals = no;
input crossingType = {default above, below};

def AvgExp = ExpAverage(price[-displace], length8);
def AvgExp14 = ExpAverage(price[-displace], length14);
def AvgExp50 = ExpAverage(price[-displace], length50);
def AvgExp100 = ExpAverage(price[-displace], length100);
def AvgExp200 = ExpAverage(price[-displace], length200);
def EMASELL2 = 1 - ( AvgExp > AvgExp50 );
def EMABULL2 = ( AvgExp > AvgExp50 ) ;
def EMABULL3 = (AvgExp > AvgExp14 and AvgExp > AvgExp50 and AvgExp14 > AvgExp50) ;

def EMABULL50200 = ( AvgExp50 > AvgExp200 ) ;
def EMABULL100200 = ( AvgExp100 > AvgExp200 ) ;


plot signal2 = EMABULL50200;
plot signal3 = EMABULL100200;
#end code
 
Hi VickyVJ,
That script is the Average Price Movement Indicator and was written by @BenTen. Very useful indicator. Here's the code.
Code:
# Average Price Movements
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eHhGyI6R-CD-Average-Daily-Range-Zones-highs-and-lows-of-the-day/

input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def dayrange = (high - low);

def r1 = dayrange[1];
def r2 = dayrange[2];
def r3 = dayrange[3];
def r4 = dayrange[4];
def r5 = dayrange[5];
def r6 = dayrange[6];
def r7 = dayrange[7];
def r8 = dayrange[8];
def r9 = dayrange[9];
def r10 = dayrange[10];

def adr_10 = (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10;
def adr_5 = (r1 + r2 + r3 + r4 + r5) / 5;

def hl1 = (open + (adr_10 / 2));
def ll1 = (open - (adr_10 / 2));
def hl2 = (open + (adr_5 / 2));
def ll2 = (open - (adr_5 / 2));

def h1 = hl1;
def l1 = ll1;
def h2 = hl2;
def l2 = ll2;

AddCloud(h1, h2, Color.RED, Color.RED);
AddCloud(l1, l2, Color.GREEN, Color.GREEN);

#h1.SetDefaultColor(Color.dark_red);
#h2.SetDefaultColor(Color.DARK_RED);
#l1.SetDefaultColor(Color.dark_green);
#l2.SetDefaultColor(Color.dark_green);

#Edited By Playstation 23.05.2020
#You can set whether to show the bubbles. Change or add the h1,h2,l1,l2 values to your preference.

input showBubble = yes;
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

#This will show the price at the support and resistance levels.
#AddChartBubble(SR,h2,Concat("R: ",Round(h2)),Color.RED);
#AddChartBubble(SR,l2,Concat("S: ",Round(l2)),Color.GREEN);

#Swap hashtags if you want just the Resistance/Support words.
#AddChartBubble(SR, h2, "DAILY RESISTANCE", Color.RED);
#AddChartBubble(SR, l2, "DAILY SUPPORT", Color.GREEN);

#Edited By Playstation 26.05.2020
#Added Labels to indicate request of adding labels to show price when breakabove resistance or below support.
AddLabel(yes, if close > h1 == yes then "Prior Daily Resistance May Become Support" else "", color.YELLOW);
AddLabel(yes, if close < l1 == yes then "Prior Daily Support May Become Resistance" else "", color.YELLOW);
Thanks Christopher
 
LOL The solution is to discriminate against the buy signals if the stock is trending down. If you made the 7 day moving average have to be above the 50 days MA before a valid Buy signal was allowed or something like that so the stock must be in an uptrend condition. But some people like to catch a falling knife. I personally use to buy in 3 waves. 20% first, 30% second and if it fell more 50% so i would dollar cost down but that doesn't always work
I have tried an idea similar to that a few weeks back using the channel slope with poor results. I think I may have an interesting solution. Did you notice the red and green clouds that appear on my chart? They are showing high probability reversal zones. The interesting thing is that price almost always revisits these zones quickly which minimizes loss on false signals. It also produces higher quality signals in general.
 
I have been using an ATR channel script with success but I'll load that up for sure.

#channel with ATR
input price = close;
input length = 65;
input atrmod=2;
def bn = barnumber();
def lastBar = highestall(if isnan(close) then 0 else bn);
def offset = bn - lastbar;
plot MiddleLR = InertiaAll(price, length);
def dist = getvalue(ATR(length),offset);
plot UpperLR = MiddleLR + atrmod*dist;
plot LowerLR = MiddleLR - atrmod*dist;
 
Whatcha think about some form of this code to validate a stock is in an uptrend. Almost like a master on/off to buy. This plots a 50 day and a 100 day moving over the 200 day MA but it could be finer toned then that. Just a thought.
Code:
Code:
#

#-----------------------------------------------------------------------
declare lower;

input fastLengthV = 15;
input slowLengthV = 40;
input MACDLengthV = 9;
input averageTypeV = AverageType.EXPONENTIAL;

def    fastAvgV = MovingAverage(averageTypeV, close, fastLengthV);
def    slowAvgV = MovingAverage(averageTypeV, close, slowLengthV);

def MacdValue = (fastAvgV - slowAvgV) * 100;


input price = close;
input length8 = 5;
input length14 = 14;
input length50 = 50;
input length100 = 100;
input length200 = 200;
input displace = 0;
input showBreakoutSignals = no;
input crossingType = {default above, below};

def AvgExp = ExpAverage(price[-displace], length8);
def AvgExp14 = ExpAverage(price[-displace], length14);
def AvgExp50 = ExpAverage(price[-displace], length50);
def AvgExp100 = ExpAverage(price[-displace], length100);
def AvgExp200 = ExpAverage(price[-displace], length200);
def EMASELL2 = 1 - ( AvgExp > AvgExp50 );
def EMABULL2 = ( AvgExp > AvgExp50 ) ;
def EMABULL3 = (AvgExp > AvgExp14 and AvgExp > AvgExp50 and AvgExp14 > AvgExp50) ;

def EMABULL50200 = ( AvgExp50 > AvgExp200 ) ;
def EMABULL100200 = ( AvgExp100 > AvgExp200 ) ;


plot signal2 = EMABULL50200;
plot signal3 = EMABULL100200;
#end code
I’ll check this out over the weekend. Looks interesting.
 

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
527 Online
Create Post

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