Confirmation Candles Indicator For ThinkorSwim

@Christopher84 Do you mind sharing your chart set of the Confirmation CC?

I am using V10 upper and lower, but when I add the Consensus Level with the upper I am getting double. Is the Consensus Level and the Confirmation Level the same information? Could you explain the confirmation Level and Consensus Level again, for example when is it a bullish vs bearish. I watched some Youtube Channels on Consensus Level, but not much concerning trading. I was getting more information about football movements. lol

Thanks again. I apologize for all the questions in advance.


bnMasMD.png

SKt3MRk.png
 
Confirmation Candels MTF labels of the channel color.
Thank @cos251 for this RSM_MTF_Labels code used to make this and @Christopher84 for this indicator.




fvT61Nr.jpg



Code:
#Confirmation Candles MTF Channel Label.

#Thank @cos251 for this RSM_MTF_Labels code used to make this.



input period = AggregationPeriod.DAY;

DefineGlobalColor("UpTrend", Color.Green);
DefineGlobalColor("DownTrend", Color.RED);
DefineGlobalColor("NoTrend", Color.GRAY);

script CC_ {

    input aP = AggregationPeriod.DAY;


    #Keltner Channel

def displace = 0;
def factorK = 2.0;
def lengthK = 20;
def price = close(period = ap);
input averageType = AverageType.SIMPLE;
def trueRangeAverageType = AverageType.SIMPLE;
def BulgeLengthK = 150;
def SqueezeLengthK = 150;
def BulgeLengthK2 = 40;
def SqueezeLengthK2 = 40;
def BulgeLengthPrice = 75;
def SqueezeLengthPrice = 75;
def BulgeLengthPrice2 = 20;
def SqueezeLengthPrice2 = 20;

def shift = factorK * MovingAverage(trueRangeAverageType, TrueRange(high(period = ap), close(period = ap), low(period = ap)), lengthK);
def averageK = MovingAverage(averageType, price, lengthK);
def AvgK = averageK[-displace];
def Upper_BandK = averageK[-displace] + shift[-displace];
def Lower_BandK = averageK[-displace] - shift[-displace];

def conditionK1 = price >= Upper_BandK;
def conditionK2 = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
def conditionK2L = (Upper_BandK[2] < Upper_BandK[1]) and (Lower_BandK[2] < Lower_BandK[1]);
def conditionK3L = (Upper_BandK[3] < Upper_BandK[2]) and (Lower_BandK[3] < Lower_BandK[2]);
def conditionK3 = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
def BandwidthK = (Upper_BandK - Lower_BandK) / AvgK * 100;
def condition_BWKUP = BandwidthK[1] < BandwidthK;
def condition_BWKDOWN = BandwidthK[1] > BandwidthK;
def BulgeK = Highest(BandwidthK, BulgeLengthK);
def SqueezeK = Lowest(BandwidthK, SqueezeLengthK);
def BulgeK2 = Highest(BandwidthK, BulgeLengthK2);
def SqueezeK2 = Lowest(BandwidthK, SqueezeLengthK2);



    #################################################################
    ##########          Trend  & Labels                   #########
    #################################################################
    def UpTrend_ = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
    def DownTrend_ = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
    plot Trend_ = if UpTrend_ then 1 else if DownTrend_ then 0 else -1;

}








def currentPeriod = GetAggregationPeriod();
def CC;

if period >= currentPeriod {
    CC = CC_(aP = period);

} else {
    CC = Double.NaN;

}

AddLabel(!IsNaN(CC), if period == AggregationPeriod.MONTH then "M"
else if period == AggregationPeriod.WEEK then "W"
else if period == AggregationPeriod.FOUR_DAYS then "4D"
else if period == AggregationPeriod.THREE_DAYS then "3D"
else if period == AggregationPeriod.TWO_DAYS then "2D"
else if period == AggregationPeriod.DAY then "D"
else if period == AggregationPeriod.FOUR_HOURS then "4H"
else if period == AggregationPeriod.TWO_HOURS then "2H"
else if period == AggregationPeriod.HOUR then "60m"
else if period == AggregationPeriod.THIRTY_MIN then "30m"
else if period == AggregationPeriod.TWENTY_MIN then "20m"
else if period == AggregationPeriod.FIFTEEN_MIN then "15m"
else if period == AggregationPeriod.TEN_MIN then "10m"
else if period == AggregationPeriod.FIVE_MIN then "5m"
else if period == AggregationPeriod.FOUR_MIN then "4m"
else if period == AggregationPeriod.THREE_MIN then "3m"
else if period == AggregationPeriod.TWO_MIN then "2m"
else if period == AggregationPeriod.MIN then "1m"
else "", if CC == 1 then GlobalColor("UpTrend") else if CC == 0 then GlobalColor("DownTrend") else GlobalColor("NoTrend"));
 
