예스스탁
예스스탁 답변
2021-01-11 14:24:22
안녕하세요
예스스탁입니다.
색상부분은 모두 지정해 드릴수 없습니다.
예스랭귀지는 헥스색상코드로 지정이 되지 않습니다.
모두 각색상별 RGB코드로 변환해서 지정하셔야 합니다.
아래는 모두 초록색으로 지정했습니다.
input : len(5);
var : src(0),alpha(0),upv(0),downv(0),RSIV(0),myCol(0);
var : RSI5(0),RSI10(0);
var : RSI15(0),RSI20(0);
var : RSI25(0),RSI30(0);
var : RSI35(0),RSI40(0);
var : RSI45(0),RSI50(0);
var : RSI55(0),RSI60(0);
var : RSI65(0),RSI70(0);
var : RSI75(0),RSI80(0);
var : RSI85(0),RSI90(0);
var : RSI95(0),RSI100(0);
src = c;
alpha = 1/len;
var1 = max(src-src[1],0);
var2 = -min(src-src[1],0);
rsi5 = RGB(76,175,80);#input(#4CAF50, title="RSI 0-5", type = input.color)
rsi10 = RGB(76,175,80);#input(#4CAF50, title="RSI 5-10", type = input.color)
rsi15 = RGB(76,175,80);##4CAF50, title="RSI 10-15", type = input.color)
rsi20 = RGB(76,175,80);##4CAF50, title="RSI 15-20", type = input.color)
rsi25 = RGB(76,175,80);##4CAF50, title="RSI 20-25", type = input.color)
rsi30 = RGB(76,175,80);##4CAF50, title="RSI 25-30", type = input.color)
rsi35 = RGB(76,175,80);##ef5350, title="RSI 30-35", type = input.color)
rsi40 = RGB(76,175,80);##ef5350, title="RSI 35-40", type = input.color)
rsi45 = RGB(76,175,80);##ef5350, title="RSI 40-45", type = input.color)
rsi50 = RGB(76,175,80);##ef5350, title="RSI 45-50", type = input.color)
rsi55 = RGB(76,175,80);##64b5f6, title="RSI 50-55", type = input.color)
rsi60 = RGB(76,175,80);##64b5f6, title="RSI 55-60", type = input.color)
rsi65 = RGB(76,175,80);##64b5f6, title="RSI 60-65", type = input.color)
rsi70 = RGB(76,175,80);##64b5f6, title="RSI 65-70", type = input.color)
rsi75 = RGB(76,175,80);##ffeb3b, title="RSI 70-75", type = input.color)
rsi80 = RGB(76,175,80);##ffeb3b, title="RSI 75-80", type = input.color)
rsi85 = RGB(76,175,80);##ff9800, title="RSI 80-85", type = input.color)
rsi90 = RGB(76,175,80);##ff9800, title="RSI 85-90", type = input.color)
rsi95 = RGB(76,175,80);##ffffff, title="RSI 90-95", type = input.color)
rsi100 = RGB(76,175,80);##ffffff, title="RSI 95-100", type = input.color)
myCol = iff(rsiv > 0 and rsiv < 5, rsi5,
iff(rsiv > 5 and rsiv < 10, rsi10,
iff(rsiv > 10 and rsiv < 15, rsi15,
iff(rsiv > 15 and rsiv < 20, rsi20,
iff(rsiv > 20 and rsiv < 25, rsi25,
iff(rsiv > 25 and rsiv < 30, rsi30,
iff(rsiv > 30 and rsiv < 35, rsi35,
iff(rsiv > 35 and rsiv < 40, rsi40,
iff(rsiv > 40 and rsiv < 45, rsi45,
iff(rsiv > 45 and rsiv < 50, rsi50,
iff(rsiv > 50 and rsiv < 55, rsi55,
iff(rsiv > 55 and rsiv < 60, rsi60,
iff(rsiv > 60 and rsiv < 65, rsi65,
iff(rsiv > 65 and rsiv < 70, rsi70,
iff(rsiv > 70 and rsiv < 75, rsi75,
iff(rsiv > 75 and rsiv < 80, rsi80,
iff(rsiv > 80 and rsiv < 85, rsi85,
iff(rsiv > 85 and rsiv < 90, rsi90,
iff(rsiv > 90 and rsiv < 95, rsi95,
iff(rsiv > 95 and rsiv < 100, rsi100, Nan))))))))))))))))))));
if CurrentBar >= 1 Then
{
upv = alpha * var1 + (1 - alpha) * upv;
downv = alpha * Var2 + (1 - alpha) * downv;
rsiv = iff(downv == 0 , 100 ,IFf(upv == 0 , 0 , 100 - (100 / (1 + upv / downv))));
plot1(rsiv, "RSI",Mycol);
}
즐거운 하루되세요
> 천외일성 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 아래식을 예스로 변환부탁드립니다.(하켄아쉬)
len = input(5, minval=1, title="Length")
src = input(close, "Source", type = input.source)
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))
rsi5 = input(#4CAF50, title="RSI 0-5", type = input.color)
rsi10 = input(#4CAF50, title="RSI 5-10", type = input.color)
rsi15 = input(#4CAF50, title="RSI 10-15", type = input.color)
rsi20 = input(#4CAF50, title="RSI 15-20", type = input.color)
rsi25 = input(#4CAF50, title="RSI 20-25", type = input.color)
rsi30 = input(#4CAF50, title="RSI 25-30", type = input.color)
rsi35 = input(#ef5350, title="RSI 30-35", type = input.color)
rsi40 = input(#ef5350, title="RSI 35-40", type = input.color)
rsi45 = input(#ef5350, title="RSI 40-45", type = input.color)
rsi50 = input(#ef5350, title="RSI 45-50", type = input.color)
rsi55 = input(#64b5f6, title="RSI 50-55", type = input.color)
rsi60 = input(#64b5f6, title="RSI 55-60", type = input.color)
rsi65 = input(#64b5f6, title="RSI 60-65", type = input.color)
rsi70 = input(#64b5f6, title="RSI 65-70", type = input.color)
rsi75 = input(#ffeb3b, title="RSI 70-75", type = input.color)
rsi80 = input(#ffeb3b, title="RSI 75-80", type = input.color)
rsi85 = input(#ff9800, title="RSI 80-85", type = input.color)
rsi90 = input(#ff9800, title="RSI 85-90", type = input.color)
rsi95 = input(#ffffff, title="RSI 90-95", type = input.color)
rsi100 = input(#ffffff, title="RSI 95-100", type = input.color)
myCol = iff(rsi > 0 and rsi < 5, rsi5,
iff(rsi > 5 and rsi < 10, rsi10,
iff(rsi > 10 and rsi < 15, rsi15,
iff(rsi > 15 and rsi < 20, rsi20,
iff(rsi > 20 and rsi < 25, rsi25,
iff(rsi > 25 and rsi < 30, rsi30,
iff(rsi > 30 and rsi < 35, rsi35,
iff(rsi > 35 and rsi < 40, rsi40,
iff(rsi > 40 and rsi < 45, rsi45,
iff(rsi > 45 and rsi < 50, rsi50,
iff(rsi > 50 and rsi < 55, rsi55,
iff(rsi > 55 and rsi < 60, rsi60,
iff(rsi > 60 and rsi < 65, rsi65,
iff(rsi > 65 and rsi < 70, rsi70,
iff(rsi > 70 and rsi < 75, rsi75,
iff(rsi > 75 and rsi < 80, rsi80,
iff(rsi > 80 and rsi < 85, rsi85,
iff(rsi > 85 and rsi < 90, rsi90,
iff(rsi > 90 and rsi < 95, rsi95,
iff(rsi > 95 and rsi < 100, rsi100, na))))))))))))))))))))
plotrsi = plot(rsi, "RSI", color=myCol)
lineC = true ? #64b5f6 : na
f0 = plot(series=50, color=lineC, transp=65, title="50 Level")
fill(f0, plotrsi, #ffffff, transp=90)