Advanced Pivot Point Indicator

woulf1004

Active member
VIP
Hi Team,

I will really appreciate if someone can create an indicator that plots the current day pivot point value as a horizontal line with the option to also plot a second indicator that represents the previous day close with a cloud in between them? and please make sure the colors and styles for each plot can be adjusted and modified via edit studies in the TOS tick chart with the choice of show on expansion or show today only as well.
I look forward to hear from you soon.

Thanks.

I will highly appreciate if someone can help put this together please. Thanks
 
Solution
I will highly appreciate if someone can help put this together please. Thanks

This should work

Screenshot 2024-02-17 092934.png
Code:
input showOnExpansion  = no;
input showprevdayclose = yes;
input clouds           = yes;
input bubbles          = yes;
input bubblemover      = 3;
def   mover = bubbles and isnan(close[bubblemover]) and !isnan(close[bubblemover + 1]);

plot pivotpoints  = if showOnExpansion and !IsNaN(close) then Double.NaN else SVEPivots().PP;
plot prevdayclose = if !showprevdayclose or showOnExpansion and !IsNaN(close) then Double.NaN else close(period = AggregationPeriod.DAY)[1];

pivotpoints.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
pivotpoints.DefineColor("PP", color.cyan)...
I will highly appreciate if someone can help put this together please. Thanks

This should work

Screenshot 2024-02-17 092934.png
Code:
input showOnExpansion  = no;
input showprevdayclose = yes;
input clouds           = yes;
input bubbles          = yes;
input bubblemover      = 3;
def   mover = bubbles and isnan(close[bubblemover]) and !isnan(close[bubblemover + 1]);

plot pivotpoints  = if showOnExpansion and !IsNaN(close) then Double.NaN else SVEPivots().PP;
plot prevdayclose = if !showprevdayclose or showOnExpansion and !IsNaN(close) then Double.NaN else close(period = AggregationPeriod.DAY)[1];

pivotpoints.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
pivotpoints.DefineColor("PP", color.cyan);
prevdayclose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
prevdayclose.DefineColor("PC", color.magenta);

defineGlobalColor("Clouds", color.gray);
addcloud(if !clouds then double.nan else pivotpoints, prevdayclose, globalColor("Clouds"), globalColor("Clouds"));

addchartBubble(bubbles and mover, pivotpoints, "PP", pivotpoints.takevalueColor());
addchartBubble(bubbles and mover, prevdayclose, "PC", prevdayclose.takevalueColor());

#
 
Solution
This is awesome SleepyZ!!
Can you please modify it so each plot does not show on expansion? including the bubbles.
I would like to keep the expansion side clean so I can use other tools.
This is now defaulted to not show clouds or not show on expansion.

Screenshot 2024-02-21 051721.png


input Plots = {default "Bar Area", "Bars/Expansion", "Expansion Only"};
input showprevdayclose = yes;
input clouds = yes;
input bubbles = yes;
input bubblemover = 0;
def mover = bubbles and IsNaN(close[bubblemover]) and !IsNaN(close[bubblemover + 1]);
def na = double.nan;

plot pivotpoints = if Plots == Plots."Expansion Only" and !IsNaN(close) then na
else if Plots == Plots."Bar Area" and IsNaN(close) then na
else SVEPivots().PP;
plot prevdayclose = if !showprevdayclose then na
else if Plots == Plots."Expansion Only" and !IsNaN(close) then na
else if Plots == Plots."Bar Area" and IsNaN(close) then na
else close(period = AggregationPeriod.DAY)[1];

pivotpoints.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
pivotpoints.DefineColor("PP", Color.CYAN);
prevdayclose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
prevdayclose.DefineColor("PC", Color.MAGENTA);

#Clouds
DefineGlobalColor("Clouds", Color.GRAY);
AddCloud(if !clouds then Double.NaN else pivotpoints, prevdayclose, GlobalColor("Clouds"), GlobalColor("Clouds"));

#Bubbles
AddChartBubble(bubbles and pivotpoints != pivotpoints[-1], pivotpoints, "PP", pivotpoints.TakeValueColor());
AddChartBubble(bubbles and prevdayclose != prevdayclose[-1], prevdayclose, "PC", prevdayclose.TakeValueColor());

#Last Bubbles and can be moved by bubblemover input
AddChartBubble(if Plots == Plots."Bars/Expansion" then Double.NaN else bubbles and mover, pivotpoints[bubblemover + 1], "PP", pivotpoints.TakeValueColor());
AddChartBubble(if Plots == Plots."Bars/Expansion" then Double.NaN else bubbles and mover, prevdayclose[bubblemover + 1], "PC", prevdayclose
.TakeValueColor());

#
 
Last edited:

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