Confirmation Candels MTF labels of the channel color.
Thank @cos251 for this RSM_MTF_Labels code used to make this and @Christopher84 for this indicator.




fvT61Nr.jpg



Code:
#Confirmation Candles MTF Channel Label.

#Thank @cos251 for this RSM_MTF_Labels code used to make this.



input period = AggregationPeriod.DAY;

DefineGlobalColor("UpTrend", Color.Green);
DefineGlobalColor("DownTrend", Color.RED);
DefineGlobalColor("NoTrend", Color.GRAY);

script CC_ {

    input aP = AggregationPeriod.DAY;


    #Keltner Channel

def displace = 0;
def factorK = 2.0;
def lengthK = 20;
def price = close(period = ap);
input averageType = AverageType.SIMPLE;
def trueRangeAverageType = AverageType.SIMPLE;
def BulgeLengthK = 150;
def SqueezeLengthK = 150;
def BulgeLengthK2 = 40;
def SqueezeLengthK2 = 40;
def BulgeLengthPrice = 75;
def SqueezeLengthPrice = 75;
def BulgeLengthPrice2 = 20;
def SqueezeLengthPrice2 = 20;

def shift = factorK * MovingAverage(trueRangeAverageType, TrueRange(high(period = ap), close(period = ap), low(period = ap)), lengthK);
def averageK = MovingAverage(averageType, price, lengthK);
def AvgK = averageK[-displace];
def Upper_BandK = averageK[-displace] + shift[-displace];
def Lower_BandK = averageK[-displace] - shift[-displace];

def conditionK1 = price >= Upper_BandK;
def conditionK2 = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
def conditionK2L = (Upper_BandK[2] < Upper_BandK[1]) and (Lower_BandK[2] < Lower_BandK[1]);
def conditionK3L = (Upper_BandK[3] < Upper_BandK[2]) and (Lower_BandK[3] < Lower_BandK[2]);
def conditionK3 = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
def BandwidthK = (Upper_BandK - Lower_BandK) / AvgK * 100;
def condition_BWKUP = BandwidthK[1] < BandwidthK;
def condition_BWKDOWN = BandwidthK[1] > BandwidthK;
def BulgeK = Highest(BandwidthK, BulgeLengthK);
def SqueezeK = Lowest(BandwidthK, SqueezeLengthK);
def BulgeK2 = Highest(BandwidthK, BulgeLengthK2);
def SqueezeK2 = Lowest(BandwidthK, SqueezeLengthK2);



    #################################################################
    ##########          Trend  & Labels                   #########
    #################################################################
    def UpTrend_ = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
    def DownTrend_ = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
    plot Trend_ = if UpTrend_ then 1 else if DownTrend_ then 0 else -1;

}








def currentPeriod = GetAggregationPeriod();
def CC;

if period >= currentPeriod {
    CC = CC_(aP = period);

} else {
    CC = Double.NaN;

}

AddLabel(!IsNaN(CC), if period == AggregationPeriod.MONTH then "M"
else if period == AggregationPeriod.WEEK then "W"
else if period == AggregationPeriod.FOUR_DAYS then "4D"
else if period == AggregationPeriod.THREE_DAYS then "3D"
else if period == AggregationPeriod.TWO_DAYS then "2D"
else if period == AggregationPeriod.DAY then "D"
else if period == AggregationPeriod.FOUR_HOURS then "4H"
else if period == AggregationPeriod.TWO_HOURS then "2H"
else if period == AggregationPeriod.HOUR then "60m"
else if period == AggregationPeriod.THIRTY_MIN then "30m"
else if period == AggregationPeriod.TWENTY_MIN then "20m"
else if period == AggregationPeriod.FIFTEEN_MIN then "15m"
else if period == AggregationPeriod.TEN_MIN then "10m"
else if period == AggregationPeriod.FIVE_MIN then "5m"
else if period == AggregationPeriod.FOUR_MIN then "4m"
else if period == AggregationPeriod.THREE_MIN then "3m"
else if period == AggregationPeriod.TWO_MIN then "2m"
else if period == AggregationPeriod.MIN then "1m"
else "", if CC == 1 then GlobalColor("UpTrend") else if CC == 0 then GlobalColor("DownTrend") else GlobalColor("NoTrend"));
Nice work!
 
