Exact Lows/Highs

Trigun1127

Member
Alright guys im not sure if this one is easy or hard to make but im going to throw it out there.
Could someone make an Indicator that
1.Draws a line across Highs or Lows that are the exact same to the tick.
2.There must be a minimum of 3 bars with the exact same High or Low for it to plot.
3. Must have a user defined range for which it scans those Highs and/or Lows (ex. 5 bar range or 10 bar range).
4.I'm also looking for a hierarchy of these types of patterns.
5. Highest of the hierarchy = Most candles with exact Highs in the range with the most consecutive bars that contain those highs
Second in Hierarchy = More exact Highs or lows in the range. like 9 bars with Highs but less consecutive is still very strong
Last more intermittent bars in the range with same high (not consecutive/less consecutive) -
Example | Ex= Exact High or Exact Low |
| Not = Not exact High/Low |
Hiearchy1: Ex - Ex - Ex - Ex =Greater then 3 and consecutive
Hierachy2: Ex- Ex- Not - Not - Ex -Ex -Ex =Greater then 3 Less consecutive
Higharchy3: Ex- Ex - Not - Not -Ex = Only 3 less consecutive
Hierarchy3: Ex - Not - Ex - Not -Ex = Only 3 Less consecutive still
So the further Apart those bars = lower in hierarchy
The minimum count again is 3 bars. So greater then 3 is higher in the hierarchy
7. To designate lower hierarchy vs Hierarchy plots allow user defined color setting for the line plot is fine.
8. The ability to turn on and off extension to the right of those lines until those highs or lows are breached.
9. MTF (if possible maby tooooo much work) where the extension of those lines can be turned on and off and the ability to have the date displayed across the extension that shows only on the current trading day. So if this happened months ago the text May 20th would be placed above the line for todays trading day. Again if the extension is breached by a tick going over its high or low the extension stops extending there.
10. RTH start at 9:30

Just a slight expansion on Hierarchy 1's example since I didn't make it clear enough i think. That example doesn't show a lot of exact Highs but in reality It can show the same amount as Hierarchy 2 but the point being it has more consecutive bars greater then 3. That places it in Hierarchy 1.
 
Solution
Alright guys im not sure if this one is easy or hard to make but im going to throw it out there.
Could someone make an Indicator that
1.Draws a line across Highs or Lows that are the exact same to the tick.
2.There must be a minimum of 3 bars with the exact same High or Low for it to plot.
3. Must have a user defined range for which it scans those Highs and/or Lows (ex. 5 bar range or 10 bar range).

here is something to get you started
this follows the first 3 rules
the defaults are,
...look for highs (or lows) that are within $0.02 , over 3 bars

on the last bar of series,
...it draws a colored vertical line
...it draws a colored cloud

green for a high level
red for a low level
white if both

Code:
# samehight_0

#...
Alright guys im not sure if this one is easy or hard to make but im going to throw it out there.
Could someone make an Indicator that
1.Draws a line across Highs or Lows that are the exact same to the tick.
2.There must be a minimum of 3 bars with the exact same High or Low for it to plot.
3. Must have a user defined range for which it scans those Highs and/or Lows (ex. 5 bar range or 10 bar range).

here is something to get you started
this follows the first 3 rules
the defaults are,
...look for highs (or lows) that are within $0.02 , over 3 bars

on the last bar of series,
...it draws a colored vertical line
...it draws a colored cloud

green for a high level
red for a low level
white if both

Code:
# samehight_0

# https://usethinkscript.com/threads/exact-lows-highs.12196/
# Could someone make an Indicator that
#1.Draws a line across Highs or Lows that are the exact same to the tick.
#2.There must be a minimum of 3 bars with the exact same High or Low for it to plot.
#3. Must have a user defined range for which it scans those Highs and/or Lows (ex. 5 bar range or 10 bar range).

# 1,2,3
# find x bars with similar price levels

def na = double.nan;

input bar_qty = 3;
input price_variance = 0.02;

def hihi = Highest(high, bar_qty);
def hilo = Lowest(high, bar_qty);
def hidiff = hihi - hilo;
def ishi_tol = (hidiff <= price_variance);

def lohi = Highest(low, bar_qty);
def lolo = Lowest(low, bar_qty);
def lodiff = lohi - lolo;
def islo_tol = ( lodiff <= price_variance);

def isch = (ishi_tol and islo_tol);

input test_lines = yes;
addverticalline(test_lines and isch, "-", color.white);
addverticalline(test_lines and !isch and ishi_tol, "-", color.green);
addverticalline(test_lines and !isch and islo_tol, "-", color.red);


input show_cloud = yes;
def htfac = 0.004;

def chx = show_cloud and (isch or isch[-1]);
def chtop = if chx then (hihi * (1+htfac)) else na;
def chbot = if chx then (hilo * (1-htfac)) else na;
addcloud(chtop, chbot, color.white, color.white);

def hix = show_cloud and !isch and (ishi_tol or ishi_tol[-1]);
def hitop = if hix then (hihi * (1+htfac)) else na;
def hibot = if hix then (hilo * (1-htfac)) else na;
addcloud(hitop, hibot, color.green, color.green);

