예스스탁
예스스탁 답변
2023-03-24 16:37:39
안녕하세요
예스스탁입니다.
input : rsiPeriod(11),bandLength(31),lengthrsipl(1),lengthtradesl(9);
var : src(0),r(0),mav(0),offs(0),upv(0),dnv(0),mid(0),fastma(0),slowma(0);
src = close;
r = rsi(rsiPeriod);
mav = ma(r, bandLength);
offs = (1.6185 * std(r, bandLength));
upv = mav + offs;
dnv = mav - offs;
mid = (upv + dnv) / 2;
fastMA = ma(r, lengthrsipl);
slowMA = ma(r, lengthtradesl);
plot1(upv, "Upper Band", blue);
plot2(dnv, "Lower Band", blue);
plot3(mid, "Middle of Bands", orange);
plot4(slowMA, "Slow MA", green);
plot5(fastMA, "Fast MA", red);
PlotBaseLine1(30);
PlotBaseLine2(50);
PlotBaseLine3(70);
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 수식작성 부탁드립니다.
> 안녕하세요. 운영자님
아래 사이트의 트레이딩뷰 수식을 예스트레이더 수식으로 변환가능하신지 문의/부탁드립니다.
감사합니다.
rsiPeriod = input(11, minval = 1, title = "RSI Period")
bandLength = input(31, minval = 1, title = "Band Length")
lengthrsipl = input(1, minval = 0, title = "Fast MA on RSI")
lengthtradesl = input(9, 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(30) // Oversold
hline(50) // Midline
hline(70) // Overbought
upl = plot(up, "Upper Band", color = blue) // Upper Band
dnl = plot(dn, "Lower Band", color = blue) // Lower Band
midl = plot(mid, "Middle of Bands", color = orange, linewidth = 2) // Middle of Bands
plot(slowMA, "Slow MA", color=green, linewidth=2) // Plot Slow MA
plot(fastMA, "Fast MA", color=red, linewidth=2) // Plot Fast MA
fill(upl, midl, red, transp=90) // Fill Upper Half Red
fill(midl, dnl, green, transp=90) // Fill Lower Half Green