Zorro-astrian

ALERT: Passed Yesterday's High/Low

685 7 80
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).

http://blog.tradingview.com/?p=1633
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
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)
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
Reply
Zorro-astrian accidentje
Possibly--could you give me an example?
Reply
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)?
Reply
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.
Reply
accidentje accidentje
Figured it out myself:
4/2 pivot levels
Reply
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...
Reply
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
Reply
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out