Confirmation Candles Indicator For ThinkorSwim

Thank you very much for your hard work and help. I just knew about the indicators yesterday and trying to read every post to understand the whole idea. So I will make you headache with some questions, we have 2 indicators one is the confirmation candles and 2nd is Consensus Confirmation Candles. Do arrows repaint? And confirmation factor calculates how many indicators? Can I use the consensus candles only or should be together with confirmation candles? How do they perform for daily charts?

Again very sorry to ask many
Hi @tem2005,
None of my indicators repaint. I find indicators that repaint to be virtually useless. The Confirmation Factor calculates how many indicators are in agreement on the trend direction. I personally use the Consensus Candles. They will work well on any time frame. Hope this helps!
 

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

@Trader Raider thank you for taking the time to share your scanner, though I suspect I'll be using @Christopher84's scanner more since it meets my needs more specifically, i do like the thought process and I am going to experiment with it to see if I can use it in conjunction with what Christopher has provided to fine tune it even further.

@Christopher84 thank you for your quick response and your brilliant code work as always, I setup scanners for both oversold and overbought candidates and I have already a couple of candidates which look very interesting. Thank you for the effort you take to keep helping everyone. Really appreciated


For those who are interested in my scanner setup, this is what it looks like

oQSQjy1.png

This is for the overbought scan


AK5yYlu.png


This is for the oversold scan

@Christopher84 Have a quick question on the watchlist column, i understand red is overbought and green is oversold, what does the size of the number mean, for example if its red and 250 vs red and 100, does it mean the red with 250 is the more overbought one ?
 
Last edited:
@Trader Raider thank you for taking the time to share your scanner, though I suspect I'll be using @Christopher84's scanner more since it meets my needs more specifically, i do like the thought process and I am going to experiment with it to see if I can use it in conjunction with what Christopher has provided to fine tune it even further.

@Christopher84 thank you for your quick response and your brilliant code work as always, I setup scanners for both oversold and overbought candidates and I have already a couple of candidates which look very interesting. Thank you for the effort you take to keep helping everyone. Really appreciated


For those who are interested in my scanner setup, this is what it looks like

oQSQjy1.png

This is for the overbought scan


AK5yYlu.png


This is for the oversold scan

@Christopher84 Have a quick question on the watchlist column, i understand red is overbought and green is oversold, what does the size of the number mean, for example if its red and 250 vs red and 100, does it mean the red with 250 is the more overbought one ?
Hi @alexsmith3546,
The watchlist column requires one plot to be specified. In this case, I used the 20 sma. So the number displayed in the cell in is the 20 sma.
 
Hey @Christopher84 , I have found your indicator very useful as I have continued to fine tune trading with it. For me I have removed everything except the candle color and ichimoku cloud. I pair that with another cloud system of EMA's I use and volume, and that's all I need.

For me I am looking for red to green consensus candles on momentum stocks. This has been giving me great dip buy opportunities when paired with volume and support zones.

What I really need is a scan. I can't watch everything at once, and since I'm a day trader getting the best entries is essential or I have to let the trade go.

Is it possible to create a scan that would show when there is green candle following a red candle for a chosen timeframe?

I may add in another condition, but what I need to see for the Consensus Confirmation candles is a green candle forming after a red candle.

If I could scan my daily watchlist or the top gainers list for a red to green candle with your consensus candles indicator that would be perfect.
 
Hey @Christopher84 , I have found your indicator very useful as I have continued to fine tune trading with it. For me I have removed everything except the candle color and ichimoku cloud. I pair that with another cloud system of EMA's I use and volume, and that's all I need.

For me I am looking for red to green consensus candles on momentum stocks. This has been giving me great dip buy opportunities when paired with volume and support zones.

What I really need is a scan. I can't watch everything at once, and since I'm a day trader getting the best entries is essential or I have to let the trade go.

Is it possible to create a scan that would show when there is green candle following a red candle for a chosen timeframe?

I may add in another condition, but what I need to see for the Consensus Confirmation candles is a green candle forming after a red candle.

If I could scan my daily watchlist or the top gainers list for a red to green candle with your consensus candles indicator that would be perfect.
Almost forgot! The other condition I look for is that price should be above the ichimoku cloud. That will keep you out of some bad trades.
 
