Isolated Pivots Pattern Detector for ThinkorSwim

Wiinii

Member
Identifies Isolated Pivot patterns on your chart as described in A Complete Guide to Volume Price Analysis by Anna Coulling.

EWIt0B5XYAAicGH.png


FzPgPJ3.png


Shared Link: http://tos.mx/3URlRUV (or use code below). Click here for --> Easiest way to load shared links
Code:
# Isolated Pivots by Wiinii
# Version 1.0
#https://usethinkscript.com/threads/isolated-pivots-pattern-detector-for-thinkorswim.14447/

#hint: Detects Isolated Pivots and flags them on your chart. \n big_body_size tells how much taller than average the first tall candle has to be. \n little_body_size tells how many x smaller the middle little candle has to be compared to the intitial tall one.
# Isolated Pivots by Wiinii
# Version 1.0
#https://usethinkscript.com/threads/isolated-pivots-pattern-detector-for-thinkorswim.14447/

#hint: Detects Isolated Pivots and flags them on your chart. \n big_body_size tells how much taller than average the first tall candle has to be. \n little_body_size tells how many x smaller the middle little candle has to be compared to the intitial tall one.

input CandleAverage = 10;
input big_body_size = 1.2;
input little_body_size = 3.0;

def IsUp = close > open;
def IsDown = close < open;
def avgRange = 0.05 * Average(high - low, 20);
def AvgCandleBody = Average(BodyHeight(), CandleAverage);
def AvgCandle = SimpleMovingAvg(price = (high[1] - low[1]), length = CandleAverage);
def CurrentCandle = high - low;

def BigUp = IsUp and ((BodyHeight() > (AvgCandleBody * big_body_size)));
def BigDown = IsDown and ((BodyHeight() > (AvgCandleBody * big_body_size)));
def LittleUp = IsUp and BodyHeight() < BodyHeight()[1] * little_body_size;
def LittleDown = IsDown and BodyHeight() < BodyHeight()[1] * little_body_size;

plot IsoPivUp =
    BigUp[2] and
    (LittleUp[1] or LittleDown[1]) and
    BigDown[0] and (BodyHeight() > BodyHeight()[1] * little_body_size) and
    open[1] > close[0] and
    open[2] < open[1] and
    close[2] <= high[1] and
    open[2] < low[1] and
    low[1] > close[0] and
    high[1] >= open[0] and
    high[1] is equal to Highest(high[1], 2);

IsoPivUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
IsoPivUp.SetDefaultColor(GetColor(1));
IsoPivUp.SetLineWeight(5);

plot IsoPivDn =
     BigDown[2] and
     (LittleUp[1] or LittleDown[1]) and
     BigUp[0] and (BodyHeight() > BodyHeight()[1] * little_body_size) and
     open[2] > open[1] and
     open[2] > high[1] and
     low[1] < open[0] and
     open[1] < close[0] and
     close[2] > low[1] and
     high[1] < close[0] and
     low[1] is equal to Lowest(low[1], 2);

IsoPivDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
IsoPivDn.SetDefaultColor(GetColor(1));
IsoPivDn.SetLineWeight(5);
 
Last edited:
Very Nice work, Thank you for that

can you write a code to use it for a scanner or watchlist, when the current price is near previous pivot high or pivot low for possible retest to keep a closer eye on that.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
286 Online
Create Post

Similar threads

Similar threads

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