커뮤니티
시스템식 문의
2012-01-27 23:52:02
345
글번호 47013
늘
고마운 마음입니다.
- 1. 문의.zip (0.01 MB)
답변 1
예스스탁 예스스탁 답변
2012-01-30 11:50:13
안녕하세요
예스스탁입니다.
1.
input : N(5),m1(1),m2(1),K(1);
var1 = (dayindex+1)%N;
if date != date[1] Then
Condition1 = False;
if MarketPosition != 0 Then
Condition1 = True;
if dayindex >= 0 and var1 == 0 Then{
if (MarketPosition == 0 and C >= dayopen+m1 and Condition1 == false and stime < 143000) or
(MarketPosition == 1 and C >= value1+m1 and Condition1 == true and stime < 145000) Or
(MarketPosition == 0 and C >= ExitPrice(1)+m1 and Condition1 == true and stime < 143000) then{
buy("b",OnClose,def,K);
value1 = C;
}
if (MarketPosition == 0 and C <= dayopen-m2 and Condition1 == false and stime < 143000) or
(MarketPosition == -1 and C <= value1-m2 and Condition1 == true and stime < 145000) Or
(MarketPosition == 0 and C <= ExitPrice(1)-m2 and Condition1 == true and stime < 143000) then{
sell("s",OnClose,def,K);
value1 = C;
}
}
if (MarketPosition == 1 and C <= value1-m1) Then{
ExitLong();
}
if (MarketPosition == -1 and C >= value1+m2) Then
ExitShort();
SetStopEndofday(150000);
2.
input : m1(0.5),m2(0.5),K(1);
if date != date[1] Then
Condition1 = False;
if MarketPosition != 0 Then{
Condition1 = True;
}
if CurrentContracts != CurrentContracts[1] Then{
value3 = C;
value4 = index;
}
if stime == 151500 Then{
buy("b",AtStop,NextBarOpen+m1,k);
sell("s",AtStop,NextBarOpen-m2,k);
}
if dayindex >= 0 Then{
if (MarketPosition == 0 and Condition1 == false and stime < 143000) Then
buy("b1",AtStop,dayopen+m1,k);
if (MarketPosition == 1 and Condition1 == true and stime < 145000) Then
buy("bb",AtStop,value3+m1,k);
if (MarketPosition == 0 and Condition1 == true and stime < 143000) then
buy("b2",AtStop,value3+m1,K);
if (MarketPosition == 0 and Condition1 == false and stime < 143000) Then
sell("s1",AtStop,dayopen-m2,k);
if (MarketPosition == -1 and Condition1 == true and stime < 145000) Then
Sell("ss",AtStop,value3-m2,k);
if (MarketPosition == 0 and Condition1 == true and stime < 143000) then
sell("s2",AtStop,value3-m2,K);
}
if MarketPosition == 1 Then{
if CurrentContracts < CurrentContracts[1] Then
value1 = value1+1;
if CurrentContracts > CurrentContracts[1] Then{
value1 = 0;
value11 = index;
}
ExitLong("bx",AtStop,highest(h,(index-value11)+1)-(m2*(1+value1)),"",k,1);
}
Else
value1 = 0;
if MarketPosition == -1 Then{
if CurrentContracts < CurrentContracts[1] Then
value2 = value2+1;
if CurrentContracts > CurrentContracts[1] Then{
value2 = 0;
value22 = index;
}
ExitShort("sx",AtStop,Lowest(L,(index-value22)+1)+(m2*(1+value2)),"",k,1);
}
Else
value2 = 0;
SetStopEndofday(150000);
3.
input : m1(0.5),m2(0.5),K(1);
if date != date[1] Then
Condition1 = False;
if MarketPosition != 0 Then{
Condition1 = True;
}
if CurrentContracts != CurrentContracts[1] Then{
value3 = C;
value4 = index;
}
if stime == 151500 Then{
buy("b",AtStop,NextBarOpen+m1,k);
sell("s",AtStop,NextBarOpen-m2,k);
}
if dayindex >= 0 Then{
if (MarketPosition == 0 and Condition1 == false and stime < 143000) Then
buy("b1",AtStop,dayopen+m1,k);
if (MarketPosition == 1 and Condition1 == true and stime < 145000) Then
buy("bb",AtStop,value3+m1,k);
if (MarketPosition == 0 and Condition1 == true and stime < 143000) then
buy("b2",AtStop,value3+m1,K);
if (MarketPosition == 0 and Condition1 == false and stime < 143000) Then
sell("s1",AtStop,dayopen-m2,k);
if (MarketPosition == -1 and Condition1 == true and stime < 145000) Then
Sell("ss",AtStop,value3-m2,k);
if (MarketPosition == 0 and Condition1 == true and stime < 143000) then
sell("s2",AtStop,value3-m2,K);
}
if MarketPosition == 1 Then{
if MaxEntries <= 2 Then{
if CurrentContracts < CurrentContracts[1] Then
value1 = value1+1;
if CurrentContracts > CurrentContracts[1] Then{
value1 = 0;
value11 = index;
}
ExitLong("bx",AtStop,highest(h,(index-value11)+1)-(m2*(1+value1)),"",k,1);
}
}
Else
value1 = 0;
if MarketPosition == -1 then{
if maxEntries <= 2 Then{
if CurrentContracts < CurrentContracts[1] Then
value2 = value2+1;
if CurrentContracts > CurrentContracts[1] Then{
value2 = 0;
value22 = index;
}
ExitShort("sx",AtStop,Lowest(L,(index-value22)+1)+(m2*(1+value2)),"",k,1);
}
}
Else
value2 = 0;
if MarketPosition == 1 Then{
if MaxEntries >= 3 Then{
if CurrentContracts < CurrentContracts[1] Then{
value1 = value1+1;
Condition11 = true;
}
if CurrentContracts > CurrentContracts[1] Then{
value1 = 0;
value11 = index;
Condition11 = false;
}
if Condition11 == False Then
ExitLong("bx1",AtStop,highest(h,(index-value11)+1)-(m2*(1+value1)),"",int(CurrentContracts*0.5),1);
if Condition11 == true Then
ExitLong("bx2",AtStop,highest(h,(index-value11)+1)-(m2*(1+value1)));
}
}
Else{
value1 = 0;
Condition11 = false;
}
if MarketPosition == -1 Then{
if MaxEntries >= 3 Then{
if CurrentContracts < CurrentContracts[1] Then{
value2 = value2+1;
Condition22 = true;
}
if CurrentContracts > CurrentContracts[1] Then{
value2 = 0;
value22 = index;
Condition22 = false;
}
if Condition22 == false then
ExitShort("sx1",AtStop,Lowest(L,(index-value22)+1)+(m2*(1+value2)),"",int(CurrentContracts*0.5),1);
if Condition22 == true Then
ExitShort("sx2",AtStop,Lowest(L,(index-value22)+1)+(m2*(1+value2)));
}
}
Else{
value2 = 0;
Condition22 = false;
}
SetStopEndofday(150000);
즐거운 하루되세요
> 에구머니 님이 쓴 글입니다.
> 제목 : 시스템식 문의
> 늘
고마운 마음입니다.
다음글
이전글