Is it possible to create a script based on double topping tails

Solution
As per Oliver Valez video is this possible to create, perhaps a bubble or line

yes

a bubble where? and displays what?
if a line , from where to where?

can find 2 long tail bars. just have to define the limits on the ratios of,
. top wick to bottom wick
..bodyheight to long wick


this could be modified as a starting point... looking at that study, those formulas are too complicated, i will see about making up something
https://usethinkscript.com/threads/pin-bar-reversal-indicator-for-thinkorswim.156/
As per Oliver Valez video is this possible to create, perhaps a bubble or line

yes

a bubble where? and displays what?
if a line , from where to where?

can find 2 long tail bars. just have to define the limits on the ratios of,
. top wick to bottom wick
..bodyheight to long wick


this could be modified as a starting point... looking at that study, those formulas are too complicated, i will see about making up something
https://usethinkscript.com/threads/pin-bar-reversal-indicator-for-thinkorswim.156/
 
Last edited:
Solution

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

As per Oliver Valez video is this possible to create, perhaps a bubble or line


identify pin bars and tail bars

when a pin bar or tail bar is found, a bubble is drawn, with a P or T in it.
if 2 bulls or 2 bears are in a row, then a vertical line is drawn.

i searched a little but didn't find any definite formulas. so i measured a few candles and came up with some ratios.
formulas are based on the ratios of long wick and short wick heights to the body height.

ratios, a wick to body
input pin_shortwick_lower_rng = 0.0;
input pin_shortwick_upper_rng = 1.0;
input pin_longwick_min = 1.9;

if bodyheight is 0, or a wick is 0, then it assigns 0.5 x ticksize as height.


ref
https://www.learntotradethemarket.c...pes-tailed-bar-candlestick-trading-strategies

Code:
#pin_bar_tail_bar

#https://usethinkscript.com/threads/is-it-possible-to-create-a-script-based-on-double-topping-tails.17229/
#Is it possible to create a script based on double topping tails


def t = ticksize();
#addlabel(1, t);
def zero = (t/2);

def ht = high - low;
def body = if BodyHeight() == 0 then zero else bodyheight();
def bodytop = Max(open, close);
def bodybot = Min(open, close);
def wicktop = if (high - bodytop) == 0 then zero else (high - bodytop);
def wickbot = if (bodybot - low)  == 0 then zero else (bodybot - low);

def up = close > open;
def dwn = close < open;

input use_bar_direction = no;


# pin bar - small body
# tail bar - bigger body

def body_ht = body/ht;

# ratios , top wick to bottom wick
def wickt_wickb = wicktop/wickbot;
def wickb_wickt = wickbot/wicktop;

def wick_long_wick_short = max(wicktop, wickbot) / min(wicktop, wickbot);


# use these
# ratios , wick to body
def wickt_body = wicktop/body;
def wickb_body = wickbot/body;

# ratios
#input pin_shortwick_lower_rng = 0.3;
input pin_shortwick_lower_rng = 0.0;
input pin_shortwick_upper_rng = 1.0;
input pin_longwick_min = 1.9;

def tail_shortwick_max = pin_shortwick_lower_rng;
def tail_longwick_upper_rng = pin_longwick_min;
def tail_longwick_lower_rng = pin_shortwick_upper_rng;


def pin_bull = (wickt_body >= pin_shortwick_lower_rng) and (wickt_body <= pin_shortwick_upper_rng) and (wickb_body > pin_longwick_min);
def pin_bear = (wickt_body > pin_longwick_min) and (wickb_body >= pin_shortwick_lower_rng) and (wickb_body <= pin_shortwick_upper_rng);

def tail_bull = (wickt_body <= tail_shortwick_max) and (wickb_body >= tail_longwick_lower_rng) and (wickb_body <= tail_longwick_upper_rng);
def tail_bear = (wickt_body >= tail_longwick_lower_rng) and (wickt_body <= tail_longwick_upper_rng) and (wickb_body <= tail_shortwick_max);


addchartbubble(pin_bull, low, "P", color.green, no);
addchartbubble(pin_bear, high, "P", color.red, yes);

addchartbubble(tail_bull, low, "T", color.green, no);
addchartbubble(tail_bear, high, "T", color.red, yes);


# if 2 in a row, then vert line

def bull_dbl = ((pin_bull[1] and pin_bull[0]) or (pin_bull[1] and tail_bull[0]) or (tail_bull[1] and tail_bull[0]) or (tail_bull[1] and pin_bull[0]));
def bear_dbl = ((pin_bear[1] and pin_bear[0]) or (pin_bear[1] and tail_bear[0]) or (tail_bear[1] and tail_bear[0]) or (tail_bear[1] and pin_bear[0]));

addverticalline(bull_dbl, "Double Bull", color.cyan);
addverticalline(bear_dbl, "Double Bear", color.yellow);


input test1 = no;
input test2_all = no;
addchartbubble((test1 and (pin_bull or tail_bull)), low,
wickt_body + "\n" +
wickb_body
, color.cyan, no);

addchartbubble((test2_all or (test1 and (pin_bear or tail_bear))), high,
wickt_body + "\n" +
wickb_body + "\n" +
wick_long_wick_short + " wL/wS"
, color.yellow, yes);
#


pin bar and tail bars identified
2 in a row has a vertical line
RVutNop.jpg



i measured some candles, put the numbers into excel, and came up with the ratios. then guessed at some number ranges.
JZ0E849.jpg
 
Last edited:

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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