Robert Payne HighestHigh

ILIKESTOCKS

Member
Here is the original code:

input StartDate = 20191003;
def hh = if GetYYYYMMDD() == StartDate then high else if high > hh[1] then high else hh[1];
plot higherHigh = if GetYYYYMMDD() < StartDate then Double.NaN else hh;
higherHigh.SetPaintingStrategy(12);

I would like the code to do the reverse operation. LowestALL. Ive tried just reversing some of the commands and it kind of works but Im missing something.
 
Solution
Here is the original code:

input StartDate = 20191003;
def hh = if GetYYYYMMDD() == StartDate then high else if high > hh[1] then high else hh[1];
plot higherHigh = if GetYYYYMMDD() < StartDate then Double.NaN else hh;
higherHigh.SetPaintingStrategy(12);

I would like the code to do the reverse operation. LowestALL. Ive tried just reversing some of the commands and it kind of works but Im missing something.

The lowerlow defs were likely not initalized.

In most instances the high can work without initalization as the higher highs will display on your chart with the candles..

However, the lows without an initial value will use zero as a starting plot. Likely that is going to be the lower low overall rather than what you want...
Here is the original code:

input StartDate = 20191003;
def hh = if GetYYYYMMDD() == StartDate then high else if high > hh[1] then high else hh[1];
plot higherHigh = if GetYYYYMMDD() < StartDate then Double.NaN else hh;
higherHigh.SetPaintingStrategy(12);

I would like the code to do the reverse operation. LowestALL. Ive tried just reversing some of the commands and it kind of works but Im missing something.

The lowerlow defs were likely not initalized.

In most instances the high can work without initalization as the higher highs will display on your chart with the candles..

However, the lows without an initial value will use zero as a starting plot. Likely that is going to be the lower low overall rather than what you want. The zero line usually will not be visible on your chart with the candles unless you zoom in the chart so that you could see the problem.

Code:
input StartDate = 20191003;

def hh = if BarNumber() == 1 then high else if GetYYYYMMDD() == StartDate then high else if high > hh[1] then high else hh[1];
plot higherHigh = if GetYYYYMMDD() < StartDate then Double.NaN else hh;
higherHigh.SetPaintingStrategy(12);

def ll = if BarNumber() == 1 then low else if GetYYYYMMDD() == StartDate then low else if low < ll[1] then low else ll[1];
plot lowerlow = if GetYYYYMMDD() < StartDate then Double.NaN else ll;
lowerlow.SetPaintingStrategy(12);
 
Solution

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

The lowerlow defs were likely not initalized.

In most instances the high can work without initalization as the higher highs will display on your chart with the candles..

However, the lows without an initial value will use zero as a starting plot. Likely that is going to be the lower low overall rather than what you want. The zero line usually will not be visible on your chart with the candles unless you zoom in the chart so that you could see the problem.
Ok that makes sense. Thank you! Code works great. This is what I did below, I got a line to show up but not sure how it was calculating it to plot it. It didn't make since to my untrained eye.

input StartDate = 20191003;
def ll = if GetYYYYMMDD() == StartDate then low else if low > ll[1] then low
else ll[1];
plot lowerlow = if GetYYYYMMDD() < StartDate then Double.NaN else ll;
lowerlow.SetPaintingStrategy(12);
 
Ok that makes sense. Thank you! Code works great. This is what I did below, I got a line to show up but not sure how it was calculating it to plot it. It didn't make since to my untrained eye.

input StartDate = 20191003;
def ll = if GetYYYYMMDD() == StartDate then low else if low > ll[1] then low
else ll[1];
plot lowerlow = if GetYYYYMMDD() < StartDate then Double.NaN else ll;
lowerlow.SetPaintingStrategy(12);

I suggest one minor adjustment to your code: low < ll[1] instead of low > ll[1]

Screenshot 2023-10-11 102436.png
Code:
input StartDate = 20191003;
def ll = if GetYYYYMMDD() == StartDate then low else if low < ll[1] then low
else ll[1];
plot lowerlow = if GetYYYYMMDD() < StartDate then Double.NaN else ll;
lowerlow.SetPaintingStrategy(12);
 
Thread starter Similar threads Forum Replies Date
ILIKESTOCKS Robert Payne's "The Edge" Questions 6
O HighestHigh & LowestLow lines for TRIN indicator Questions 2

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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