Hello, Not all the MTF labels are showing, only the selected timeframe and if on that particular timeframe, the MTF label shows. Is there any setting which i am missing ?

Thanks for the help.
 
Hello, Not all the MTF labels are showing, only the selected timeframe and if on that particular timeframe, the MTF label shows. Is there any setting which i am missing ?

Thanks for the help.
@diamondhands, to see more than one label, it's necessary to add the indicator more than once. For example, if you're on a 5 min chart and you want to see a 5 min and 30 min label, you need to add the indicator twice and select a 5 min aggregation for one and a 30 min for the other. Also, the indicator will not display labels for a lower timeframe. If you're on a 5 min chart, a 3 min label will not display.

Here's how I get around that problem. I have a 15 min chart on top and a 1 min chart below. On the lower chart, I plot only labels, no candles. This way I can see all timeframe labels regardless of the timeframe I'm trading from on the upper chart. (These are RSM MTF labels but I just checked and it works the same for the Keltner label code posted above.)

Happy Trading!

 
Confirmation Candels MTF labels of the channel color.
Thank @cos251 for this RSM_MTF_Labels code used to make this and @Christopher84 for this indicator.




fvT61Nr.jpg



Code:
#Confirmation Candles MTF Channel Label.

#Thank @cos251 for this RSM_MTF_Labels code used to make this.



input period = AggregationPeriod.DAY;

DefineGlobalColor("UpTrend", Color.Green);
DefineGlobalColor("DownTrend", Color.RED);
DefineGlobalColor("NoTrend", Color.GRAY);

script CC_ {

    input aP = AggregationPeriod.DAY;


    #Keltner Channel

def displace = 0;
def factorK = 2.0;
def lengthK = 20;
def price = close(period = ap);
input averageType = AverageType.SIMPLE;
def trueRangeAverageType = AverageType.SIMPLE;
def BulgeLengthK = 150;
def SqueezeLengthK = 150;
def BulgeLengthK2 = 40;
def SqueezeLengthK2 = 40;
def BulgeLengthPrice = 75;
def SqueezeLengthPrice = 75;
def BulgeLengthPrice2 = 20;
def SqueezeLengthPrice2 = 20;

def shift = factorK * MovingAverage(trueRangeAverageType, TrueRange(high(period = ap), close(period = ap), low(period = ap)), lengthK);
def averageK = MovingAverage(averageType, price, lengthK);
def AvgK = averageK[-displace];
def Upper_BandK = averageK[-displace] + shift[-displace];
def Lower_BandK = averageK[-displace] - shift[-displace];

def conditionK1 = price >= Upper_BandK;
def conditionK2 = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
def conditionK2L = (Upper_BandK[2] < Upper_BandK[1]) and (Lower_BandK[2] < Lower_BandK[1]);
def conditionK3L = (Upper_BandK[3] < Upper_BandK[2]) and (Lower_BandK[3] < Lower_BandK[2]);
def conditionK3 = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
def BandwidthK = (Upper_BandK - Lower_BandK) / AvgK * 100;
def condition_BWKUP = BandwidthK[1] < BandwidthK;
def condition_BWKDOWN = BandwidthK[1] > BandwidthK;
def BulgeK = Highest(BandwidthK, BulgeLengthK);
def SqueezeK = Lowest(BandwidthK, SqueezeLengthK);
def BulgeK2 = Highest(BandwidthK, BulgeLengthK2);
def SqueezeK2 = Lowest(BandwidthK, SqueezeLengthK2);



    #################################################################
    ##########          Trend  & Labels                   #########
    #################################################################
    def UpTrend_ = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
    def DownTrend_ = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
    plot Trend_ = if UpTrend_ then 1 else if DownTrend_ then 0 else -1;

}








def currentPeriod = GetAggregationPeriod();
def CC;

if period >= currentPeriod {
    CC = CC_(aP = period);

} else {
    CC = Double.NaN;

}

