답변완료
익절 수식 오류
다음과 같이 제대로 된 익절수식을 EL1, 2, 3, 4에 넣었습니다.
EL1, EL2는 항상 익절인데, EL3, EL4는 손절이 나오기도 합니다.
무슨 문제가 있는걸까요?
If COND == 1 Then
{
Buy("B0", OnClose, Def, 1);
EnPrice = C;
}
If COND == 1 AND MarketPosition > 0 Then
{
If B_Count > 30 Then
{
If COND_A == True AND COND_B == True AND COND_C == True Then
{
Buy("B3", OnClose, Def, 1);
EnPrice1 = C;
}
If COND_A == True AND COND_B == True AND COND_D == True Then
{
Buy("B4", OnClose, Def, 1);
EnPrice2 = C;
}
}
If C > EnPrice*(1+0.03) Then
{
ExitLong("EL1", OnClose, Def, "B0", 1, 1);
}
If C > EnPrice*(1+0.06) Then
{
ExitLong("EL2", OnClose, Def, "B0", 1, 1);
}
If C > EnPrice1*(1+0.020) Then
{
ExitLong("EL3", OnClose, Def, "B3", 1, 1);
}
If C > EnPrice2*(1+0.020) Then
{
ExitLong("EL4", OnClose, Def, "B4", 1, 1);
}
}
2023-04-26
832
글번호 168502
시스템
답변완료
수식 문의
안녕하세요. 아래의 트뷰수식을 예스로 변환하고 싶습니다.
친절한 도움 항상 감사드립니다.
indicator("RSI TREND FILTER",overlay=true)
showrsi=input.bool(false,title='Show RSI Cloud',group='RSI ')
showmidband=input.bool(false,title='Show RSI Mid Band',group='RSI ')
showgrid=input.bool(false,title='Show RSI Levels',group='RSI Levels')
grid=input.color(color.rgb(26, 22, 22, 34),'RSI LEVELS',group='RSI Levels')
rsilen=input.int(14,'RSI LENGTH',group='RSI')
rsima=input.int(100,'RSI 50 level',group='RSI')
emalen=input.int(20,'RSI EMA Length',group='RSI')
orsi=ta.rsi(close,rsilen)
adjrsi=close+ta.atr(100)*orsi/100
rma=ta.ema(adjrsi,rsima)
r1=plot(showrsi?adjrsi:na,display=display.all,title='RSI')
r2=plot(rma,color=open>rma?#00ff08:open<rma?#ff0404:color.white,title='RSI MA',linewidth=2)
fill(r1,r2,color=adjrsi>rma?color.rgb(76, 175, 79, 70):color.rgb(255, 82, 82, 75),title='RSI Cloud',display=showrsi?display.all:display.none)
level2=input.float(10,'RSI LEVEL2',minval=10,maxval=100,group='RSI Levels')
rmau=rma+ta.atr(100)*level2/10
rmal=rma-ta.atr(100)*level2/10
u=plot(rmau,display=showgrid?display.all:display.none,title='70',color=grid)
l=plot(rmal,display=showgrid?display.all:display.none,title='30',color=grid)
fill(u,l,color=color.rgb(232, 237, 242, 82),title='RSI ZeroBand',display=showmidband?display.all:display.none)
level3=input.float(40,'RSI LEVEL3',minval=10,maxval=100,group='RSI Levels')
rmau3=rma+ta.atr(100)*level3/10
rmal3=rma-ta.atr(100)*level3/10
o8=plot(rmau3,display=showgrid?display.all:display.none,title='80',color=grid)
o2=plot(rmal3,display=showgrid?display.all:display.none,title='20',color=grid)
level5=input.float(50,'RSI LEVEL5',minval=10,maxval=100,group='RSI Levels')
rmau5=rma+ta.atr(100)*level5/10
rmal5=rma-ta.atr(100)*level5/10
ul=plot(rmau5,color=grid,display=showgrid?display.all:display.none,title='100')
ll=plot(rmal5,color=grid,display=showgrid?display.all:display.none,title='0')
fill(o8,ul,color=color.rgb(232, 4, 205, 45),title='OverBought')
fill(o2,ll,color=color.rgb(9, 198, 15, 53),title='OverSold')
fill(r2,ul,color=color.rgb(76, 175, 79, 85),title='UP TREND')
fill(r2,ll,color=color.rgb(175, 76, 167, 85),title='DOWN TREND')
rsiMA=ta.ema(adjrsi,emalen)
plot(rsiMA,color=color.yellow)
2023-04-26
1026
글번호 168491
지표