def lox = show_cloud and !isch and (islo_tol or islo_tol[-1]);
def lotop = if lox then (lohi * (1+htfac)) else na;
def lobot = if lox then (lolo * (1-htfac)) else na;
addcloud(lotop, lobot, color.red, color.red);
#

N4Kjrdi.jpg
 
Last edited:
Solution
Fantastic, the occurrences are low as expected but very helpful. Everything so far is working correctly. I didn't think of using vertical lines as a way to find these quickly so that's very helpful. Can there be a toggle for turning the Large vertical lines on and off. Its great for scanning over many days and pointing them out. I'm not sure if the clouds are needed unless you see a particular advantage to it. The only thing Id like to add is a line that is drawn across the tops or lows so they can be quickly identified. The lines color I think can denote priority instead. Perhaps something like this with two vertical lines between the bars could work? If you could add in user defined range for scanning for those bars then this is perfect. Two issues I did run into was when there were 4 bars in a series it counted it twice. Pictures below. The other is that it doesnt look like its working on Higher Time frame Charts like daily weekly.
I'm working on /MES you can see what I'm seeing on 7-20-22 | 2:45:00PM

Edit:
For Green Hierarchy clouds I only seem to be seeing 3 bars consecutive this should should technically be white as it only has 3 bars and not more so. Green would have Greater then 3 bars in the series all being consecutive.
Red would have Greater then 3 bars in the series with at least 1 bar not being consecutive
White would be only 3 bars in a series either consecutive or not consecutive.

 
Last edited:
Fantastic, the occurrences are low as expected but very helpful. Everything so far is working correctly. I didn't think of using vertical lines as a way to find these quickly so that's very helpful. Can there be a toggle for turning the Large vertical lines on and off. Its great for scanning over many days and pointing them out. I'm not sure if the clouds are needed unless you see a particular advantage to it. The only thing Id like to add is a line that is drawn across the tops or lows so they can be quickly identified. The lines color I think can denote priority instead. Perhaps something like this with two vertical lines between the bars could work? If you could add in user defined range for scanning for those bars then this is perfect. Two issues I did run into was when there were 4 bars in a series it counted it twice. Pictures below. The other is that it doesnt look like its working on Higher Time frame Charts like daily weekly.
I'm working on /MES you can see what I'm seeing on 7-20-22 | 2:45:00PM

Edit:
For Green Hierarchy clouds I only seem to be seeing 3 bars consecutive this should should technically be white as it only has 3 bars and not more so. Green would have Greater then 3 bars in the series all being consecutive.
Red would have Greater then 3 bars in the series with at least 1 bar not being consecutive
White would be only 3 bars in a series either consecutive or not consecutive.

fyi , working on something....
 
I don't know how I would scan for this code, help is appreciated! I've actually never even used the scanner before. Also if someone could edit this code that would be fantastic too! Right now the Bar Quantity option isn't working (the amount of bars it scans for highs and lows). I need it to be able to pick up Exact Highs or Lows that are non consecutive but happen in a 4+ bar series.




# samehight_0

# https://usethinkscript.com/threads/exact-lows-highs.12196/
# Could someone make an Indicator that
#1.Draws a line across Highs or Lows that are the exact same to the tick.
#2.There must be a minimum of 3 bars with the exact same High or Low for it to plot.
#3. Must have a user defined range for which it scans those Highs and/or Lows (ex. 5 bar range or 10 bar range).

# 1,2,3
# find x bars with similar price levels

def na = double.nan;

input bar_qty = 3;
input price_variance = 0.02;

def hihi = Highest(high, bar_qty);
def hilo = Lowest(high, bar_qty);
def hidiff = hihi - hilo;
def ishi_tol = (hidiff <= price_variance);

def lohi = Highest(low, bar_qty);
def lolo = Lowest(low, bar_qty);
def lodiff = lohi - lolo;
def islo_tol = ( lodiff <= price_variance);

def isch = (ishi_tol and islo_tol);

input test_lines = yes;
addverticalline(test_lines and isch, "-", color.white);
addverticalline(test_lines and !isch and ishi_tol, "-", color.green);
addverticalline(test_lines and !isch and islo_tol, "-", color.red);


input show_cloud = yes;
def htfac = 0.004;

def chx = show_cloud and (isch or isch[-1]);
def chtop = if chx then (hihi * (1+htfac)) else na;
def chbot = if chx then (hilo * (1-htfac)) else na;
addcloud(chtop, chbot, color.white, color.white);

def hix = show_cloud and !isch and (ishi_tol or ishi_tol[-1]);
def hitop = if hix then (hihi * (1+htfac)) else na;
def hibot = if hix then (hilo * (1-htfac)) else na;
addcloud(hitop, hibot, color.green, color.green);

def lox = show_cloud and !isch and (islo_tol or islo_tol[-1]);
def lotop = if lox then (lohi * (1+htfac)) else na;
def lobot = if lox then (lolo * (1-htfac)) else na;
addcloud(lotop, lobot, color.red, color.red);
#
 
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
415 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