커뮤니티
문의드립니다
2018-12-21 12:33:32
265
글번호 124667
아래 전략 손절이 작동이 잘 안되는거 같은데 검토 부탁드립니다
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0);
TCHAN = HIGHEST(HIGH, LENGTH)[1];
BCHAN = LOWEST(LOW, LENGTH)[1];
if ema(C,20) > ema(C, 60) Then
buy("buy", atlimit, BCHAN);
if MarketPosition == 1 Then {
exitlong("EL_상단터치", atlimit, TCHAN);
exitlong("EL_목표",atlimit, EntryPrice + PriceScale*30);
}
if ema(C,20) < ema(C, 60) Then
sell("sell", atlimit, TCHAN);
if MarketPosition == -1 Then {
exitshort("ES_상단터치", atlimit, BCHAN);
exitshort("ES_목표",atlimit, EntryPrice - PriceScale*30);
}
답변 1
예스스탁 예스스탁 답변
2018-12-21 14:13:29
안녕하세요
예스스탁입니다.
올려주신 수식에 손절의 내용을 가지는 수식이 없습니다.
수식에 주석 남겨드립니다.
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0);
#상단
TCHAN = HIGHEST(HIGH, LENGTH)[1];
#하단
BCHAN = LOWEST(LOW, LENGTH)[1];
#20지수이평이 60지수이평보다 크면
#다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입
if ema(C,20) > ema(C, 60) Then
buy("buy", atlimit, BCHAN);
#매수진입 후
if MarketPosition == 1 Then
{
#상단까지 시세 상승하면 즉시 청산
exitlong("EL_상단터치", atlimit, TCHAN);
#30틱 수익이면 즉시 청산
exitlong("EL_목표",atlimit, EntryPrice + PriceScale*30);
}
#20지수이평이 60지수이평보다 작으면
#다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입
if ema(C,20) < ema(C, 60) Then
sell("sell", atlimit, TCHAN);
#매도진입 후
if MarketPosition == -1 Then
{
#하단까지 시세 하락하면 즉시 청산
exitshort("ES_상단터치", atlimit, BCHAN);
#30틱 수익이면 즉시 청산
exitshort("ES_목표",atlimit, EntryPrice - PriceScale*30);
}
즐거운 하루되세요
> 해피슈 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 아래 전략 손절이 작동이 잘 안되는거 같은데 검토 부탁드립니다
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0);
TCHAN = HIGHEST(HIGH, LENGTH)[1];
BCHAN = LOWEST(LOW, LENGTH)[1];
if ema(C,20) > ema(C, 60) Then
buy("buy", atlimit, BCHAN);
if MarketPosition == 1 Then {
exitlong("EL_상단터치", atlimit, TCHAN);
exitlong("EL_목표",atlimit, EntryPrice + PriceScale*30);
}
if ema(C,20) < ema(C, 60) Then
sell("sell", atlimit, TCHAN);
if MarketPosition == -1 Then {
exitshort("ES_상단터치", atlimit, BCHAN);
exitshort("ES_목표",atlimit, EntryPrice - PriceScale*30);
}