Hey @Christopher84 , I have found your indicator very useful as I have continued to fine tune trading with it. For me I have removed everything except the candle color and ichimoku cloud. I pair that with another cloud system of EMA's I use and volume, and that's all I need.

For me I am looking for red to green consensus candles on momentum stocks. This has been giving me great dip buy opportunities when paired with volume and support zones.

What I really need is a scan. I can't watch everything at once, and since I'm a day trader getting the best entries is essential or I have to let the trade go.

Is it possible to create a scan that would show when there is green candle following a red candle for a chosen timeframe?

I may add in another condition, but what I need to see for the Consensus Confirmation candles is a green candle forming after a red candle.

If I could scan my daily watchlist or the top gainers list for a red to green candle with your consensus candles indicator that would be perfect.
Hi @sparhawk,
Here is the code to help find green candles. This can also be used to find red candles. Create a study with the code below then reference the study in your scan query.
Code:
#Confirmation Level Scan created 06/09/2021 by Christopher84
#Select the level of agreement among the 15 indicators included.

#MACD with Price
declare lower;
def price = close;
def fastLength = 12;
def slowLength = 26;
def MACDLength = 9;
input MACD_AverageType = {SMA, default EMA};
def MACDLevel = 0.0;

def fastEMA = ExpAverage(price, fastLength);
def slowEMA = ExpAverage(price, slowLength);
def Value;
def Avg;

switch (MACD_AverageType) {
case SMA:
    Value = Average(price, fastLength) - Average(price, slowLength);
    Avg = Average(Value, MACDLength);
case EMA:
    Value = fastEMA - slowEMA;
    Avg = ExpAverage(Value, MACDLength);}
def Diff = Value - Avg;
def Level = MACDLevel;

def condition1 = Value[1] <= Value;

#RSI
input RSI_length = 14;
input RSI_AverageType = AverageType.WILDERS;

def NetChgAvg = MovingAverage(RSI_AverageType, price - price[1], RSI_length);
def TotChgAvg = MovingAverage(RSI_AverageType, AbsValue(price - price[1]), RSI_length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);

def condition2 = (RSI[3] < RSI) is true or (RSI >= 80) is true;

#MFI
input MFI_Length = 14;
def MFIover_Sold = 20;
def MFIover_Bought = 80;
def movingAvgLength = 1;
def MoneyFlowIndex = Average(moneyflow(high, close, low, volume, MFI_Length), movingAvgLength);
def MFIOverBought = MFIover_Bought;
def MFIOverSold = MFIover_Sold;

def condition3 = (MoneyFlowIndex[2] < MoneyFlowIndex) is true or (MoneyFlowIndex > 85) is true;

#Forecast
def na = Double.NaN;
def MidLine = 50;
def Momentum = MarketForecast().Momentum;
def NearT =  MarketForecast().NearTerm;
def Intermed = MarketForecast().Intermediate;
def FOB = 80;
def FOS = 20;
def upperLine = 110;

def condition4 = (Intermed[1] <= Intermed) or (NearT >= MidLine);

#Change in Price
def lengthCIP = 5;
def displace = 0;
def CIP = (price - price[1]);
def AvgCIP = ExpAverage(CIP[-displace], lengthCIP);
def CIP_UP = AvgCIP > AvgCIP[1];
def CIP_DOWN = AvgCIP < AvgCIP[1];

def condition5 = CIP_UP;

#EMA_1
input EMA_length = 12;
def AvgExp = ExpAverage(price[-displace], EMA_length);

def condition6 = (price >= AvgExp) and (AvgExp[2] <= AvgExp);

#EMA_2
input EMA_2length = 20;
def displace2 = 0;
def AvgExp2 = ExpAverage(price[-displace2], EMA_2length);

def condition7 = (price >= AvgExp2) and (AvgExp2[2] <= AvgExp2);

#DMI Oscillator
input DMI_length = 5;
input averageType = AverageType.WILDERS;

def diPlus = DMI(DMI_length, averageType)."DI+";
def diMinus = DMI(DMI_length, averageType)."DI-";

