How to extend each price line fully to the left and right

R

rodhsnyc

Guest
Salutations,

Let me first say how glad I am to have found this Brotherhood, and I am grateful to now be apart of it! I hope to add value, quickly, one day soon.
----------------------------------------------

Now, my problem is that I cannot get the lines to extend fully (or as far as possible) to the left and right at the same time for the levels (high,low, open, close) that are automatically generated. Could someone please help me achieve this? I have been working for days on and off and I cannot figure this out to save my life! I have inserted the code in question below.
input aggregationPeriod = AggregationPeriod.YEAR;
input length = 1;
input displace = -0;
input showOnlyLast100Period = yes;
input barsBack = 100;

plot DailyHigh;
plot DailyLow;
plot DailyOpen;
plot DailyClose;
if showOnlyLast100Period and !IsNaN(close(period = aggregationPeriod)[-100]) {
DailyHigh = barsBack;
DailyLow = Double.NaN;
DailyOpen = Double.NaN;
DailyClose = Double.NaN;
} else {
DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
DailyOpen = Highest(open(period = aggregationPeriod)[-displace], length);
DailyClose = Lowest(close(period = aggregationPeriod)[-displace], length);
}

DailyHigh.SetDefaultColor(GetColor(4));
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyLow.SetDefaultColor(GetColor(4));
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyClose.SetDefaultColor(GetColor(4));
DailyClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyOpen.SetDefaultColor(GetColor(4));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 

Attachments

  • Lines to extend.png
    Lines to extend.png
    236.3 KB · Views: 155
Salutations,

Let me first say how glad I am to have found this Brotherhood, and I am grateful to now be apart of it! I hope to add value, quickly, one day soon.
----------------------------------------------

Now, my problem is that I cannot get the lines to extend fully (or as far as possible) to the left and right at the same time for the levels (high,low, open, close) that are automatically generated. Could someone please help me achieve this? I have been working for days on and off and I cannot figure this out to save my life! I have inserted the code in question below.
input aggregationPeriod = AggregationPeriod.YEAR;
input length = 1;
input displace = -0;
input showOnlyLast100Period = yes;
input barsBack = 100;

plot DailyHigh;
plot DailyLow;
plot DailyOpen;
plot DailyClose;
if showOnlyLast100Period and !IsNaN(close(period = aggregationPeriod)[-100]) {
DailyHigh = barsBack;
DailyLow = Double.NaN;
DailyOpen = Double.NaN;
DailyClose = Double.NaN;
} else {
DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
DailyOpen = Highest(open(period = aggregationPeriod)[-displace], length);
DailyClose = Lowest(close(period = aggregationPeriod)[-displace], length);
}

DailyHigh.SetDefaultColor(GetColor(4));
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyLow.SetDefaultColor(GetColor(4));
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyClose.SetDefaultColor(GetColor(4));
DailyClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyOpen.SetDefaultColor(GetColor(4));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

hello,
i am not sure what you want to see on a chart.
you are using a 2nd agg of year, on a year chart,... so different data will exist on every bar.
why are you using an offset of -100 ?? that means look 100 years into the future... that bar doesn't exist.

can you describe what you think you want to see?
chart time, which bars have lines.

do you want to see horizontal lines from every single bar on a chart ? not practical. a study would need 100s of plot statements.


if the chart is set to day, then you will see lines extend over many bars, for a year.

wn3FI61.jpg
 
hello,
i am not sure what you want to see on a chart.
you are using a 2nd agg of year, on a year chart,... so different data will exist on every bar.
why are you using an offset of -100 ?? that means look 100 years into the future... that bar doesn't exist.

can you describe what you think you want to see?
chart time, which bars have lines.

do you want to see horizontal lines from every single bar on a chart ? not practical. a study would need 100s of plot statements.


if the chart is set to day, then you will see lines extend over many bars, for a year.

wn3FI61.jpg

First off, thank you for your reply.

To get straight to the point. I want to be able to take the past HLOC for each bar of the aggregation periods Year, Month from the past 3 years, and display them on the a Week (aggregation period) trading chart as well as a Day (aggregation) trading chart as dashed white lines that extend as far as possible from left to right (most recent bar on chart).
 

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