Bollinger Bands Pivot Points for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
This indicator plot pivot points based on Bollinger Bands. Useful for finding potential support and resistance.

0QBU7Uj.png

EEZyvfB.png


If your chart gets shrunk after adding the indicator, then left-click on the screen > Chart Scale > untick Fit studies.

thinkScript Code

Code:
# Bollinger Bands Pivot Points
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/OIRD4yQB/

input length = 50;
input mult = 2.0;
input src = close;

def basis = simpleMovingAvg(src, length);
def dev = mult * stdev(src, length);
def upper = basis + dev;
def lower = basis - dev;

def pivot1 = if close[1]>upper[1] and close<upper then close[1] else pivot1[1];
def pivot2 = if close[1]<lower[1] and close> lower then open[1] else pivot2[1];
def pivot3 = if close[1]<upper[1] and close>upper then low else pivot3[1];
def pivot4 = if close[1]>lower[1] and close<lower then high else pivot4[1];

plot line1 = pivot1;
plot line2 = pivot2;
plot line3 = pivot3;
plot line4 = pivot4;

line1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line1.SetDefaultColor(Color.UPTICK);
line1.SetLineWeight(1);
line2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line2.SetDefaultColor(Color.DOWNTICK);
line2.SetLineWeight(1);
line3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line3.SetDefaultColor(Color.CYAN);
line3.SetLineWeight(1);
line4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line4.SetDefaultColor(Color.MAGENTA);
line4.SetLineWeight(1);;
 

Attachments

  • 0QBU7Uj.png
    0QBU7Uj.png
    77.7 KB · Views: 134
  • EEZyvfB.png
    EEZyvfB.png
    87.1 KB · Views: 117

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
419 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