def Osc = diPlus - diMinus;
def Hist = Osc;
def ZeroLine = 0;

def condition8 = Osc >= ZeroLine;

#Trend_Periods
input TP_fastLength = 3;
input TP_slowLength = 4;

def Periods = sign(ExpAverage(close, TP_fastLength) - ExpAverage(close, TP_slowLength));

def condition9 = Periods > 0;

#Polarized Fractal Efficiency
input PFE_length = 5;
input smoothingLength = 2.5;

def PFE_diff = close - close[PFE_length - 1];
def val = 100 * Sqrt(Sqr(PFE_diff) + Sqr(PFE_length)) / sum(Sqrt(1 + Sqr(close - close[1])), PFE_length - 1);

def PFE = ExpAverage(if PFE_diff > 0 then val else -val, smoothingLength);
def UpperLevel = 50;
def LowerLevel = -50;

def condition10 = PFE > ZERoLine;

#Bollinger Bands PercentB
input BBPB_averageType = AverageType.Simple;
input BBPB_length = 20;
def Num_Dev_Dn = -2.0;
def Num_Dev_up = 2.0;

def upperBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).UpperBand;
def lowerBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).LowerBand;

def PercentB = (price - lowerBand) / (upperBand - lowerBand) * 100;
def HalfLine = 50;
def UnitLine = 100;

def condition11 = PercentB > 50;

#STARC Bands
def ATR_length = 15;
def SMA_lengthS = 6;
def multiplier_factor = 1.25;
def valS = Average(price, SMA_lengthS);
def average_true_range = Average(TrueRange(high, close, low), length = ATR_length);
def Upper_BandS = valS[-displace] + multiplier_factor * average_true_range[-displace];
def Middle_BandS = valS[-displace];
def Lower_BandS = valS[-displace] - multiplier_factor * average_true_range[-displace];

def condition12 = (Upper_BandS[1] <= Upper_BandS) and (Lower_BandS[1] <= Lower_BandS);

#Projection Oscillator
def ProjectionOsc_length = 30;#Typically 10
def MaxBound = HighestWeighted(high, ProjectionOsc_length, LinearRegressionSlope(price = high, length = ProjectionOsc_length));
def MinBound = LowestWeighted(low, ProjectionOsc_length, LinearRegressionSlope(price = low, length = ProjectionOsc_length));
def ProjectionOsc_diff = MaxBound - MinBound;
def PROSC = if ProjectionOsc_diff != 0 then 100 * (close - MinBound) / ProjectionOsc_diff else 0;
def PROSC_OB = 80;
def PROSC_OS = 20;

def condition13 = (PROSC > 50);

#Trend Confirmation
#Confirmation_Factor range 1-13.
plot Confirmation_Factor = 7;
#Use for testing conditions individually.
#def Agreement_Level = condition1;
plot Agreement_Level = condition1 + condition2 + condition3 + condition4 + condition5 + condition6 + condition7 + condition8 + condition9 + condition10 + condition11 + condition12 + condition13;

plot UpArrow = Agreement_Level crosses above Confirmation_Factor;
plot DownArrow = Agreement_Level crosses below Confirmation_Factor;
Here are the scan settings for finding transitions to green candles. I would suggest running it on a specific watchlist or possibly the weeklys. If this you scan all stocks, the scan may time out on you. Hope this helps.
SlBtMHz.png
 
Last edited:
Hi @sparhawk,
Here is the code to help find green candles. This can also be used to find red candles. Create a study with the code below then reference the study in your scan query.
Code:
#Confirmation Level Scan created 06/09/2021 by Christopher84
#Select the level of agreement among the 15 indicators included.

#MACD with Price
declare lower;
def price = close;
def fastLength = 12;
def slowLength = 26;
def MACDLength = 9;
input MACD_AverageType = {SMA, default EMA};
def MACDLevel = 0.0;

def fastEMA = ExpAverage(price, fastLength);
def slowEMA = ExpAverage(price, slowLength);
def Value;
def Avg;

