커뮤니티
손절청산
2004-02-09 09:17:32
1388
글번호 2316
수고하십니다.
매수청산시 손절매 기준은 어떻게 하는지요?
예) C < entryPrice(0)-0.25 ||
C < Highest(H,BarsSinceEntry(0)-0.5
라는 조건을 주었는데 안되네요...
그럼 수고하세요...
답변 1
예스스탁 예스스탁 답변
2004-02-09 11:31:31
안녕하세요? 예스스탁입니다...
이동평균선을 기준으로 최대허용손실 예를 다음과 같이 들어보았습니다....
input : shortP(5), longP(20), stoppoint(0.5);
var : 단기이평(0), 장기이평(0);
단기이평 = ma(C,shortP);
장기이평 = ma(C,longP);
if crossup(단기이평, 장기이평) then
buy();
if marketposition() == 1 then {
if crossdown(단기이평, 장기이평) then
exitlong("매수청산");
if C < entryprice() - stoppoint then
exitlong("매수손절");
}
if crossdown(단기이평, 장기이평) then
sell();
if marketposition() == -1 then {
if crossup(단기이평, 장기이평) then
exitshort("매도청산");
if C > entryprice() + stoppoint then
exitshort("매도손절");
}
즐거운 하루 되세요...
> blashey 님이 쓴 글입니다.
> 제목 : 손절청산
> 수고하십니다.
매수청산시 손절매 기준은 어떻게 하는지요?
예) C < entryPrice(0)-0.25 ||
C < Highest(H,BarsSinceEntry(0)-0.5
라는 조건을 주었는데 안되네요...
그럼 수고하세요...
다음글