커뮤니티
문의드립니다
2019-01-02 17:05:48
184
글번호 124889
아래 수식에서 오전 9시30뷴 ~24시 까지 매매시간 추가 부탁드립니다
INPUT : LENGTH(10),익절틱수(20),손절틱수(20);
VAR : TCHAN(0), BCHAN(0);
#상단
TCHAN = HIGHEST(HIGH, LENGTH)[1];
#하단
BCHAN = LOWEST(LOW, LENGTH)[1];
#10지수이평이 60지수이평보다 크면
#다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입
if ema(C,10) > ema(C, 60) and
MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 20)) Then
buy("buy", atlimit, BCHAN);
#매수진입 후
if MarketPosition == 1 Then
{
#상단까지 시세 상승하면 즉시 청산
exitlong("EL_상단터치", atlimit, TCHAN);
#30틱 수익이면 즉시 청산
exitlong("EL_익절",atlimit, EntryPrice + PriceScale*익절틱수);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, EntryPrice - PriceScale*손절틱수);
}
#10지수이평이 60지수이평보다 작으면
#다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입
if ema(C,10) < ema(C, 60) and
MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 20)) Then
sell("sell", atlimit, TCHAN);
#매도진입 후
if MarketPosition == -1 Then
{
#하단까지 시세 하락하면 즉시 청산
exitshort("ES_하단터치", atlimit, BCHAN);
#30틱 수익이면 즉시 청산
exitshort("ES_익절",atlimit, EntryPrice - PriceScale*익절틱수);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*손절틱수);
}
답변 1
예스스탁 예스스탁 답변
2019-01-03 10:52:19
안녕하세요
예스스탁입니다.
INPUT : LENGTH(10),익절틱수(20),손절틱수(20);
VAR : TCHAN(0), BCHAN(0);
input : starttime(93000),endtime(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
#상단
TCHAN = HIGHEST(HIGH, LENGTH)[1];
#하단
BCHAN = LOWEST(LOW, LENGTH)[1];
#10지수이평이 60지수이평보다 크면
#다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입
if Tcond == TRUE AND
ema(C,10) > ema(C, 60) and
MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 20)) Then
buy("buy", atlimit, BCHAN);
#매수진입 후
if MarketPosition == 1 Then
{
#상단까지 시세 상승하면 즉시 청산
exitlong("EL_상단터치", atlimit, TCHAN);
#30틱 수익이면 즉시 청산
exitlong("EL_익절",atlimit, EntryPrice + PriceScale*익절틱수);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, EntryPrice - PriceScale*손절틱수);
}
#10지수이평이 60지수이평보다 작으면
#다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입
if Tcond == true and
ema(C,10) < ema(C, 60) and
MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 20)) Then
sell("sell", atlimit, TCHAN);
#매도진입 후
if MarketPosition == -1 Then
{
#하단까지 시세 하락하면 즉시 청산
exitshort("ES_하단터치", atlimit, BCHAN);
#30틱 수익이면 즉시 청산
exitshort("ES_익절",atlimit, EntryPrice - PriceScale*익절틱수);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*손절틱수);
}
즐거운 하루되세요
> 해피슈 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 아래 수식에서 오전 9시30뷴 ~24시 까지 매매시간 추가 부탁드립니다
INPUT : LENGTH(10),익절틱수(20),손절틱수(20);
VAR : TCHAN(0), BCHAN(0);
#상단
TCHAN = HIGHEST(HIGH, LENGTH)[1];
#하단
BCHAN = LOWEST(LOW, LENGTH)[1];
#10지수이평이 60지수이평보다 크면
#다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입
if ema(C,10) > ema(C, 60) and
MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 20)) Then
buy("buy", atlimit, BCHAN);
#매수진입 후
if MarketPosition == 1 Then
{
#상단까지 시세 상승하면 즉시 청산
exitlong("EL_상단터치", atlimit, TCHAN);
#30틱 수익이면 즉시 청산
exitlong("EL_익절",atlimit, EntryPrice + PriceScale*익절틱수);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, EntryPrice - PriceScale*손절틱수);
}
#10지수이평이 60지수이평보다 작으면
#다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입
if ema(C,10) < ema(C, 60) and
MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 20)) Then
sell("sell", atlimit, TCHAN);
#매도진입 후
if MarketPosition == -1 Then
{
#하단까지 시세 하락하면 즉시 청산
exitshort("ES_하단터치", atlimit, BCHAN);
#30틱 수익이면 즉시 청산
exitshort("ES_익절",atlimit, EntryPrice - PriceScale*익절틱수);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*손절틱수);
}