AddLabel(!IsNaN(CC), if period == AggregationPeriod.MONTH then "M"
else if period == AggregationPeriod.WEEK then "W"
else if period == AggregationPeriod.FOUR_DAYS then "4D"
else if period == AggregationPeriod.THREE_DAYS then "3D"
else if period == AggregationPeriod.TWO_DAYS then "2D"
else if period == AggregationPeriod.DAY then "D"
else if period == AggregationPeriod.FOUR_HOURS then "4H"
else if period == AggregationPeriod.TWO_HOURS then "2H"
else if period == AggregationPeriod.HOUR then "60m"
else if period == AggregationPeriod.THIRTY_MIN then "30m"
else if period == AggregationPeriod.TWENTY_MIN then "20m"
else if period == AggregationPeriod.FIFTEEN_MIN then "15m"
else if period == AggregationPeriod.TEN_MIN then "10m"
else if period == AggregationPeriod.FIVE_MIN then "5m"
else if period == AggregationPeriod.FOUR_MIN then "4m"
else if period == AggregationPeriod.THREE_MIN then "3m"
else if period == AggregationPeriod.TWO_MIN then "2m"
else if period == AggregationPeriod.MIN then "1m"
else "", if CC == 1 then GlobalColor("UpTrend") else if CC == 0 then GlobalColor("DownTrend") else GlobalColor("NoTrend"));

Awesome, really digging the simplicity of it. Oddly enough, I've grown to using the 7 minute chart for a variety of stocks. Such as but not limited to: DASH, AMZN, and SPY. Is there anyway to include 7m? Is it as simple as copying a line and replacing the integer listed with the one you would like to add?
 
Hi Everyone!
I have just posted the most recent version of the (Consensus Confirmation Candles) C3 v5 on pg.1 of this thread. Notable changes include new method of determining price squeeze and reduction in the number of labels. The text in the labels is more descriptive and hopefully more easily understood. And for anyone who missed the last live discussion, I have scheduled another session this Friday @ 3:00 cst (same place, same time as the previous discussion). I am looking forward to a great discussion! Enjoy!
nOD1krz.png
 
Hi Everyone!
I have just posted the most recent version of the (Consensus Confirmation Candles) C3 v5 on pg.1 of this thread. Notable changes include new method of determining price squeeze and reduction in the number of labels. The text in the labels is more descriptive and hopefully more easily understood. And for anyone who missed the last live discussion, I have scheduled another session this Friday @ 3:00 cst (same place, same time as the previous discussion). I am looking forward to a great discussion! Enjoy!
nOD1krz.png
Thanks so much, @Christopher84 for generously sharing your wonderful work. Do you have a preference to use one over the other? If one is using CCC then CC is not needed, right?
 
Hey @Trader Raider Thank you so much for the kind reply and much appreciated. I have recently started using the Breakout Balanced along with V10 of confirmation candle ( my chart shows confirmation level and not consensus level which i presume are same thing ). However, the signals generated from Balance breakout are far more delayed with delayed exits. I have seen you participating in both the group ( that group is closed now for replies :( so i would want to ask you are you still actively using it and how do you coordinate entries and exits using both ?
 
@Christopher84 I modded 2 of Conformation candles labels ( Momentumup/Down and breakout/ breakdown) so I don't have too many . Here is the code if anyone interested.

def MomentumUP = Agreement_Level[1] < Agreement_Level;
def MomentumDOWN = Agreement_Level[1] > Agreement_Level;

AddLabel(yes, if MomentumUP > MomentumDown then "Increasing Momentum " else "Decreasing Momentum ", if MomentumUP > MomentumDOWN then Color.GREEN else Color.Yellow);


def conditionBO = ((Upper_BandS[1] < Upper_BandS) and (Lower_BandS[1] < Lower_BandS)) and ((Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK));

def conditionBD = ((Upper_BandS[1] > Upper_BandS) and (Lower_BandS[1] > Lower_BandS) and (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK));

AddLabel(yes, if conditionBO > conditionBD then " BREAKOUT " else " BREAKDOWN ", if conditionBO > conditionBD then Color.GREEN else Color.RED);
 
Thanks so much, @Christopher84 for generously sharing your wonderful work. Do you have a preference to use one over the other? If one is using CCC then CC is not needed, right?
I personally prefer C3. It has evolved a bit further than its counterpart. However, the adjustable level on the Confirmation Candles can still be useful.
 
Hey @Trader Raider Thank you so much for the kind reply and much appreciated. I have recently started using the Breakout Balanced along with V10 of confirmation candle ( my chart shows confirmation level and not consensus level which i presume are same thing ). However, the signals generated from Balance breakout are far more delayed with delayed exits. I have seen you participating in both the group ( that group is closed now for replies :( so i would want to ask you are you still actively using it and how do you coordinate entries and exits using both ?
Hi diamondhands,
Sorry to jump in here. Just wanted to clarify the Confirmation Level is in fact different than the Consensus Level. Confirmation Level only considers positive factors of upward price movement whereas the Consensus Level weighs both positive and negative factors against each other to come to a final conclusion on trend. You may want to use the code posted today on pg.1 of this thread for (Consensus Confirmation Candles) C3 v5.
 

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
346 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