예스스탁
예스스탁 답변
2024-09-19 15:11:02
안녕하세요
예스스탁입니다.
input : rsiPeriod(21);
input : bandLength(34);
input : lengthrsipl(7);
input : lengthtradesl(2);
var : src(0),r(0),mav(0),offs(0),up(0),dn(0),mid(0),fastma(0),slowma(0);
src = close; // Source of Calculations (Close of Bar)
r = rsi(rsiPeriod); // RSI of Close
mav = ma(r, bandLength); // Moving Average of RSI [current]
offs = (1.6185 * std(r, bandLength)); // Offset
up = mav + offs; // Upper Bands
dn = mav - offs; // Lower Bands
mid = (up + dn) / 2; // Average of Upper and Lower Bands
fastMA = ma(r, lengthrsipl); // Moving Average of RSI 2 bars back
slowMA = ma(r, lengthtradesl); // Moving Average of RSI 7 bars back
PlotBaseLine1(20); // ExtremelyOversold
PlotBaseLine2(30); // Oversold
PlotBaseLine3(50); // Midline
PlotBaseLine4(70); // Overbought
PlotBaseLine5(80); // ExtremelyOverbought
plot1(up, "Upper Band"); // Upper Band
plot2(dn, "Lower Band"); // Lower Band
plot3(mid, "Middle of Bands"); // Middle of Bands
plot4(slowMA, "Slow MA"); // Plot Slow MA
plot5(fastMA, "Fast MA"); // Plot Fast MA
즐거운 하루되세요
> 만강 님이 쓴 글입니다.
> 제목 : 문의 드립니다
>
안녕하세요
다음 트레이딩뷰 의 코딩을 예스로 전환 부탁드립니다
study("TDI - Traders Dynamic Index [Goldminds]", shorttitle="TDIGM")
rsiPeriod = input(21, minval = 1, title = "RSI Period")
bandLength = input(34, minval = 1, title = "Band Length")
lengthrsipl = input(7, minval = 0, title = "Fast MA on RSI")
lengthtradesl = input(2, minval = 1, title = "Slow MA on RSI")
src = close // Source of Calculations (Close of Bar)
r = rsi(src, rsiPeriod) // RSI of Close
ma = sma(r, bandLength) // Moving Average of RSI [current]
offs = (1.6185 * stdev(r, bandLength)) // Offset
up = ma + offs // Upper Bands
dn = ma - offs // Lower Bands
mid = (up + dn) / 2 // Average of Upper and Lower Bands
fastMA = sma(r, lengthrsipl) // Moving Average of RSI 2 bars back
slowMA = sma(r, lengthtradesl) // Moving Average of RSI 7 bars back
hline(20) // ExtremelyOversold
hline(30) // Oversold
hline(50) // Midline
hline(70) // Overbought
hline(80) // ExtremelyOverbought
upl = plot(up, "Upper Band", color = #3286c3, linewidth = 2) // Upper Band
dnl = plot(dn, "Lower Band", color = #3286c3, linewidth = 2) // Lower Band
midl = plot(mid, "Middle of Bands", color = yellow, linewidth = 2) // Middle of Bands
plot(slowMA, "Slow MA", color=green, linewidth=2) // Plot Slow MA
plot(fastMA, "Fast MA", color=red, linewidth=1) // Plot Fast MA