커뮤니티
문의드립니다
2018-12-23 00:41:49
291
글번호 124688
아래 수식에서 매매시간 설정 수식 추가 부탁드립니다
1. 10시15분~17시
2. 9시~24시
이렇게 2가지 전략으로 부탁드립니다
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);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, 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);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30);
}
답변 1
예스스탁 예스스탁 답변
2018-12-24 09:13:02
안녕하세요
예스스탁입니다.
1
input : starttime(101500),endtime(170000);
var : Tcond(false);
if starttime == 0 Then
{
if sdate != sdate[1] Then
Tcond = true;
}
Else
{
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
Tcond = true;
}
if endtime == 0 then
{
if sdate != sdate[1] Then
Tcond = false;
}
Else
{
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");
}
}
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0);
#상단
TCHAN = HIGHEST(HIGH, LENGTH)[1];
#하단
BCHAN = LOWEST(LOW, LENGTH)[1];
#20지수이평이 60지수이평보다 크면
#다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입
if Tcond == true and 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);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, EntryPrice - PriceScale*30);
}
#20지수이평이 60지수이평보다 작으면
#다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입
if Tcond == true and 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);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30);
}
2
input : starttime(90000),endtime(0);
var : Tcond(false);
if starttime == 0 Then
{
if sdate != sdate[1] Then
Tcond = true;
}
Else
{
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
Tcond = true;
}
if endtime == 0 then
{
if sdate != sdate[1] Then
Tcond = false;
}
Else
{
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");
}
}
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0);
#상단
TCHAN = HIGHEST(HIGH, LENGTH)[1];
#하단
BCHAN = LOWEST(LOW, LENGTH)[1];
#20지수이평이 60지수이평보다 크면
#다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입
if Tcond == true and 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);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, EntryPrice - PriceScale*30);
}
#20지수이평이 60지수이평보다 작으면
#다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입
if Tcond == true and 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);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30);
}
즐거운 하루되세요
> 해피슈 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 아래 수식에서 매매시간 설정 수식 추가 부탁드립니다
1. 10시15분~17시
2. 9시~24시
이렇게 2가지 전략으로 부탁드립니다
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);
#30틱 손실이면 즉시 청산
exitlong("EL_손절",AtStop, 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);
#30틱 손실이면 즉시 청산
exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30);
}