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)
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
//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)