switch (MACD_AverageType) {
case SMA:
    Value = Average(price, fastLength) - Average(price, slowLength);
    Avg = Average(Value, MACDLength);
case EMA:
    Value = fastEMA - slowEMA;
    Avg = ExpAverage(Value, MACDLength);}
def Diff = Value - Avg;
def Level = MACDLevel;

def condition1 = Value[1] <= Value;

#RSI
input RSI_length = 14;
input RSI_AverageType = AverageType.WILDERS;

def NetChgAvg = MovingAverage(RSI_AverageType, price - price[1], RSI_length);
def TotChgAvg = MovingAverage(RSI_AverageType, AbsValue(price - price[1]), RSI_length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);

def condition2 = (RSI[3] < RSI) is true or (RSI >= 80) is true;

#MFI
input MFI_Length = 14;
def MFIover_Sold = 20;
def MFIover_Bought = 80;
def movingAvgLength = 1;
def MoneyFlowIndex = Average(moneyflow(high, close, low, volume, MFI_Length), movingAvgLength);
def MFIOverBought = MFIover_Bought;
def MFIOverSold = MFIover_Sold;

def condition3 = (MoneyFlowIndex[2] < MoneyFlowIndex) is true or (MoneyFlowIndex > 85) is true;

#Forecast
def na = Double.NaN;
def MidLine = 50;
def Momentum = MarketForecast().Momentum;
def NearT =  MarketForecast().NearTerm;
def Intermed = MarketForecast().Intermediate;
def FOB = 80;
def FOS = 20;
def upperLine = 110;

def condition4 = (Intermed[1] <= Intermed) or (NearT >= MidLine);

#Change in Price
def lengthCIP = 5;
def displace = 0;
def CIP = (price - price[1]);
def AvgCIP = ExpAverage(CIP[-displace], lengthCIP);
def CIP_UP = AvgCIP > AvgCIP[1];
def CIP_DOWN = AvgCIP < AvgCIP[1];

def condition5 = CIP_UP;

#EMA_1
input EMA_length = 12;
def AvgExp = ExpAverage(price[-displace], EMA_length);

def condition6 = (price >= AvgExp) and (AvgExp[2] <= AvgExp);

#EMA_2
input EMA_2length = 20;
def displace2 = 0;
def AvgExp2 = ExpAverage(price[-displace2], EMA_2length);

def condition7 = (price >= AvgExp2) and (AvgExp2[2] <= AvgExp2);

#DMI Oscillator
input DMI_length = 5;
input averageType = AverageType.WILDERS;

def diPlus = DMI(DMI_length, averageType)."DI+";
def diMinus = DMI(DMI_length, averageType)."DI-";

def Osc = diPlus - diMinus;
def Hist = Osc;
def ZeroLine = 0;

def condition8 = Osc >= ZeroLine;

#Trend_Periods
input TP_fastLength = 3;
input TP_slowLength = 4;

def Periods = sign(ExpAverage(close, TP_fastLength) - ExpAverage(close, TP_slowLength));

def condition9 = Periods > 0;

#Polarized Fractal Efficiency
input PFE_length = 5;
input smoothingLength = 2.5;

def PFE_diff = close - close[PFE_length - 1];
def val = 100 * Sqrt(Sqr(PFE_diff) + Sqr(PFE_length)) / sum(Sqrt(1 + Sqr(close - close[1])), PFE_length - 1);

def PFE = ExpAverage(if PFE_diff > 0 then val else -val, smoothingLength);
def UpperLevel = 50;
def LowerLevel = -50;

def condition10 = PFE > ZERoLine;

#Bollinger Bands PercentB
input BBPB_averageType = AverageType.Simple;
input BBPB_length = 20;
def Num_Dev_Dn = -2.0;
def Num_Dev_up = 2.0;

def upperBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).UpperBand;
def lowerBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).LowerBand;

def PercentB = (price - lowerBand) / (upperBand - lowerBand) * 100;
def HalfLine = 50;
def UnitLine = 100;

def condition11 = PercentB > 50;

#STARC Bands
def ATR_length = 15;
def SMA_lengthS = 6;
def multiplier_factor = 1.25;
def valS = Average(price, SMA_lengthS);
def average_true_range = Average(TrueRange(high, close, low), length = ATR_length);
def Upper_BandS = valS[-displace] + multiplier_factor * average_true_range[-displace];
def Middle_BandS = valS[-displace];
def Lower_BandS = valS[-displace] - multiplier_factor * average_true_range[-displace];

