커뮤니티
청산식문의
2008-08-07 17:02:09
848
글번호 16582
안녕하세요?
아래수식에다가 시간조건에 따른 청산식 부탁드립니다.
시간에 따른 청산 조건은 다음돠 같습니다.
==========
14시 50분부터 1분간격으로 10분간 보유수량의 10%씩 다음봉 시가에 강제청산합니다.
===========
var : excount(0);
if MarketPosition() == 0 and C > O Then
buy("매수",onclose,def,10);
if MarketPosition() == 0 Then
excount = 0;
if MarketPosition() != 0 Then{
if MarketPosition()[1] == 0 Then{
var1 = int(CurrentContracts*0.1);
var2 = int(CurrentContracts*0.2);
var3 = int(CurrentContracts*0.3);
}
if CrossDown(ma(c,5),ma(C,20)) or CrossDown(ma(c,5),ma(C,60)) or CrossDown(Diplus(14),DiMinus(14)) Then
Excount = Excount +1 ;
if excount == 1 Then
exitlong("매수청산1",OnClose,def,"",var1,1);
if excount == 2 Then
exitlong("매수청산2",OnClose,def,"",var2,1);
if excount == 3 Then
exitlong("매수청산3",OnClose,def,"",var3,1);
if excount == 4 Then
exitlong("매수청산4",OnClose,def,"",var3,1);
if excount == 5 Then
exitlong("매수청산5",OnClose,def,"",var3,1);
}
===========
미리감사드립니다
답변 1
예스스탁 예스스탁 답변
2008-08-07 19:11:38
안녕하세요
예스스탁입니다.
var : excount(0);
if MarketPosition() == 0 and C > O Then
buy("매수",onclose,def,10);
if MarketPosition() == 0 Then
excount = 0;
if MarketPosition() != 0 Then{
if MarketPosition()[1] == 0 Then{
var1 = int(CurrentContracts*0.1);
var2 = int(CurrentContracts*0.2);
var3 = int(CurrentContracts*0.3);
}
if CrossDown(ma(c,5),ma(C,20)) or CrossDown(ma(c,5),ma(C,60)) or CrossDown(Diplus(14),DiMinus(14)) Then
Excount = Excount +1 ;
if excount == 1 Then
exitlong("매수청산1",OnClose,def,"",var1,1);
if excount == 2 Then
exitlong("매수청산2",OnClose,def,"",var2,1);
if excount == 3 Then
exitlong("매수청산3",OnClose,def,"",var3,1);
if excount == 4 Then
exitlong("매수청산4",OnClose,def,"",var3,1);
if excount == 5 Then
exitlong("매수청산5",OnClose,def,"",var3,1);
if stime == 145100 Then
exitlong("청산1",OnClose,def,"",var1,1);
if stime == 145200 Then
exitlong("청산2",OnClose,def,"",var1,1);
if stime == 145300 Then
exitlong("청산3",OnClose,def,"",var1,1);
if stime == 145400 Then
exitlong("청산4",OnClose,def,"",var1,1);
if stime == 145500 Then
exitlong("청산5",OnClose,def,"",var1,1);
if stime == 145600 Then
exitlong("청산6",OnClose,def,"",var1,1);
if stime == 145700 Then
exitlong("청산7",OnClose,def,"",var1,1);
if stime == 145800 Then
exitlong("청산8",OnClose,def,"",var1,1);
if stime == 145900 Then
exitlong("청산9",OnClose,def,"",var1,1);
if stime == 150000 Then
exitlong("청산10",OnClose,def,"",var1,1);
}
즐거운 하루되세요
> 송아지 님이 쓴 글입니다.
> 제목 : 청산식문의
> 안녕하세요?
아래수식에다가 시간조건에 따른 청산식 부탁드립니다.
시간에 따른 청산 조건은 다음돠 같습니다.
==========
14시 50분부터 1분간격으로 10분간 보유수량의 10%씩 다음봉 시가에 강제청산합니다.
===========
var : excount(0);
if MarketPosition() == 0 and C > O Then
buy("매수",onclose,def,10);
if MarketPosition() == 0 Then
excount = 0;
if MarketPosition() != 0 Then{
if MarketPosition()[1] == 0 Then{
var1 = int(CurrentContracts*0.1);
var2 = int(CurrentContracts*0.2);
var3 = int(CurrentContracts*0.3);
}
if CrossDown(ma(c,5),ma(C,20)) or CrossDown(ma(c,5),ma(C,60)) or CrossDown(Diplus(14),DiMinus(14)) Then
Excount = Excount +1 ;
if excount == 1 Then
exitlong("매수청산1",OnClose,def,"",var1,1);
if excount == 2 Then
exitlong("매수청산2",OnClose,def,"",var2,1);
if excount == 3 Then
exitlong("매수청산3",OnClose,def,"",var3,1);
if excount == 4 Then
exitlong("매수청산4",OnClose,def,"",var3,1);
if excount == 5 Then
exitlong("매수청산5",OnClose,def,"",var3,1);
}
===========
미리감사드립니다
다음글