커뮤니티
문의 드립니다
2008-12-30 08:44:39
929
글번호 19104
var : cnt(0),count(0),Bval(0),Bval1(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count == 0 and MarketPosition() == 0 then{
if crossup(ma(c,5),ma(c,20)) Then{
buy("AA");
Bval =C; //첫진입가
}
}
if count > 0 and count < 5 and MarketPosition() == 0 then{
if crossup (C, Bval*1.05) Then{
buy("CC");
Bval1 = C; }}
SetStopProfittarget(3);
SetStopLoss(2);
상기수식에서 첫진입한 "AA"의 매수포지션을 특정시간 12:00 ~ 12:50 사이에서
첫진입가 Bval의 0.05%하향이탈할 경우에 별도로 ExitLong 할수 있나요.
만약에 CC포지션이 같이 있다면 CC포지션을 그대로 둔상황에서 가능한가요.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2008-12-30 10:45:11
안녕하세요
예스스탁입니다.
분할 청산을 하기 위해서는 식에서 수량을 지정해 주셔야 합니다.
input : 주문수량(1);
var : cnt(0),count(0),Bval(0),Bval1(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count == 0 and MarketPosition() == 0 then{
if crossup(ma(c,5),ma(c,20)) Then{
buy("AA",OnClose,def,주문수량);
Bval =C; //첫진입가
}
}
if count > 0 and count < 5 and MarketPosition() == 0 then{
if crossup (C, Bval*1.05) Then{
buy("CC",OnClose,def,주문수량);
Bval1 = C;
}
}
#12시에서~12시 50분사이에 첫진입가의 0.05% 하락하면 청산
if stime >= 120000 and stime <= 125000 Then
exitlong("X",AtStop,EntryPrice*0.95,"AA",주문수량,1);
SetStopProfittarget(3);
SetStopLoss(2);
즐거운 하루되세요
> 시골길 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> var : cnt(0),count(0),Bval(0),Bval1(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count == 0 and MarketPosition() == 0 then{
if crossup(ma(c,5),ma(c,20)) Then{
buy("AA");
Bval =C; //첫진입가
}
}
if count > 0 and count < 5 and MarketPosition() == 0 then{
if crossup (C, Bval*1.05) Then{
buy("CC");
Bval1 = C; }}
SetStopProfittarget(3);
SetStopLoss(2);
상기수식에서 첫진입한 "AA"의 매수포지션을 특정시간 12:00 ~ 12:50 사이에서
첫진입가 Bval의 0.05%하향이탈할 경우에 별도로 ExitLong 할수 있나요.
만약에 CC포지션이 같이 있다면 CC포지션을 그대로 둔상황에서 가능한가요.
감사합니다.