Williams % R Crossover Scan, Watchlist, Labels For ThinkOrSwim

Hi community ; does anyone know how to make a WILLIAMS %R WITH DIVERGENCES AND PIVOTS FOR THINK OR SWIM ?
 

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

Hi community ; does anyone know how to make a WILLIAMS %R WITH DIVERGENCES AND PIVOTS FOR THINK OR SWIM ?
"We have not discovered any scripts that can accurately automate the plotting of divergences. The general agreement is that divergences should be examined manually."
 
hello community ! i took as example another indicator and here is the indicator with pivots for williams indicator




# WIILLIAMS%R Divergence
# HECTOROAG
# V1.02_08_2023
input n = 2;
input length = 14;

def h = high;
def l = low;
def bar = BarNumber();
def williams = williamsPercentR(length);

def CurrWilliamsH = if williams > -50

then fold i = 1 to n + 1

with p = 1

while p

do williams > GetValue(williams, -i)

else 0;

def CurrWilliamsPivotH = if (bar > n and

williams == Highest(williams, n) and

CurrWilliamsH)

then h

else Double.NaN;

def CurrWilliamsL = if williams < -50

then fold j = 1 to n + 1

with q = 1

while q

do williams < GetValue(williams, -j)

else 0;

def CurrWilliamsPivotL = if (bar > n and

williams == Lowest(williams, n) and

CurrWilliamsL)

then l

else Double.NaN;

def CurrPWBar = if !IsNaN(CurrWilliamsPivotH)

then bar

else CurrPWBar[1];

def CurrPLBar = if !IsNaN(CurrWilliamsPivotL)

then bar

else CurrPLBar[1];

def PWpoint = if !IsNaN(CurrWilliamsPivotH)

then CurrWilliamsPivotH

else PWpoint[1];

def priorPWBar = if PWpoint != PWpoint[1]

then CurrPWBar[1]

else priorPWBar[1];

def PLpoint = if !IsNaN(CurrWilliamsPivotL)

then CurrWilliamsPivotL

else PLpoint[1];

def priorPLBar = if PLpoint != PLpoint[1]

then CurrPLBar[1]

else priorPLBar[1];

def HighPivots = bar >= HighestAll(priorPWBar);

def LowPivots = bar >= HighestAll(priorPLBar);

def pivotHigh = if HighPivots

then CurrWilliamsPivotH

else Double.NaN;

plot PlotHline = pivotHigh;

PlotHline.EnableApproximation();

PlotHline.SetDefaultColor(GetColor(7));

PlotHline.SetStyle(Curve.SHORT_DASH);

plot pivotLow = if LowPivots

then CurrWilliamsPivotL

else Double.NaN;

pivotLow.EnableApproximation();

pivotLow.SetDefaultColor(GetColor(7));

pivotLow.SetStyle(Curve.SHORT_DASH);

plot PivotDot = if !IsNaN(pivotHigh)

then pivotHigh

else if !IsNaN(pivotLow)

then pivotLow

else Double.NaN;

PivotDot.SetDefaultColor(GetColor(7));

PivotDot.SetPaintingStrategy(PaintingStrategy.POINTS);
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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