커뮤니티
시초가 갭발생시 진입금지 추가조건 시스템식
2016-04-18 09:06:32
164
글번호 97168
항상감사드립니다
아래시스템식에 다음조건을 추가하고 싶습니다
추가조건: 장시작시 시초가가 전일종가대비 갭상승(+20틱이상)또는 갭하락(-20틱이상)시
첫번째신호 발생금지,두번째 신호부터 발생
var : entrycnt(0),cond(false);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then{ # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
cond = false;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
cond = false;
if entrycnt >= 2 Then{
if MarketPosition == 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
cond = true;
if MarketPosition != 0 and PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
cond = true;
}
if (stime >= 170000 or stime < 143000) and (DayPL < 당일손익*PriceScale) Then{ # 현지시간_뉴욕 17:00 장시작~익일 14:30 장종료 #
##############################
##### 1_ 매매식 #####
##############################
if ((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)))) and #동일방향 재진입금지#
c>v25 Then{
if cond == false Then
buy("B_uparoon");
Else
ExitShort();
}
if ((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)))) and #동일방향 재진입금지#
c<v27 Then{
if cond == false Then
sell("S_dnaroon");
Else
ExitLong();
}
}
감사합니다...
답변 1
예스스탁 예스스탁 답변
2016-04-18 19:38:04
안녕하세요
예스스탁입니다.
조건에 따라 신호를 하나 건너뛰는 부분은
가상 내역이므로 식작성이 쉬운 부분은 아닙니다.
진입뿐만아니라 전략에 따라 맞춰가며 작성해야 합니다.
아래 추가되 내용 참고하셔서 수정보완해 사용하시기 바랍니다
var : entrycnt(0),cond(false),T(0),count(0),gap(false);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then{ # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
cond = false;
T = 0;
if O > C[1]+PriceScale*20 or C <= C[1]-PriceScale*20 Then
gap = true;
Else
gap = false;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
cond = false;
if entrycnt >= 2 Then{
if MarketPosition == 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
cond = true;
if MarketPosition != 0 and PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
cond = true;
}
if (stime >= 170000 or stime < 143000) and (DayPL < 당일손익*PriceScale) Then{ # 현지시간_뉴욕 17:00 장시작~익일 14:30 장종료 #
##############################
##### 1_ 매매식 #####
##############################
if T <= 0 and
((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)))) and #동일방향 재진입금지#
c>v25 Then{
T = 1;
count = count+1;
if cond == false and (gap == false or (gap == true and count >= 2)) Then
buy("B_uparoon");
Else
ExitShort();
}
if T >= 0 and
((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)))) and #동일방향 재진입금지#
c<v27 Then{
T = -1;
count = count+1;
if cond == false and (gap == false or (gap == true and count >= 2)) Then
sell("S_dnaroon");
Else
ExitLong();
}
}
즐거운 하루되세요
> 조민철 님이 쓴 글입니다.
> 제목 : 시초가 갭발생시 진입금지 추가조건 시스템식
> 항상감사드립니다
아래시스템식에 다음조건을 추가하고 싶습니다
추가조건: 장시작시 시초가가 전일종가대비 갭상승(+20틱이상)또는 갭하락(-20틱이상)시
첫번째신호 발생금지,두번째 신호부터 발생
var : entrycnt(0),cond(false);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then{ # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
cond = false;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
cond = false;
if entrycnt >= 2 Then{
if MarketPosition == 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
cond = true;
if MarketPosition != 0 and PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
cond = true;
}
if (stime >= 170000 or stime < 143000) and (DayPL < 당일손익*PriceScale) Then{ # 현지시간_뉴욕 17:00 장시작~익일 14:30 장종료 #
##############################
##### 1_ 매매식 #####
##############################
if ((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)))) and #동일방향 재진입금지#
c>v25 Then{
if cond == false Then
buy("B_uparoon");
Else
ExitShort();
}
if ((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)))) and #동일방향 재진입금지#
c<v27 Then{
if cond == false Then
sell("S_dnaroon");
Else
ExitLong();
}
}
감사합니다...
다음글
이전글