LD3K

Previous H/Ls and Forecast H/L

343 5 61
Plots the previous periods High and Lows (black crosses) and forecasts the next day's High and Lows (gray crosses)
Remove from Favorite Scripts Add to Favorite Scripts
//Created by Lachlan Smith 31/03/15 
// Updated to included projected high and lows
//Daily and Weekly
study(title="High and Lows", shorttitle="H&L + forecast", overlay=true) 
//Data setup
dHigh = security(tickerid, 'D', high[1]) 
dLow = security(tickerid, 'D', low[1]) 
dClose =  security(tickerid, 'D', close[1]) 
dOpen =  security(tickerid, 'D', open[1]) 

wHigh = security(tickerid, 'W', high[1]) 
wLow = security(tickerid, 'W', low[1]) 
wClose =  security(tickerid, 'W', close[1]) 
wOpen =  security(tickerid, 'W', open[1]) 

//Daily
projectedHigh = dClose < dOpen ? ((dHigh + dClose + 2*dLow)/2 - dLow) : dClose > dOpen ? ((2*dHigh + dLow + dClose)/2 - dLow) : ((dHigh + dLow + 2*dClose)/2 - dLow)
projectedLow = dClose < dOpen ? ((dHigh + dClose + 2*dLow)/2 - dHigh) : dClose > dOpen ? ((2*dHigh + dLow + dClose)/2 - dHigh) : ((dHigh + dLow + 2*dClose)/2 - dHigh)

plot(isintraday ? dHigh : na, title="Daily High",style=cross, color=black,linewidth=2) 
plot(isintraday ? dLow : na, title="Daily Low",style=cross, color=black,linewidth=2) 

plot(isintraday ? projectedHigh : na, title="Forecast High",style=cross, color=gray,linewidth=2) 
plot(isintraday ? projectedLow : na, title="Forecast Low",style=cross, color=gray,linewidth=2) 

//weekly
projectedWHigh = wClose < wClose ? ((wHigh + wClose + 2*wLow)/2 - wLow) : wClose > wClose ? ((2*wHigh + wLow + wClose)/2 - wLow) : ((wHigh + wLow + 2*wClose)/2 - wLow)
projectedWLow = wClose < wClose ? ((wHigh + wClose + 2*wLow)/2 - wHigh) : wClose > wClose ? ((2*wHigh + wLow + wClose)/2 - wHigh) : ((wHigh + wLow + 2*wClose)/2 - wHigh)

plot(isdaily ? wHigh : na, title="Weekly High",style=cross, color=black,linewidth=2) 
plot(isdaily ? wLow : na, title="Weekly Low",style=cross, color=black,linewidth=2) 

plot(isdaily ? projectedWHigh : na, title="Weekly Forecast High",style=cross, color=gray,linewidth=2) 
plot(isdaily ? projectedWLow : na, title="Weekly Forecast Low",style=cross, color=gray,linewidth=2) 
TonyCampbell
a year ago
These are DeMark Pivots?
Reply
LD3K PRO TonyCampbell
a year ago
Yep
Reply
ChartArt LD3K
a year ago
You coded them correctly. I just compared them with the build-in DeMark pivots offered by Tradingview as part of the "Pivot Points Standard" indicator:

snapshot
Reply
TonyCampbell
a year ago
Thanks very much. Are you familiar with DeMark Sequential ?
Reply
LD3K PRO TonyCampbell
a year ago
I am but i have never tried trading it
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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 Billing Sign Out