커뮤니티
시스템오류
2013-08-14 06:00:08
180
글번호 66422
문의드립니다.
질문1)
아래시스템식으로 적용해보니 22시 이후부터 진입들어가서 매매중 목표수익 20틱이 낫는데도 불구하고 청산되질않고 23:40에 진입해서 01:11에 손절로 마감되었습니다
수정부탁드립니다.
input : 당일손익(20);
var : NP(0),PreNP(0),dayPL(0),DollerToTick(0);
NP = NetProfit;
#초기화 시간
if stime == 070000 or (stime > 070000 and stime[1] < 070000) then
PreNP = NP[1];
#당일 손익(포인트)
DayPL = (NetProfit-PreNP)+PositionProfit;
if (stime > 220000 or stime < 003000) then{ #진입시간
if 매수조건 Then{
if DayPL < 당일손익*PriceScale Then
buy("B1");
Else
ExitShort("eB1");
}
If 매도조건 Then{
if DayPL < 당일손익*PriceScale Then
sell("S1");
Else
ExitLong("eS1");
}
}
질문2) 위식을 아래와 같이 변형했는데 정상적으로 나오질 않습니다...
수정부탁합니다.
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and MarketPosition(1) == 1;
Condition2 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and MarketPosition(1) == -1;
if (stime > 220000 or stime < 003000) then{ #진입시간
if ( var10 == 1 and var20==1 and var11 == 1 and var12== 1 /) and
((MarketPosition == 0 and Condition1 == false) or MarketPosition == 1) Then{
if DayPL < 당일손익*PriceScale Then
buy("B1");
Else
ExitShort("eB1");
}
If ( var10 == -1 and var20==-1 and var11 == -1 and var12== -1 ) and
((MarketPosition == 0 and Condition2 == false) or MarketPosition == -1) Then{
if DayPL < 당일손익*PriceScale Then
sell("S1");
Else
ExitLong("eS1");
}
SetStopLoss(PriceScale*10,PointStop);
- 1. 66856_1.png (0.10 MB)
답변 1
예스스탁 예스스탁 답변
2013-08-14 12:58:27
> 한산도 님이 쓴 글입니다.
> 제목 : 시스템오류
> 문의드립니다.
질문1)
아래시스템식으로 적용해보니 22시 이후부터 진입들어가서 매매중 목표수익 20틱이 낫는데도 불구하고 청산되질않고 23:40에 진입해서 01:11에 손절로 마감되었습니다
수정부탁드립니다.
input : 당일손익(20);
var : NP(0),PreNP(0),dayPL(0),DollerToTick(0);
NP = NetProfit;
#초기화 시간
if stime == 070000 or (stime > 070000 and stime[1] < 070000) then
PreNP = NP[1];
#당일 손익(포인트)
DayPL = (NetProfit-PreNP)+PositionProfit;
if (stime > 220000 or stime < 003000) then{ #진입시간
if 매수조건 Then{
if DayPL < 당일손익*PriceScale Then
buy("B1");
Else
ExitShort("eB1");
}
If 매도조건 Then{
if DayPL < 당일손익*PriceScale Then
sell("S1");
Else
ExitLong("eS1");
}
}
질문2) 위식을 아래와 같이 변형했는데 정상적으로 나오질 않습니다...
수정부탁합니다.
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and MarketPosition(1) == 1;
Condition2 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and MarketPosition(1) == -1;
if (stime > 220000 or stime < 003000) then{ #진입시간
if ( var10 == 1 and var20==1 and var11 == 1 and var12== 1 /) and
((MarketPosition == 0 and Condition1 == false) or MarketPosition == 1) Then{
if DayPL < 당일손익*PriceScale Then
buy("B1");
Else
ExitShort("eB1");
}
If ( var10 == -1 and var20==-1 and var11 == -1 and var12== -1 ) and
((MarketPosition == 0 and Condition2 == false) or MarketPosition == -1) Then{
if DayPL < 당일손익*PriceScale Then
sell("S1");
Else
ExitLong("eS1");
}
SetStopLoss(PriceScale*10,PointStop);