커뮤니티
시스템 진입시기 조정
2014-11-23 17:15:48
131
글번호 80645
항상 감사드립니다
아래 시스템식에서 첫번째 신호는 무시하고 두번째 신호부터 시스템신호를 발생시키고 싶습니다
##################################################
##### 당일 08:00 장시작 / 익일 04:30 장종료 #####
##################################################
input : 시작시간(080000),끝시간(043000);
var : Start(false),entrycnt(0),Bcond(false),Scond(false),idx(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Start = True;
entrycnt = entrycnt+1;
Idx = 0;
}
Idx = idx+1;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
Start = false;
Bcond = c>Hma1 and c>var78 and var58==1 and cma1>var78 ;
Scond = c<Lma1 and c<var78 and var58==-1 and cma1<var78 ;
Condition1 = ExitDate(1) == true and MarketPosition(1) == 1 and
(IsExitName("eB50",1) == true or IsExitName("StopLoss",1) == true);
Condition2 = ExitDate(1) == true and MarketPosition(1) == -1 and
(IsExitName("eS50",1) == true or IsExitName("StopLoss",1) == true);
if Idx >= 1 and
Start == true and
Bcond == true and
(MarketPosition == -1 or (MarketPosition == 0 and Condition1 == False ))Then
buy("B2");
if Idx >= 1 and
Start == true and
Scond == true and
(MarketPosition == 1 or (MarketPosition == 0 and Condition2 == False )) Then
sell("S2");
##손절_3_30틱 자동손절##
SetStopLoss(PriceScale*30,PointStop);
###############################
##### 매일 04:30 강제청산 #####
###############################
if stime == 043000 or (stime > 043000 and stime[1] < 043000) Then{
exitlong("당일매수청산");
ExitShort("당일매도청산")
감사합니다
답변 1
예스스탁 예스스탁 답변
2014-11-24 19:03:34
안녕하세요
예스스탁입니다.
아래내용 참고하시기 바랍니다.
input : 시작시간(080000),끝시간(043000);
var : Start(false),entrycnt(0),Bcond(false),Scond(false),idx(0),Ventry(0),Vposition(0),Vprice(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Start = True;
entrycnt = entrycnt+1;
Idx = 0;
Ventry = 0;
Vposition = 0;
Vprice = 0;
}
Idx = idx+1;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = entrycnt+1;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
Start = false;
Bcond = c>Hma1 and c>var78 and var58==1 and cma1>var78 ;
Scond = c<Lma1 and c<var78 and var58==-1 and cma1<var78 ;
Condition1 = ExitDate(1) == true and MarketPosition(1) == 1 and
(IsExitName("eB50",1) == true or IsExitName("StopLoss",1) == true);
Condition2 = ExitDate(1) == true and MarketPosition(1) == -1 and
(IsExitName("eS50",1) == true or IsExitName("StopLoss",1) == true);
if Ventry == 0 and
Idx >= 1 and
Start == true and
Bcond == true Then{
Ventry = 1;
Vposition = 1;
VPrice = C;
}
if Ventry == 0 and
Idx >= 1 and
Start == true and
Scond == true Then{
Ventry = 1;
Vposition = -1;
Vprice = C;
}
if Ventry == true Then{
if Vposition == 1 and L <= Vprice-PriceScale*30 Then
Ventry = 2;
if Vposition == -1 and H >= Vprice+PriceScale*30 Then
Ventry = 2;
}
if Idx >= 1 and
Start == true and
Bcond == true Then{
if Entrycnt == 0 and Ventry == 1 and Vposition == -1 Then
buy("B11");
if Entrycnt == 0 and Ventry == 2 and Vposition != 1 Then
buy("B12");
if (Entrycnt >= 1 and (MarketPosition == -1 or (MarketPosition == 0 and Condition1 == False ))) Then{
buy("B2");
}
}
if Idx >= 1 and
Start == true and
Scond == true then{
if Entrycnt == 0 and Ventry == 1 and Vposition == 1 Then
sell("S11");
if Entrycnt == 0 and Ventry == 2 and Vposition != -1 Then
sell("S12");
if (Entrycnt >= 1 and (MarketPosition == -1 or (MarketPosition == 0 and Condition2 == False ))) Then{
sell("S2");
}
}
##손절_3_30틱 자동손절##
SetStopLoss(PriceScale*30,PointStop);
###############################
##### 매일 04:30 강제청산 #####
###############################
if stime == 043000 or (stime > 043000 and stime[1] < 043000) Then{
exitlong("당일매수청산");
ExitShort("당일매도청산");
}
즐거운 하루되세요
> 조민철 님이 쓴 글입니다.
> 제목 : 시스템 진입시기 조정
> 항상 감사드립니다
아래 시스템식에서 첫번째 신호는 무시하고 두번째 신호부터 시스템신호를 발생시키고 싶습니다
##################################################
##### 당일 08:00 장시작 / 익일 04:30 장종료 #####
##################################################
input : 시작시간(080000),끝시간(043000);
var : Start(false),entrycnt(0),Bcond(false),Scond(false),idx(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Start = True;
entrycnt = entrycnt+1;
Idx = 0;
}
Idx = idx+1;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
Start = false;
Bcond = c>Hma1 and c>var78 and var58==1 and cma1>var78 ;
Scond = c<Lma1 and c<var78 and var58==-1 and cma1<var78 ;
Condition1 = ExitDate(1) == true and MarketPosition(1) == 1 and
(IsExitName("eB50",1) == true or IsExitName("StopLoss",1) == true);
Condition2 = ExitDate(1) == true and MarketPosition(1) == -1 and
(IsExitName("eS50",1) == true or IsExitName("StopLoss",1) == true);
if Idx >= 1 and
Start == true and
Bcond == true and
(MarketPosition == -1 or (MarketPosition == 0 and Condition1 == False ))Then
buy("B2");
if Idx >= 1 and
Start == true and
Scond == true and
(MarketPosition == 1 or (MarketPosition == 0 and Condition2 == False )) Then
sell("S2");
##손절_3_30틱 자동손절##
SetStopLoss(PriceScale*30,PointStop);
###############################
##### 매일 04:30 강제청산 #####
###############################
if stime == 043000 or (stime > 043000 and stime[1] < 043000) Then{
exitlong("당일매수청산");
ExitShort("당일매도청산")
감사합니다