커뮤니티
30550 추가문의입니다.
2013-05-27 22:21:02
197
글번호 63668
30550 문의에 대해 추가 문의드렸습니다.
답변 부탁드립니다.
답변 2
예스스탁 예스스탁 답변
2013-05-28 15:35:14
안녕하세요
예스스탁입니다.
수정한 식입니다.
input : X(0),Y(0);
var : Xcond(false),Ycond(0),YY(0);
var : UPA1(0),DnA1(0),UPA2(0),DnA2(0),UPA3(0),DnA3(0),UPA4(0),DnA4(0);
var : UPB1(0),DnB1(0),UPB2(0),DnB2(0),UPB3(0),DnB3(0),UPB4(0),DnB4(0);
UpA1 = iff(A1 > A1[1],1,0);
UpA2 = iff(A2 > A2[1],1,0);
UpA3 = iff(A3 > A3[1],1,0);
UpA4 = iff(A4 > A4[1],1,0);
UpB1 = iff(B1 > B1[1],1,0);
UpB2 = iff(B2 > B2[1],1,0);
UpB3 = iff(B3 > B3[1],1,0);
UpB4 = iff(B4 > B4[1],1,0);
DnA1 = iff(A1 < A1[1],1,0);
DnA2 = iff(A2 < A2[1],1,0);
DnA3 = iff(A3 < A3[1],1,0);
DnA4 = iff(A4 < A4[1],1,0);
DnB1 = iff(B1 < B1[1],1,0);
DnB2 = iff(B2 < B2[1],1,0);
DnB3 = iff(B3 < B3[1],1,0);
DnB4 = iff(B4 < B4[1],1,0);
XCond = X == 0 and MarketPosition == 0 and ExitDate(1) == sdate and (IsExitName("BL",1) or IsExitName("SL",1));
Ycond = 0;
if MarketPosition == 0 and ExitDate(1) == sdate and (IsExitName("BP1",1) or IsExitName("BP2",1) or IsExitName("SP1",1) or IsExitName("SP2",1)) Then{
if Y == 0 Then
Ycond = 99;
if Y != 0 and MarketPosition == 1 Then
Ycond = 1;
if Y != 0 and MarketPosition == -1 Then
Ycond = -1;
}
if Xcond == false and stime >= 90500 and stime < 143000 then{
if (Ycond == 0 or Ycond == -1) and (UpA1+UpA2+UpA3+UpA4) >= 3 and (UpB1+UpB2+UpB3+UpB4) >= 3 Then
buy();
if (Ycond == 0 or Ycond == 1) and (DnA1+DnA2+DnA3+DnA4) >= 3 and (DnB1+DnB2+DnB3+DnB4) >= 3 Then
sell();
}
if (DnA1+DnA2+DnA3+DnA4) >= 2 and (DnB1+DnB2+DnB3+DnB4) >= 2 Then
ExitLong("bx");
if (UpA1+UpA2+UpA3+UpA4) >= 2 and (UpB1+UpB2+UpB3+UpB4) >= 2 Then
ExitShort("sx");
if MarketPosition == 1 Then{
ExitLong("BL",AtStop,daylow[BarsSinceEntry]-PriceScale*2);
if EntryTime < 93000 Then
ExitLong("BP1",atlimit,daylow*1.01);
Else
ExitLong("BP2",atlimit,EntryPrice*1.005);
}
if MarketPosition == -1 Then{
ExitShort("SL",AtStop,DayHigh[BarsSinceEntry]+PriceScale*2);
if EntryTime < 93000 Then
ExitShort("SP1",atlimit,DayHigh*0.99);
Else
ExitShort("SP2",atlimit,EntryPrice*0.995);
}
SetStopEndofday(150000);
즐거운 하루되세요
> HI_jhy6835 님이 쓴 글입니다.
> 제목 : 30550 추가문의입니다.
> 30550 문의에 대해 추가 문의드렸습니다.
답변 부탁드립니다.
회원
2013-05-29 15:27:24
답변 감사합니다.
다른건 문제없는데, 변수 y를 1로 설정했을때 수익으로 빠져나온 bp1, bp2, spq, sp2의 경우 같은 방향의 진입은 불가하고 반대방향만 진입할 수 있게 말씀 드렸는데, 그냥 신호가 나오면 진입이 되는군요.
즉, y가 0 이 아닐때, 매수된게 진입이 수익 청산되면, 다음 진입은 매도방향만 봅니다.
마찬가지 매도된게 수익청산되면 매수방향만 봅니다.
물론 y=0이면 당일매매는 종료구요.
감사합니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 30550 추가문의입니다.
> 안녕하세요
예스스탁입니다.
수정한 식입니다.
input : X(0),Y(0);
var : Xcond(false),Ycond(0),YY(0);
var : UPA1(0),DnA1(0),UPA2(0),DnA2(0),UPA3(0),DnA3(0),UPA4(0),DnA4(0);
var : UPB1(0),DnB1(0),UPB2(0),DnB2(0),UPB3(0),DnB3(0),UPB4(0),DnB4(0);
UpA1 = iff(A1 > A1[1],1,0);
UpA2 = iff(A2 > A2[1],1,0);
UpA3 = iff(A3 > A3[1],1,0);
UpA4 = iff(A4 > A4[1],1,0);
UpB1 = iff(B1 > B1[1],1,0);
UpB2 = iff(B2 > B2[1],1,0);
UpB3 = iff(B3 > B3[1],1,0);
UpB4 = iff(B4 > B4[1],1,0);
DnA1 = iff(A1 < A1[1],1,0);
DnA2 = iff(A2 < A2[1],1,0);
DnA3 = iff(A3 < A3[1],1,0);
DnA4 = iff(A4 < A4[1],1,0);
DnB1 = iff(B1 < B1[1],1,0);
DnB2 = iff(B2 < B2[1],1,0);
DnB3 = iff(B3 < B3[1],1,0);
DnB4 = iff(B4 < B4[1],1,0);
XCond = X == 0 and MarketPosition == 0 and ExitDate(1) == sdate and (IsExitName("BL",1) or IsExitName("SL",1));
Ycond = 0;
if MarketPosition == 0 and ExitDate(1) == sdate and (IsExitName("BP1",1) or IsExitName("BP2",1) or IsExitName("SP1",1) or IsExitName("SP2",1)) Then{
if Y == 0 Then
Ycond = 99;
if Y != 0 and MarketPosition == 1 Then
Ycond = 1;
if Y != 0 and MarketPosition == -1 Then
Ycond = -1;
}
if Xcond == false and stime >= 90500 and stime < 143000 then{
if (Ycond == 0 or Ycond == -1) and (UpA1+UpA2+UpA3+UpA4) >= 3 and (UpB1+UpB2+UpB3+UpB4) >= 3 Then
buy();
if (Ycond == 0 or Ycond == 1) and (DnA1+DnA2+DnA3+DnA4) >= 3 and (DnB1+DnB2+DnB3+DnB4) >= 3 Then
sell();
}
if (DnA1+DnA2+DnA3+DnA4) >= 2 and (DnB1+DnB2+DnB3+DnB4) >= 2 Then
ExitLong("bx");
if (UpA1+UpA2+UpA3+UpA4) >= 2 and (UpB1+UpB2+UpB3+UpB4) >= 2 Then
ExitShort("sx");
if MarketPosition == 1 Then{
ExitLong("BL",AtStop,daylow[BarsSinceEntry]-PriceScale*2);
if EntryTime < 93000 Then
ExitLong("BP1",atlimit,daylow*1.01);
Else
ExitLong("BP2",atlimit,EntryPrice*1.005);
}
if MarketPosition == -1 Then{
ExitShort("SL",AtStop,DayHigh[BarsSinceEntry]+PriceScale*2);
if EntryTime < 93000 Then
ExitShort("SP1",atlimit,DayHigh*0.99);
Else
ExitShort("SP2",atlimit,EntryPrice*0.995);
}
SetStopEndofday(150000);
즐거운 하루되세요
> HI_jhy6835 님이 쓴 글입니다.
> 제목 : 30550 추가문의입니다.
> 30550 문의에 대해 추가 문의드렸습니다.
답변 부탁드립니다.
이전글