Candlestick Wick Quality For ThinkOrSwim

fungus12

Member
I have an idea for an indicator but I have no idea how to go about implementing it, so I figured I'd throw out the idea and if anyone seemed interested maybe they could give it a shot and help me implement it. So the idea is for an indicator to give you signals based on the candlestick quality of the previous x number of candles including the current one.

To give you an idea of what I mean by "quality", take bullish candles for example. If the candle has a long lower wick relative to the body, I would consider that very poor. If it has a medium sized lower wick, I would consider that weak. If the lower wick is tiny I would consider that relatively good. The same works with the upper wicks on bullish candles, and you would have to factor both. For example if a candle has a long upper and lower wick then it would be a very poor quality candle (not referring to doji candles). The same logic works for bearish candles but backwards.

As for the signals themselves, for the "previous x candles" part of it, maybe it would take the average quality of the past candles and it would be plotted on a lower study perhaps separated by a certain number of levels like -2 for very poor, -1 for poor, 0 for average, 1 for good, 2 for great. It would look something like this: red being very poor, orange being poor, etc.

Also for the upper chart it could have colored dots beneath each candle, with each color representing a different candle strength. That's essentially the idea I have. Why I like the idea is because you can't really rely on indicators purely to trade, you kind of have to take into account price action and look at what the candles are doing. This in a roundabout way automates that in the form of an indicator. It's not the entire picture but I personally look at candle quality before I enter any trade. Please share your thoughts.

Last edited:
here is a study that can be a starting point.
enter 3 numbers, percentages of bodyheight, used to compare against wick heights (short, med, long)
calculate the body height , yellow bubble
calculate the wick heights, and wick % of bodyheight
compares wick % and assign a number , 1 to 4, to each wick
display the numbers in bubbles, above and below the candles

next steps ?
verify the numbers assigned (1 to 4). just realized i didn't assign any negative numbers.
come up with a way to combine the top wick number and bottom wick number.

Ruby:
``````# wicklenration_01

# % of body length
input shortwick_per = 10;
input mediumwick_per = 50;
input longwick_per = 100;

def bull = close > open;

# calc factors of body
# short
#def wicks = (shortwick_per/100) * bodyheight();
# med
#def wickm = (mediumwick_per/100) * bodyheight();
# long
#def wickl = (longwick_per/100) * bodyheight();

# candle stats
def CandleBodyTop = MidBodyVal() + 0.5 * BodyHeight();
def CandleBodyBottom = MidBodyVal() - 0.5 * BodyHeight();

def topwick = high - CandleBodyTop;
def botwick = CandleBodyBottom - low;

def topwickper = round(100*topwick/ bodyheight(),1);
def botwickper = round(100*botwick/ bodyheight(),1);

def topwicknum;
def botwicknum;
if bull then {
topwicknum = if topwickper < shortwick_per then 1 else if topwickper < mediumwick_per then 2 else if topwickper < longwick_per then 3 else 4;
botwicknum = if botwickper < shortwick_per then 4 else if botwickper < mediumwick_per then 3 else if botwickper < longwick_per then 2 else 1;
} else {
topwicknum = if topwickper < shortwick_per then 4 else if topwickper < mediumwick_per then 3 else if topwickper < longwick_per then 2 else 1;
botwicknum = if botwickper < shortwick_per then 1 else if botwickper < mediumwick_per then 2 else if botwickper < longwick_per then 3 else 4;
};

addchartbubble(1, high, topwick + "\n" + topwickper + "%" + "\n#: " + topwicknum, color.cyan, yes);
addchartbubble(1, low, botwick + "\n" + botwickper + "%" + "\n#: " + botwicknum , color.cyan, no);
#``````

here is a study that can be a starting point.
enter 3 numbers, percentages of bodyheight, used to compare against wick heights (short, med, long)
calculate the body height , yellow bubble
calculate the wick heights, and wick % of bodyheight
compares wick % and assign a number , 1 to 4, to each wick
display the numbers in bubbles, above and below the candles

next steps ?
verify the numbers assigned (1 to 4). just realized i didn't assign any negative numbers.
come up with a way to combine the top wick number and bottom wick number.

Ruby:
``````# wicklenration_01

# % of body length
input shortwick_per = 10;
input mediumwick_per = 50;
input longwick_per = 100;

def bull = close > open;

# calc factors of body
# short
#def wicks = (shortwick_per/100) * bodyheight();
# med
#def wickm = (mediumwick_per/100) * bodyheight();
# long
#def wickl = (longwick_per/100) * bodyheight();

# candle stats
def CandleBodyTop = MidBodyVal() + 0.5 * BodyHeight();
def CandleBodyBottom = MidBodyVal() - 0.5 * BodyHeight();

def topwick = high - CandleBodyTop;
def botwick = CandleBodyBottom - low;

def topwickper = round(100*topwick/ bodyheight(),1);
def botwickper = round(100*botwick/ bodyheight(),1);

def topwicknum;
def botwicknum;
if bull then {
topwicknum = if topwickper < shortwick_per then 1 else if topwickper < mediumwick_per then 2 else if topwickper < longwick_per then 3 else 4;
botwicknum = if botwickper < shortwick_per then 4 else if botwickper < mediumwick_per then 3 else if botwickper < longwick_per then 2 else 1;
} else {
topwicknum = if topwickper < shortwick_per then 4 else if topwickper < mediumwick_per then 3 else if topwickper < longwick_per then 2 else 1;
botwicknum = if botwickper < shortwick_per then 1 else if botwickper < mediumwick_per then 2 else if botwickper < longwick_per then 3 else 4;
};

addchartbubble(1, high, topwick + "\n" + topwickper + "%" + "\n#: " + topwicknum, color.cyan, yes);
addchartbubble(1, low, botwick + "\n" + botwickper + "%" + "\n#: " + botwicknum , color.cyan, no);
#``````

Wow great work dude, and thanks for the response! I'll definitely tinker with this over the weekend.

Not the exact question you're looking for?

87k+ Posts
394 Online

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?