커뮤니티
분할 매도
2007-01-26 10:50:09
1690
글번호 11811
코스탁종목 진입시엔 10주 미만도 진입하고자
if CodeCategory() == 1 and CrossUp(C, ma(C,20)) then{
buy("거래소매수", onclose, def, int(int(ACCOUNT/C)/10)*10);
if CodeCategory() == 2 and CrossUp(C, ma(C,20)) then{
buy("코스탁매수", onclose, def, int(ACCOUNT/C)/10*10);
위와같이 매수한후,
임의의 다른 조건에 1/3씩 분할 매도 하려합니다
필요한 시스템식 부탁드립니다.감사합니다
<<수정;추가>>
마지막 1/3매도땐 잔량 모두 매도할 수 있게 하고싶습니다
답변 1
예스스탁 예스스탁 답변
2007-01-29 10:36:45
안녕하세요
예스스탁입니다.
문의하신 식은 다음과 같습니다.
input : ACCOUNT(10000000);
if marketposition() == 0 then{
if CodeCategory() == 1 and CrossUp(C, ma(C,20)) then{
buy("거래소매수", onclose, def, int(int(ACCOUNT/C)/10)*10);
var1 = int(int(ACCOUNT/C)/10)*10;
var2 = int(ceiling((var1/3)/10)*10);
}
if CodeCategory() == 2 and CrossUp(C, ma(C,20)) then{
buy("코스탁매수", onclose, def, int(ACCOUNT/C)/10*10);
var3 = int((ACCOUNT/C)/10*10);
var4 = int(ceiling(var3/3));
}
}
if CodeCategory() == 1 and marketposition() == 1 then{
if crossup(c,ma(c,20)) then
exitlong("청산1", OnClose, DEF, "",var2, 1);
if crossup(c,ma(c,60)) then
exitlong("청산2", OnClose, DEF, "",var2, 1);
if crossup(c,ma(c,120)) then
exitlong("청산3", OnClose, DEF, "",var2, 1);
}
if CodeCategory() == 1 and marketposition() == 1 then{
if crossup(c,ma(c,20)) then
exitlong("청산4", OnClose, DEF, "",var4, 1);
if crossup(c,ma(c,60)) then
exitlong("청산5", OnClose, DEF, "",var4, 1);
if crossup(c,ma(c,120)) then
exitlong("청산6", OnClose, DEF, "",var4, 1);
}
거래소의 경우 금액에 의해 계산된 수량이 50이면
청산은 50/3 = 16.666이 나옵니다..이런 경우 20주씩 청산하게 됩니다.
코스탁의 경우 금액에 의해 계산된 수량이 50이면
청산은 50/3 = 16.666이 나옵니다..이런 경우 17주씩 청산하게 됩니다.
즐거운 하루되세요
> emrfid 님이 쓴 글입니다.
> 제목 : 분할 매도
> 코스탁종목 진입시엔 10주 미만도 진입하고자
if CodeCategory() == 1 and CrossUp(C, ma(C,20)) then{
buy("거래소매수", onclose, def, int(int(ACCOUNT/C)/10)*10);
if CodeCategory() == 2 and CrossUp(C, ma(C,20)) then{
buy("코스탁매수", onclose, def, int(ACCOUNT/C)/10*10);
위와같이 매수한후,
임의의 다른 조건에 1/3씩 분할 매도 하려합니다
필요한 시스템식 부탁드립니다.감사합니다
<<수정;추가>>
마지막 1/3매도땐 잔량 모두 매도할 수 있게 하고싶습니다
다음글
이전글