def condition12 = (Upper_BandS[1] <= Upper_BandS) and (Lower_BandS[1] <= Lower_BandS);

#Projection Oscillator
def ProjectionOsc_length = 30;#Typically 10
def MaxBound = HighestWeighted(high, ProjectionOsc_length, LinearRegressionSlope(price = high, length = ProjectionOsc_length));
def MinBound = LowestWeighted(low, ProjectionOsc_length, LinearRegressionSlope(price = low, length = ProjectionOsc_length));
def ProjectionOsc_diff = MaxBound - MinBound;
def PROSC = if ProjectionOsc_diff != 0 then 100 * (close - MinBound) / ProjectionOsc_diff else 0;
def PROSC_OB = 80;
def PROSC_OS = 20;

def condition13 = (PROSC > 50);

#Trend Confirmation
#Confirmation_Factor range 1-13.
plot Confirmation_Factor = 7;
#Use for testing conditions individually.
#def Agreement_Level = condition1;
plot Agreement_Level = condition1 + condition2 + condition3 + condition4 + condition5 + condition6 + condition7 + condition8 + condition9 + condition10 + condition11 + condition12 + condition13;

plot UpArrow = Agreement_Level crosses above Confirmation_Factor;
plot DownArrow = Agreement_Level crosses below Confirmation_Factor;
Here are the scan settings for finding transitions to green candles. I would suggest running it on a specific watchlist or possibly the weeklys. If this you scan all stocks, the scan may time out on you. Hope this helps.
SlBtMHz.png
Hey @Christopher84, really appreciate your help on the scan. I created the study and tried running some scans, but I'm not getting any results back even after changing the "within bars" setting to 3 bars to try and capture a result.

Is there something I am missing? I'm assuming that this scan should work even during the weekend when the market is not live.

Thanks again.
 
Hey @Christopher84, really appreciate your help on the scan. I created the study and tried running some scans, but I'm not getting any results back even after changing the "within bars" setting to 3 bars to try and capture a result.

Is there something I am missing? I'm assuming that this scan should work even during the weekend when the market is not live.

Thanks again.
Hi @sparhawk ,
Can you tell me what aggregation period you are scanning? Also, are you scanning all stocks or a specific watchlist? The only trouble I have had is if my search was too broad (all stocks with Day as the aggregation period) in which case TOS times out.
 
Hi @sparhawk ,
Can you tell me what aggregation period you are scanning? Also, are you scanning all stocks or a specific watchlist? The only trouble I have had is if my search was too broad (all stocks with Day as the aggregation period) in which case TOS times out.
Hey @Christopher84, I have tried scanning both smaller watchlists as well as multiple public lists and it always times out very quickly with no results regardless of what aggregation period I choose.

I have set up these types of scans before so I can't figure out what I could be doing wrong on this one. The study works fine if I add it to a chart so there is no issue with the code I copied. If it is producing results for you clearly I am doing something wrong, but my settings look identical to what you posted.

Any other ideas?
 
@Christopher84 you can disregard my lost post. I had my aha moment! I realized that my Plot was set to Confirmation Factor instead of Agreement Level so that is why it was producing no results.

That problem is solved so I'm very happy.

I believe this scan is using the code for the Confirmation Candles instead of your Consensus Candles version...is that correct?

If so, do you have the code easily available to show green candles for the Consensus Candles so I could swap it out? I find that the Consensus Candles are working very well for my style of trading in locating good opportunities.

Thanks for all your hard work. You have put together a great indicator and your quick responses are most appreciated. Didn't want to let that go unsaid.
 
Hey @Christopher84, really appreciate your help on the scan. I created the study and tried running some scans, but I'm not getting any results back even after changing the "within bars" setting to 3 bars to try and capture a result.

Is there something I am missing? I'm assuming that this scan should work even during the weekend when the market is not live.

Thanks again.
For RED or shorting a stock what would you use Confirmation level breaks below 7?
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
445 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