커뮤니티

수식전환 요청드립니다.

프로필 이미지
고박사122
2024-12-06 05:30:06
621
글번호 186003
답변완료
안녕하세요. 아래 트레이딩뷰 지표를 예스트레이더 형식으로 전환 부탁드립니다. 감사합니다. //@version=3 study("Better RSI") cycler = na myPeriod = input(defval = 14, type=integer, title="Period") src = input(close, type=source) showCycler = input(true,'Show cycler?') lvl = input(50, 'Cycler level on plot') myRSI = rsi(src, myPeriod) firstcolor = color(white,10) secondcolor = color(orange,50) thirdcolor = gray h30 = hline(30,color=firstcolor,linestyle=dashed,title='Low') h70 = hline(70,color=firstcolor,linestyle=dashed,title = 'High') h20 = hline(20, color=secondcolor,linestyle = solid,title='Second low') h80 = hline(80, color=secondcolor,linestyle=solid,title='Second high') //h50 = hline(50, color=orange, title= 'Mid line') h40 = hline(40, color = thirdcolor, linestyle = dashed,title = '40 line') h60 = hline(60, color = thirdcolor, linestyle = dashed, title = '60 line') //fill(h30,h20,red,transp=80, title='Oversold color') //fill(h80,h70,red,transp=80, title='Overbought color') fill(h30,h70,fuchsia,transp=90, title= 'Background color') //cond =? red:white RSIplot = plot(myRSI,color=white,linewidth=2,transp=0,title="RSI") plot(myRSI >= 70 or myRSI<= 30? myRSI:na,style = linebr,linewidth=3,color=red,transp = 0, title = 'Oversold color') //cycler cycler := if myRSI > 69 or myRSI< 31 a = if myRSI > 69 1 // bullish else 2 // bearish a else b = if (nz(cycler[1]) == 1 and myRSI < 39) or (nz(cycler[1]) == 2 and myRSI > 61) 0 else nz(cycler[1]) b mycolor = if cycler == 0 white else c = if cycler == 1 lime else red c plot(showCycler? lvl:na, style = line, color = mycolor, transp = 30, linewidth=2, title = 'Cycler colors')
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-12-06 15:33:05

안녕하세요 예스스탁입니다. input : myPeriod(14); input : showCycler(true); input : lvl(50); var : src(0),myRSI(0),firstcolor(0),secondcolor(0),thirdcolor(0); var : cycler(Nan),mycolor(Nan); src = close; myRSI = rsi(myPeriod); firstcolor = white; secondcolor = orange; thirdcolor = gray; PlotBaseLine1(30,"Low",firstcolor); PlotBaseLine2(70,"High",firstcolor); PlotBaseLine3(20,"Second Low",secondcolor); PlotBaseLine4(80,"Second High",secondcolor); PlotBaseLine5(40,"40 Line",thirdcolor); PlotBaseLine6(60,"60 Line",thirdcolor); plot1(myRSI,"RSI",White); if myRSI >= 70 or myRSI<= 30 Then plot2(myRSI,"Oversold color"); Else NoPlot(2); //cycler if myRSI > 69 or myRSI< 31 Then { if myRSI > 69 Then cycler = 1; // bullish else cycler = 2; // bearish } else { if (cycler[1] == 1 and myRSI < 39) or (cycler[1] == 2 and myRSI > 61) Then cycler = 0; else cycler = cycler[1]; } if cycler == 0 Then mycolor = white; else { if cycler == 1 Then mycolor = lime; else mycolor = red; } if showCycler == true Then plot3(lvl,"Cycler colors",mycolor); Else NoPlot(3); 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 수식전환 요청드립니다. > 안녕하세요. 아래 트레이딩뷰 지표를 예스트레이더 형식으로 전환 부탁드립니다. 감사합니다. //@version=3 study("Better RSI") cycler = na myPeriod = input(defval = 14, type=integer, title="Period") src = input(close, type=source) showCycler = input(true,'Show cycler?') lvl = input(50, 'Cycler level on plot') myRSI = rsi(src, myPeriod) firstcolor = color(white,10) secondcolor = color(orange,50) thirdcolor = gray h30 = hline(30,color=firstcolor,linestyle=dashed,title='Low') h70 = hline(70,color=firstcolor,linestyle=dashed,title = 'High') h20 = hline(20, color=secondcolor,linestyle = solid,title='Second low') h80 = hline(80, color=secondcolor,linestyle=solid,title='Second high') //h50 = hline(50, color=orange, title= 'Mid line') h40 = hline(40, color = thirdcolor, linestyle = dashed,title = '40 line') h60 = hline(60, color = thirdcolor, linestyle = dashed, title = '60 line') //fill(h30,h20,red,transp=80, title='Oversold color') //fill(h80,h70,red,transp=80, title='Overbought color') fill(h30,h70,fuchsia,transp=90, title= 'Background color') //cond =? red:white RSIplot = plot(myRSI,color=white,linewidth=2,transp=0,title="RSI") plot(myRSI >= 70 or myRSI<= 30? myRSI:na,style = linebr,linewidth=3,color=red,transp = 0, title = 'Oversold color') //cycler cycler := if myRSI > 69 or myRSI< 31 a = if myRSI > 69 1 // bullish else 2 // bearish a else b = if (nz(cycler[1]) == 1 and myRSI < 39) or (nz(cycler[1]) == 2 and myRSI > 61) 0 else nz(cycler[1]) b mycolor = if cycler == 0 white else c = if cycler == 1 lime else red c plot(showCycler? lvl:na, style = line, color = mycolor, transp = 30, linewidth=2, title = 'Cycler colors')