커뮤니티
질문있습니다
2011-09-17 11:10:59
438
글번호 42741
안녕하세요
수식작성예재-기타수식-기타-여러개의 시스템이 혼합되어 있으때 진입조건에 따라서 청산
인데요
//매수식
if bposition != 1 then Begin
if Cond1 then {
buy();
buyCond = 1;
bposition = 1;
}
if Cond2 then {
buy();
buyCond = 2;
bposition = 1;
}
if Cond3 then {
buy();
buyCond = 3;
bposition = 1;
}
End;
//매수청산식
if buyCond == 1 and Cond4 then {
exitlong();
bPosition = 0;
}
if buyCond == 2 and Cond5 then {
exitlong();
bPosition = 0;
}
if buyCond == 3 and Cond6 then {
exitlong();
bPosition = 0;
}
이걸 이렇게 봐꿔도 괜찮은지 알고싶습니다
//매수식
if marketposition==0 then Begin
if Cond1 then {
buy();
buyCond = 1;}
if Cond2 then {
buy();
buyCond = 2;}
if Cond3 then {
buy();
buyCond = 3;}end;
//매수청산식
if buyCond == 1 and Cond4 then {
exitlong();
}
if buyCond == 2 and Cond5 then {
exitlong();
}
if buyCond == 3 and Cond6 then {
exitlong();
}
bposition!=1 이 없어도 모든진입은 marketposition==0 일때만 가능하니까
봐꿔도 되지않을까요?
답변 1
예스스탁 예스스탁 답변
2011-09-19 09:41:58
안녕하세요
예스스탁입니다.
예 작성하신것과 같이 변경하셔도 됩니다.
좀더 간단히는 각 시스템주문함수에 이름을 부여하신 후에
그이름을 가지고 지정하셔도 됩니다.
if Cond1 then
buy("b1");
if Cond2 then
buy("b2");
if Cond3 then
buy("b3");
if IsEntryName("b1") == true and Cond4 then
ExitLong("x1");
if IsEntryName("b2") == true and Cond5 then
ExitLong("x2");
if IsEntryName("b3") == true and Cond6 then
ExitLong("x3");
즐거운 하루되세요
> cinamon 님이 쓴 글입니다.
> 제목 : 질문있습니다
> 안녕하세요
수식작성예재-기타수식-기타-여러개의 시스템이 혼합되어 있으때 진입조건에 따라서 청산
인데요
//매수식
if bposition != 1 then Begin
if Cond1 then {
buy();
buyCond = 1;
bposition = 1;
}
if Cond2 then {
buy();
buyCond = 2;
bposition = 1;
}
if Cond3 then {
buy();
buyCond = 3;
bposition = 1;
}
End;
//매수청산식
if buyCond == 1 and Cond4 then {
exitlong();
bPosition = 0;
}
if buyCond == 2 and Cond5 then {
exitlong();
bPosition = 0;
}
if buyCond == 3 and Cond6 then {
exitlong();
bPosition = 0;
}
이걸 이렇게 봐꿔도 괜찮은지 알고싶습니다
//매수식
if marketposition==0 then Begin
if Cond1 then {
buy();
buyCond = 1;}
if Cond2 then {
buy();
buyCond = 2;}
if Cond3 then {
buy();
buyCond = 3;}end;
//매수청산식
if buyCond == 1 and Cond4 then {
exitlong();
}
if buyCond == 2 and Cond5 then {
exitlong();
}
if buyCond == 3 and Cond6 then {
exitlong();
}
bposition!=1 이 없어도 모든진입은 marketposition==0 일때만 가능하니까
봐꿔도 되지않을까요?
다음글