LD3K

Previous H/Ls and Forecast H/L

Plots the previous periods High and Lows (black crosses) and forecasts the next day's High and Lows (gray crosses)
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
//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)