Experimental: a liltle experience with multiple systems, ma, linear regression, correlation and range analysis.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
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)