ALERT: Passed Yesterday's High/Low

1551 7 160
This is just a simple script to show if the current price passed yesterday's high or low price. It will create an alert if so (which can be set up to notify you via email or text).

Remove from Favorite Scripts Add to Favorite Scripts
study("Passed Yesterday's High/Low", overlay=true)

//Yesterday's Daily High and Low
YesterHigh = security(tickerid, "D", high[1])
YesterLow = security(tickerid, "D", low[1])

//Current Minute Price
price = security(tickerid, "1", open)

//Price Rises
Rises = price > YesterHigh ? true : false

//Price Falls
Falls = price < YesterLow ? true: false

alertcondition(Rises, title='Price Up', message='Price has Risen!')
alertcondition(Falls, title='Price Down', message='Price has Fallen!')

plot(YesterHigh, color=green)
plot(YesterLow, color=red)
Thank you for posting
Would it be possible to adapt your code to plot the previous x days high/low? ( eg 20 and 55 day high/low as in the turtle system)
If so would you mind showing me?
Cheers Bert
Hi Zorro-Astrian, thanks for the script. I was wondering if you could adapt the script to the following conditions (regardless of the timeframe):
> The plotted high (or resistance level) = the high, after 4 previous lower highs and before 2 lower highs
> The plotted low (or support level) = the low, after 4 previous higher lows and before 2 highers lows
Zorro-astrian accidentje
Possibly--could you give me an example?
Zorro-astrian Zorro-astrian
I think you're saying to look back 7 previous highs (all of which are lower than the current one) and plot the value of the 5th high. (And then do the opposite for the lows)?
accidentje Zorro-astrian
No; the high that needs to be plotted should be confirmed when 1. it's higher than the 4 prior (lower) highs AND 2. higher than the 2 following (lower) highs.
The low that needs to be plotted should be confirmed when 1. it's lower than the 4 prior (higher) lows AND 2. lower than the 2 following (higher) lows.
accidentje accidentje
Figured it out myself:
Zorro-astrian accidentje
Ok so you included today's high (and the previous 6 highs). You did h0 through h6 (which is 7 highs), and you stipulated that h2 (the 5th high) should be plotted. The only real difference is you meant the 5th high should be the highest, and the 6th the second highest.

By including today's high (which changes as new data arrives), you could get thrown off a bit.
You might want to stipulate opening price of today rather than the high of today (and keep the other highs the same)... As far as I understand, but i'm a noob...
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out