LD3K

Previous H/Ls and Forecast H/L

420 5 77
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) 
Thanks very much. Are you familiar with DeMark Sequential ?
Reply
LD3K PRO TonyCampbell
I am but i have never tried trading it
Reply
These are DeMark Pivots?
Reply
LD3K PRO TonyCampbell
Yep
Reply
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
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
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
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out