176 2 21
Experimental: a liltle experience with multiple systems, ma, linear regression , correlation and range analysis.
Remove from Favorite Scripts Add to Favorite Scripts
study(title="exp", shorttitle="exp", overlay=true)
length = input(12)
perc = input(12.5)

src = input(close)
_atr = cum(tr)/(n+1)
//_atr = atr(length)
//p_median = nz(median[1], close)
//median = tr < _atr ? (p_median + close)/2 : close > open ? p_median + _atr : p_median - _atr
//plot(median, color=black)

_ema = ema(src, length)
_lr = linreg(src, length, 0)
_nlr = _ema - (_lr-_ema)
upper = percentile_nearest_rank(close, length, 100-perc)
lower = percentile_linear_interpolation(close, length, perc)

plot(upper, style=cross, color=maroon)
plot(lower, style=cross, color=green)
plot(_ema, color=black)
plot(_lr, color=olive, linewidth=2)
plot(_nlr, color=orange, linewidth=2)

cor = correlation(close,_ema, 4)
barcolor(cor > 0 and close > _ema ? close > open ? lime : green : cor > 0 and close < _ema ? close > open ? red : maroon : close > open ? silver : gray)

top = (high - max(close, open)) > tr*0.5 and tr > _atr
bot = (min(close, open)-low) > tr*0.5 and tr > _atr
plotshape(top, style=shape.square, color=maroon, location=location.abovebar)
plotshape(bot, style=shape.square, color=green, location=location.belowbar)
Quick question: What do the squares indicate?
Reply
pinbars
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