예스스탁
예스스탁 답변
2023-11-29 14:23:52
안녕하세요
예스스탁입니다.
input : len(14);
input : src(close);
input : on5(true);
input : on73(true);
input : on82(true);
input : on91(false);
input : r70(70);
input : r30(30);
input : r80(80);
input : r20(20);
input : r90(90);
input : r10(10);
input : smooth(false);
var : up(0),down(0),rsiv(0);
var : a(0),rc70(0),rc30(0),rc80(0),rc20(0),rc90(0),rc10(0);
var : c70e(0),c30e(0),c80e(0),c20e(0),c90e(0),c10e(0);
var : c50(0),lens(0);
var : c70(0),c30(0),c80(0),c20(0),c90(0),c10(0);
var : alpha(0);
alpha = 1/len;
up = iff(IsNaN(up[1]) == true, ma(max(src-src[1], 0), len) , alpha * max(src-src[1], 0) + (1 - alpha) * IFf(IsNan(up[1])==true,0,up[1]));
down = iff(IsNaN(down[1]) == true, ma(-min(src-src[1], 0), len) , alpha * -min(src-src[1], 0) + (1 - alpha) * IFf(IsNan(down[1])==true,0,down[1]));
rsiv = iff(down == 0 , 100 , iff(up == 0 , 0 , 100 - (100 / (1 + up / down))));
a = 1/len;
rc70 = 100/(100-r70)-1;
rc30 = 1/(100/(100-r30)-1);
rc80 = 100/(100-r80)-1;
rc20 = 1/(100/(100-r20)-1);
rc90 = 100/(100-r90)-1;
rc10 = 1/(100/(100-r10)-1);
c70e = (1-a)/a*(rc70*down-up)+close;
c30e = close-(1-a)/a*(rc30*up-down);
c80e = (1-a)/a*(rc80*down-up)+close;
c20e = close-(1-a)/a*(rc20*up-down);
c90e = (1-a)/a*(rc90*down-up)+close;
c10e = close-(1-a)/a*(rc10*up-down);
c50 = (1-a)/a*(down-up)+close;
lens = floor(len/3);
if smooth == true Then
c70 = ma(c70e,lens);
else
c70 = c70e;
if smooth == true Then
c30 = ma(c30e,lens);
else
c30 = c30e;
if smooth == true Then
c80 = ma(c80e,lens);
else
c80 = c80e;
if smooth == true Then
c20 = ma(c20e,lens);
else
c20 = c20e;
if smooth == true Then
c90 = ma(c90e,lens);
else
c90 = c90e;
if smooth == true Then
c10 = ma(c10e,lens);
else
c10 = c10e;
plot1(iff(on73,c70,Nan),"c70",orange);
plot2(iff(on73,c30,nan),"c30",orange);
plot3(iff(on82,c80,nan),"c80",yellow);
plot4(iff(on82,c20,nan),"c20",yellow);
plot5(iff(on91,c90,nan),"c90",green);
plot6(iff(on91,c10,nan),"c10",green);
plot7(iff(on5,c50,nan),"c5",white);
즐거운 하루되세요
> 신대륙발견 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> study(title="RSI OverBought/Sold Price Predict", shorttitle="RSI", overlay=true, format=format.price, precision=2, resolution="")
len = input(14, minval=1, title="Length")
src = input(close, "Source", type = input.source)
on5 = input(true,"RSI 50 Line")
on73 = input(true,"RSI OB/S 1 Line On/Off")
on82 = input(true,"RSI OB/S 2 Line On/Off")
on91 = input(false,"RSI OB/S 3 Line On/Off")
r70 = input(70, "OverBought 1",maxval=99,minval=1)
r30 = input(30, "OverSold 1",maxval=99,minval=1)
r80 = input(80, "OverBought 2",maxval=99,minval=1)
r20 = input(20, "OverSold 2",maxval=99,minval=1)
r90 = input(90, "OverBought 3",maxval=99,minval=1)
r10 = input(10, "OverSold 3",maxval=99,minval=1)
smooth = input(false,"Smoothing")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
a = 1/len
rc70 = 100/(100-r70)-1
rc30 = 1/(100/(100-r30)-1)
rc80 = 100/(100-r80)-1
rc20 = 1/(100/(100-r20)-1)
rc90 = 100/(100-r90)-1
rc10 = 1/(100/(100-r10)-1)
c70e = (1-a)/a*(rc70*down-up)+close
c30e = close-(1-a)/a*(rc30*up-down)
c80e = (1-a)/a*(rc80*down-up)+close
c20e = close-(1-a)/a*(rc20*up-down)
c90e = (1-a)/a*(rc90*down-up)+close
c10e = close-(1-a)/a*(rc10*up-down)
c50 = (1-a)/a*(down-up)+close
lens = floor(len/3)
c70 = if smooth == true
sma(c70e,lens)
else
c70e
c30 = if smooth == true
sma(c30e,lens)
else
c30e
c80 = if smooth == true
sma(c80e,lens)
else
c80e
c20 = if smooth == true
sma(c20e,lens)
else
c20e
c90 = if smooth == true
sma(c90e,lens)
else
c90e
c10 = if smooth == true
sma(c10e,lens)
else
c10e
plot(on73? c70:na,color=color.orange, style=plot.style_stepline,offset=1)
plot(on73? c30:na,color=color.orange,style=plot.style_stepline,offset =1)
plot(on82? c80:na,color=color.yellow,style=plot.style_stepline,offset=1)
plot(on82? c20:na,color=color.yellow,style=plot.style_stepline,offset =1)
plot(on91? c90:na,color=color.green,style=plot.style_stepline,offset=1)
plot(on91? c10:na,color=color.green,style=plot.style_stepline,offset =1)
plot(on5? c50:na,color=color.white,style=plot.style_stepline,offset=1)
트레이딩뷰 지표입니다.
예스 수식으로 좀 변환해주세요.