답변완료
예스수식으로 변환 부탁 드립니다.
//@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')
2024-06-07
939
글번호 180408
지표
답변완료
수식 부탁드립니다.
아래 수식에서 최고건수 와 최저건수 의 값을 표기하고 싶습니다.
#Data6 : 선물매수호가총건수
#Data7 : 선물매도호가총건수
var : TL1(0,data1),TL2(0,data1),TL3(0,data1),TL4(0,data1);
var : diff(0,data1),hh(0,data1),ll(0,data1);
diff = data6(c)-data7(c);
if bdate != bdate[1] Then
{
hh = diff;
ll = diff;
TL_Delete(TL1);
TL_Delete(TL2);
TL1 = TL_New(sdate,stime,H,NextBarSdate,NextBarStime,H);
TL2 = TL_New(sdate,stime,L,NextBarSdate,NextBarStime,L);
TL_Delete(TL3);
TL_Delete(TL4);
TL3 = TL_New(sdate,stime,H,Sdate,Stime,H);
TL4 = TL_New(sdate,stime,L,Sdate,Stime,L);
}
else
{
if diff > hh Then
{
hh = diff;
TL_SetBegin(TL3,sdate,stime,TL_GetValue(TL1,sdate,stime));
TL_Setend(TL3,NextBarSdate,NextBarStime,TL_GetValue(TL1,sdate,stime));
TL_SetBegin(TL1,sdate,stime,h);
TL_Setend(TL1,NextBarSdate,NextBarStime,h);
}
if diff < ll Then
{
ll = diff;
TL_SetBegin(TL4,sdate,stime,TL_GetValue(TL2,sdate,stime));
TL_Setend(TL4,NextBarSdate,NextBarStime,TL_GetValue(TL2,sdate,stime));
TL_SetBegin(TL2,sdate,stime,l);
TL_Setend(TL2,NextBarSdate,NextBarStime,l);
}
}
TL_SetExtRight(TL1,true);
TL_SetExtLeft(TL1,true);
TL_SetExtRight(TL2,true);
TL_SetExtLeft(TL2,true);
TL_SetSize(TL1,2);
TL_SetSize(TL2,2);
TL_SetColor(TL1,RED);
TL_SetColor(TL2,BLUE);
TL_SetExtRight(TL3,true);
TL_SetExtLeft(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtLeft(TL4,true);
TL_SetSize(TL3,2);
TL_SetSize(TL4,2);
TL_SetColor(TL3,MAGENTA);
TL_SetColor(TL4,CYAN);
plot1(hh,"최고건수차",RED);
plot2(ll,"최저건수차",blue);
2024-06-07
974
글번호 180406
지표