Extend Horizontal Line on a Daily Chart based on Monthly High, Low and Close

shakib3585

Active member
VIP
Hello All,

I am trying to extend a Horizontal line on the left based of Calculated Daily Pivots from Previous Month's High, Low and Close. I plan to draw the lines on a Daily Chart.

My definition of the Daily Pivot Based on Monthly Aggregation is as follows,

PP = HLC3[1];
R = PP + (High[1] - Low[1]);
S = PP - (High[1] - Low[1]);

I only intend to draw the three lines on the current Month only and extend them to the left. I do not wish to draw any Previous Month's Pivots based off the calculation. Please help.

Thanks,

Faisal
 
Solution
Hello All,

I am trying to extend a Horizontal line on the left based of Calculated Daily Pivots from Previous Month's High, Low and Close. I plan to draw the lines on a Daily Chart.

My definition of the Daily Pivot Based on Monthly Aggregation is as follows,

PP = HLC3[1];
R = PP + (High[1] - Low[1]);
S = PP - (High[1] - Low[1]);

I only intend to draw the three lines on the current Month only and extend them to the left. I do not wish to draw any Previous Month's Pivots based off the calculation. Please help.

Thanks,

Faisal

See if this is what you wanted: monthly pivots points, as you defined then, plotted on a daily chart. You can change the displace to lookback at other months.

Screenshot-2023-02-26-191943.png
Code:
input showonlytoday =...
Hello All,

I am trying to extend a Horizontal line on the left based of Calculated Daily Pivots from Previous Month's High, Low and Close. I plan to draw the lines on a Daily Chart.

My definition of the Daily Pivot Based on Monthly Aggregation is as follows,

PP = HLC3[1];
R = PP + (High[1] - Low[1]);
S = PP - (High[1] - Low[1]);

I only intend to draw the three lines on the current Month only and extend them to the left. I do not wish to draw any Previous Month's Pivots based off the calculation. Please help.

Thanks,

Faisal
Here is some code that provides you with the basic syntax to get started.
change the aggregation to month
https://usethinkscript.com/threads/...the-left-towards-the-respective-candles.7266/
 

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

Hello All,

I am trying to extend a Horizontal line on the left based of Calculated Daily Pivots from Previous Month's High, Low and Close. I plan to draw the lines on a Daily Chart.

My definition of the Daily Pivot Based on Monthly Aggregation is as follows,

PP = HLC3[1];
R = PP + (High[1] - Low[1]);
S = PP - (High[1] - Low[1]);

I only intend to draw the three lines on the current Month only and extend them to the left. I do not wish to draw any Previous Month's Pivots based off the calculation. Please help.

Thanks,

Faisal

sorry, your words are confusing and contradictory.
what does a daily pivot have to do with monthly price levels?

this doesn't make any sense
....Daily Pivot Based on Monthly Aggregation is as follows,....

if you are using monthly data, you will have a monthly pivot.

...only current month, but extend to the left? which is it?
do you really want lines extending to the left? back in time, before the event?

i think it would be simpler if you explained what you want ,
with the desired data time (monthly)
and not mention chart time( daily)
 
sorry, your words are confusing and contradictory.
what does a daily pivot have to do with monthly price levels?

this doesn't make any sense
....Daily Pivot Based on Monthly Aggregation is as follows,....

if you are using monthly data, you will have a monthly pivot.

...only current month, but extend to the left? which is it?
do you really want lines extending to the left? back in time, before the event?

i think it would be simpler if you explained what you want ,
with the desired data time (monthly)
and not mention chart time( daily)
sorry for the confusion
 
Hello All,

I am trying to extend a Horizontal line on the left based of Calculated Daily Pivots from Previous Month's High, Low and Close. I plan to draw the lines on a Daily Chart.

My definition of the Daily Pivot Based on Monthly Aggregation is as follows,

PP = HLC3[1];
R = PP + (High[1] - Low[1]);
S = PP - (High[1] - Low[1]);

I only intend to draw the three lines on the current Month only and extend them to the left. I do not wish to draw any Previous Month's Pivots based off the calculation. Please help.

Thanks,

Faisal

See if this is what you wanted: monthly pivots points, as you defined then, plotted on a daily chart. You can change the displace to lookback at other months.

Screenshot-2023-02-26-191943.png
Code:
input showonlytoday = yes;
input agg = AggregationPeriod.MONTH;
input displace = 1;

def pp_;
def R_;
def S_;
if showonlytoday and
  (!IsNaN(close(period = agg)[-1]) or
   IsNaN(close)) {
    pp_ =   Double.NaN;
    R_ = Double.NaN;
    S_ = Double.NaN;
} else {
    pp_ = hlc3(period = agg)[displace];
    R_  = pp_ + (high(period = agg)[displace] - low(period = agg)[displace]);
    S_  = pp_ - (high(period = agg)[displace] - low(period = agg)[displace]);
}

plot pp = HighestAll(pp_);
plot R  = HighestAll(R_);
plot S  = HighestAll(S_);
pp.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
;
 
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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