Daily Dynamic Pivot

vsr138173

New member
VIP
Hi,

Is it possible to add single chart bubble for each of the Daily Dynamic pivot points?

I'm getting multiple bubbles instead of 1 chart bubble.

Thanks

Code:
``````# SOURCE: Unknown

# TYPE: Study Trendlines

# CREDITS: Unknown

input timeFrame = {default DAY, WEEK, MONTH};

input showOnlyCurrent = yes;

input DynamicHide = yes;

def h = dynamichide;

input ShowPivots     = YES;

input ShowBubbles = YES;

def NA = Double.NaN;

#

# Define lclose = last completed bar close:

#

rec lclose = if IsNaN(close) then lclose[1] else close;

plot R3;

plot R2;

plot R1;

plot PP;

plot S1;

plot S2;

plot S3;

if (showOnlyCurrent and !IsNaN(close(period = timeFrame)[-1]) or IsNaN(close))

then {

R1 = Double.NaN;

R2 = Double.NaN;

R3 = Double.NaN;

PP = Double.NaN;

S1 = Double.NaN;

S2 = Double.NaN;

S3 = Double.NaN;

} else {

PP = (high(period = timeFrame)[1] + low(period = timeFrame)[1] + close(period=timeframe)[1]) / 3;

R1 = 2 * PP - low(period = timeFrame)[1];

R2 = PP + high(period = timeFrame)[1] - low(period = timeFrame)[1];

R3 = R2 + high(period = timeFrame)[1] - low(period = timeFrame)[1];

S1 = 2 * PP - high(period = timeFrame)[1];

S2 = PP - high(period = timeFrame)[1] + low(period = timeFrame)[1];

S3 = S2 - high(period = timeFrame)[1] + low(period = timeFrame)[1];

}

#

# Formatting:

# Set color, line weight, style and hiding parameters

# for each pivot level

#

PP.SetDefaultColor(color.gray);

pp.SetLineWeight(2);

pp.SetStyle(curve.POINTS);

pp.setHiding(h and (lclose > r2 or lclose < s2));

pp.setpaintingStrategy(paintingStrategy.POINTS);

pp.setHiding();

#

r1.SetDefaultColor(color.red);

r1.SetLineWeight(2);

r1.SetStyle(curve.long_DASH);

r1.setHiding(h and lclose < s1);

r1.setpaintingStrategy(paintingStrategy.POINTS);

#

r2.SetDefaultColor(color.red);

r2.SetLineWeight(3);

r2.SetStyle(curve.long_DASH);

r2.setHiding(h and lclose < r1);

r2.setpaintingStrategy(paintingStrategy.POINTS);

#

r3.SetDefaultColor(color.red);

r3.SetLineWeight(4);

r3.SetStyle(curve.short_DASH);

r3.setHiding(h and lclose < r2);

r3.setpaintingStrategy(paintingStrategy.POINTS);

#

s1.SetDefaultColor(color.GREEN);

s1.SetLineWeight(2);

s1.SetStyle(curve.long_DASH);

s1.setHiding(h and lclose > r1);

s1.setpaintingStrategy(paintingStrategy.POINTS);

#

s2.SetDefaultColor(color.GREEN);

s2.SetLineWeight(3);

s2.SetStyle(curve.long_DASH);

s2.setHiding(h and lclose > s1);

s2.setpaintingStrategy(paintingStrategy.POINTS);

#

s3.SetDefaultColor(color.GREEN);

s3.SetLineWeight(4);

s3.SetStyle(curve.short_DASH);

s3.setHiding(h and lclose > s2);

s3.setpaintingStrategy(paintingStrategy.POINTS);

def std = ROund(s3,2);

addchartBubble(yes,STD, "Daily 3 STD PIVOT_"+STD, COLOR.YELLOW);``````

Last edited by a moderator:
Locate the following line, it should be at the very bottom of your script:

Code:
``addchartBubble(yes,STD, "Daily 3 STD PIVOT_"+STD, COLOR.YELLOW);``

Replace it with this:

Code:
``````input showBubble = yes;
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

AddChartBubble(SR,STD,Concat("Daily 3 STD PIVOT: ",Round(STD)),Color.Yellow);``````

Anybody know what indicators are the DOTTED purple, cyan and green lines?

Looks like they aggregate to the monthly, something like Various VPOC, Value Upper/Lower timeframe levels. Anyone come across these?

I guess Dynamic Support Resistance

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
391 Online

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• Add-ons and resources
• 1 full year of unlimited support

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?