RicardoSantos

[RS]Long Term Price Range Analysis (MML)

253 2 22
Study on Price range Regression and range (deviation multiplier needs to be accommodate manually to fit price action)
study was made for time frames above weekly
Remove from Favorite Scripts Add to Favorite Scripts
study("[RS]Long Term Price Range Analysis (MML)", overlay=true)
Multiplier = input(1)
cadev(src, _length)=>cum(stdev(close, _length))/(n+1)
preHH = nz(HH[1], high[1])
preLL = nz(LL[1], low[1])
HH = high >= preHH ? high : preHH
LL = low <= preLL ? low : preLL
RANGE = HH-LL
pool = 100
CalculateRegression(_pool_size) => (valuewhen(n == _pool_size, LL+(RANGE*0.5), 0)-valuewhen(n == 1, LL+(RANGE*0.5), 0))/(n+1)
RegressionMLine = nz(RegressionMLine[1], valuewhen(n==1, LL+(RANGE*0.5), 0))+CalculateRegression(pool)
stdev_length = 4
cdev = cadev(RANGE, stdev_length)
R_UML6 = RegressionMLine + (cdev*Multiplier)*6
R_UML5 = RegressionMLine + (cdev*Multiplier)*5
R_UML4 = RegressionMLine + (cdev*Multiplier)*4
R_UML3 = RegressionMLine + (cdev*Multiplier)*3
R_UML2 = RegressionMLine + (cdev*Multiplier)*2
R_UML1 = RegressionMLine + (cdev*Multiplier)*1
R_DML1 = RegressionMLine - (cdev*Multiplier)*1
R_DML2 = RegressionMLine - (cdev*Multiplier)*2
R_DML3 = RegressionMLine - (cdev*Multiplier)*3
R_DML4 = RegressionMLine - (cdev*Multiplier)*4
R_DML5 = RegressionMLine - (cdev*Multiplier)*5
R_DML6 = RegressionMLine - (cdev*Multiplier)*6
plot(R_UML6, color=black, offset=-pool, linewidth=1)
plot(R_UML5, color=black, offset=-pool, linewidth=1)
plot(R_UML4, color=black, offset=-pool, linewidth=2)
plot(R_UML3, color=black, offset=-pool)
plot(R_UML2, color=black, offset=-pool)
plot(R_UML1, color=black, offset=-pool)
plot(RegressionMLine, color=black, offset=-pool, linewidth=2)
plot(R_DML1, color=black, offset=-pool)
plot(R_DML2, color=black, offset=-pool)
plot(R_DML3, color=black, offset=-pool)
plot(R_DML4, color=black, offset=-pool, linewidth=2)
plot(R_DML5, color=black, offset=-pool, linewidth=1)
plot(R_DML6, color=black, offset=-pool, linewidth=1)
//plot(HH)
//plot(LL)

Related Ideas

RicardoSantos
JR
RicardoSantos PRO about BTCUSD 2 years ago
alex.a
2 years ago
This is the ridiculous data. http://en.wikipedia.org/wiki/Euro#Introduction EUro didn't exist before 1992. But the data above has from 1972??? OMG -
Reply
RicardoSantos PRO alex.a
2 years ago
lol.. probably a weighted average of the old currencies.. data looks to fit tho...
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