커뮤니티
청산식 질문했었는데요
2007-07-02 10:22:05
839
글번호 12922
매도진입 후에 매수조건이나 매도청산조건중에 먼저 만족하는
쪽이 진입을 하게 됩니다.
매도청산조건이 먼저 만족하면 진입수량 만큼 청산만 되지만
매수조건이 만족하여 buy에 청산하고 반대방행으로 진입하게 됩니다.
식을 아래와 같이 수정해서 사용하시기 바랍니다.
if marketposition() == 0 and 매수조건 then
buy();
if marketposition() == 1 and 매수청산조건 then
exitlong();
if marketposition() == 0 and 매도조건 then
sell();
if marketposition() == -1 and 매도청산조건 then
exitshort();
즐거운 하루되세요
이렇게 하라고 해서 해봤는데
이렇게 하면 청산 자체를 안하던데요 ..
마켓포지션을 이용한 간단한 식하나만 써주시면 ㄱㅅ하겠습니다.
답변 1
예스스탁 예스스탁 답변
2007-07-02 11:03:39
안녕하세요..예스스탁입니다.
20 이평선 상향돌파시 매수, 5개봉의 최저가 하향이탈시 매수청산
20 이평선 하향돌파시 매도, 5개봉의 최고가 상향돌파시 매도청산으로 식을 작성해 보았습니다.
if marketposition() == 0 and CrossUp(C,ma(C,20)) then
buy();
if marketposition() == 1 and CrossDown(L,lowest(L,5)[1]) then
exitlong();
if marketposition() == 0 and Crossdown(C,ma(C,20)) then
sell();
if marketposition() == -1 and CrossUP(H,highest(H,5)[1]) then
exitshort();
위 식에서 marketposition부분을 제거한 것과 비교해 보시면 차이점을 확인하실 수 있을 것 같습니다.
감사합니다. 즐거운 날 되세요
> lhbae 님이 쓴 글입니다.
> 제목 : 청산식 질문했었는데요
> 매도진입 후에 매수조건이나 매도청산조건중에 먼저 만족하는
쪽이 진입을 하게 됩니다.
매도청산조건이 먼저 만족하면 진입수량 만큼 청산만 되지만
매수조건이 만족하여 buy에 청산하고 반대방행으로 진입하게 됩니다.
식을 아래와 같이 수정해서 사용하시기 바랍니다.
if marketposition() == 0 and 매수조건 then
buy();
if marketposition() == 1 and 매수청산조건 then
exitlong();
if marketposition() == 0 and 매도조건 then
sell();
if marketposition() == -1 and 매도청산조건 then
exitshort();
즐거운 하루되세요
이렇게 하라고 해서 해봤는데
이렇게 하면 청산 자체를 안하던데요 ..
마켓포지션을 이용한 간단한 식하나만 써주시면 ㄱㅅ하겠습니다.