커뮤니티
2번줄,3번줄,수식오류 바로잡아 주세요.
2015-10-21 08:46:19
114
글번호 91508
input:len1(14),len2(50),delay(4),level(0.16),s1(0.37),s2(2.7);
var1=rsi(close,len1)
if var1>llv(1,var1,len2) and low<=llv(1,low,len2) Then
var11=1
Else
var11=-1
end If
if var1<hhv(1,var1,len2) and high>=hhv(1,high,len2) then
var12=1
Else
var12=-1
end If
cond1=hhv(1,var11,delay)=1 and var1>llv(1,var1,len2) and var1<70
cond2=hhv(1,var12,delay)=1 and var1<hhv(1,var1,len2) and var1>30
if tdate<>tdate(1) Then
var50=currententrynum
end If
if currententrynum-var50=0 Then
if ttime<1500 Then
if var1>30 and cond2=false Then
call buy("매수1",atstop,def,opend+(highd(1)-lowd(1))*s1)
end If
if var1<70 and cond1=false Then
call sell("매도1",atstop,def,opend-(highd(1)-lowd(1))*s1)
end If
end If
end If
if currententrynum-var50<=2 Then
if ttime<1500 Then
if cond1 and opend-(highd(1)-lowd(1))*level < close Then
call buy("매수",atstop,def,hhv(1,high,2))
end If
if cond2 and opend+(highd(1)-lowd(1))*level>close Then
call sell("매도",atstop,def,llv(1,low,2))
end If
end If
end If
if position<>0 Then
call exitlong("매수추적",atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
call exitshort("매도추적",atstop,llv(1,low,barnumsinceentry+1)-atr(20)*s2)
답변 1
예스스탁 예스스탁 답변
2015-10-21 11:07:05
안녕하세요
예스스탁입니다.
해당식 예스랭귀지로 작성된 식이 아닙니다.
예스랭귀지로 변환해 올려드립니다.
input:len1(14),len2(50),delay(4),level(0.16),s1(0.37),s2(2.7);
var : cond1(false),cond2(false);
var1 = rsi(len1);
if var1> lowest(var1,len2) and low <= lowest(low,len2) then
var11=1;
Else
var11=-1;
if var1 < highest(var1,len2) and high >= highest(high,len2) then
var12=1;
Else
var12=-1;
cond1 = highest(var11,delay) == 1 and var1 > lowest(var1,len2) and var1<70;
cond2 = highest(var12,delay) == 1 and var1 < highest(var1,len2) and var1>30;
if sdate <> sdate[1] then{
var50=TotalTrades;
}
if TotalTrades-var50 == 0 then{
if stime < 150000 then{
if var1>30 and cond2 == false then{
buy("매수1",atstop,opend(0)+(highd(1)-lowd(1))*s1);
}
if var1<70 and cond1 == false then{
sell("매도1",atstop,def,opend(0)-(highd(1)-lowd(1))*s1);
}
}
}
if TotalTrades-var50 <= 2 then{
if stime < 150000 then{
if cond1 and opend(0)-(highd(1)-lowd(1))*level < close then{
buy("매수",atstop,highest(high,2));
}
if cond2 and opend(0)+(highd(1)-lowd(1))*level>close then{
sell("매도",atstop,lowest(low,2));
}
}
}
if MarketPosition <> 0 then{
exitlong("매수추적",atstop,highest(high,BarsSinceEntry+1)-atr(20)*s2);
exitshort("매도추적",atstop,lowest(low,BarsSinceEntry+1)-atr(20)*s2);
}
즐거운 하루되세요
> 수루지 님이 쓴 글입니다.
> 제목 : 2번줄,3번줄,수식오류 바로잡아 주세요.
> input:len1(14),len2(50),delay(4),level(0.16),s1(0.37),s2(2.7);
var1=rsi(close,len1)
if var1>llv(1,var1,len2) and low<=llv(1,low,len2) Then
var11=1
Else
var11=-1
end If
if var1<hhv(1,var1,len2) and high>=hhv(1,high,len2) then
var12=1
Else
var12=-1
end If
cond1=hhv(1,var11,delay)=1 and var1>llv(1,var1,len2) and var1<70
cond2=hhv(1,var12,delay)=1 and var1<hhv(1,var1,len2) and var1>30
if tdate<>tdate(1) Then
var50=currententrynum
end If
if currententrynum-var50=0 Then
if ttime<1500 Then
if var1>30 and cond2=false Then
call buy("매수1",atstop,def,opend+(highd(1)-lowd(1))*s1)
end If
if var1<70 and cond1=false Then
call sell("매도1",atstop,def,opend-(highd(1)-lowd(1))*s1)
end If
end If
end If
if currententrynum-var50<=2 Then
if ttime<1500 Then
if cond1 and opend-(highd(1)-lowd(1))*level < close Then
call buy("매수",atstop,def,hhv(1,high,2))
end If
if cond2 and opend+(highd(1)-lowd(1))*level>close Then
call sell("매도",atstop,def,llv(1,low,2))
end If
end If
end If
if position<>0 Then
call exitlong("매수추적",atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
call exitshort("매도추적",atstop,llv(1,low,barnumsinceentry+1)-atr(20)*s2)
다음글
이전글