//@version=2 study("Passed Yesterday's High/Low", overlay=true) //Yesterday's Daily High and Low YesterHigh = security(tickerid, "D", high) YesterLow = security(tickerid, "D", low) //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)
> 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
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.
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...