커뮤니티
문의 드립니다.
2015-07-09 13:19:26
173
글번호 88218
42939에 답변 감사합니다.
1-1 수식을 적용해보니 2014년에만 진입이 됩니다.
2015년에는 진입이 한 건도 되지 않네요.
수정 부탁합니다. 감사합니다.
답변 3
예스스탁 예스스탁 답변
2015-07-09 13:59:24
안녕하세요
예스스탁입니다.
1.
우선 수식에 중괄호가 빠진 부분이 있어 수정했습니다.
2
손실이 여러차례 반복되는 경우
계속 2배수를 하게 되어 많은수량이 진입하게 됩니다.
시스템 트레이딩 설정창의 피라미딩탭 하단에 보시면
진입설정에 지정한 주문수량 이상으로는 진입하지 않습니다.
3.
시스템의 손익에는 시스템 트레이딩 설정창의
비용/수량탭의 수수료와 슬리피지가 반영됩니다.
해당 항목을 0으로 지정하고 적용하시기 바랍니다.
아래는 수정한 식입니다.
1-1
input : P(5),기본진입수량(1);
var : sum(0),cnt(0),mav(0);
sum =0;
for cnt = 0 to P-1{
sum = sum + DayClose(cnt);
}
mav = sum/P;
if stime == 151500 Then{
if C > mav Then{
if MarketPosition == 0 Then{
if !(PositionProfit(1) < 0) Then
buy("b11",AtMarket,def,기본진입수량);
Else
buy("b12",AtMarket,def,MaxContracts(1)*2);
if sdate == 20130219 then
MessageLog("%.2f %.f",PositionProfit(1),MaxContracts(1));
}
if MarketPosition == -1 Then{
if PositionProfit < 0 Then
buy("b21",AtMarket,def,MaxContracts*2);
Else
buy("b22",AtMarket,def,기본진입수량);
}
}
if C < mav Then{
if MarketPosition == 0 Then{
if !(PositionProfit(1) < 0) Then
sell("s11",AtMarket,def,기본진입수량);
Else
sell("s12",AtMarket,def,MaxContracts(1)*2);
}
if MarketPosition == 1 Then{
if PositionProfit < 0 Then
sell("s21",AtMarket,def,MaxContracts*2);
Else
sell("bs2",AtMarket,def,기본진입수량);
}
}
}
SetStopLoss(PriceScale*10,PointStop);
SetStopProfittarget(PriceScale*10,PointStop);
1-2
input : P(5),기본진입수량(1);
var : sum(0),cnt(0),mav(0);
sum =0;
for cnt = 0 to P-1{
sum = sum + DayClose(cnt);
}
mav = sum/P;
if stime == 151500 Then{
if C > mav Then{
if MarketPosition == 0 Then{
if !(PositionProfit(1) < 0) Then
buy("b11",AtMarket,def,기본진입수량);
Else
buy("b12",AtMarket,def,MaxContracts(1)*2);
}
if MarketPosition == -1 Then{
if PositionProfit < 0 Then
buy("b21",AtMarket,def,MaxContracts*2);
Else
buy("b22",AtMarket,def,기본진입수량);
}
}
if C < mav Then{
if MarketPosition == 0 Then{
if !(PositionProfit(1) < 0) Then
sell("s11",AtMarket,def,기본진입수량);
Else
sell("s12",AtMarket,def,MaxContracts(1)*2);
}
if MarketPosition == 1 Then{
if PositionProfit Then
sell("s21",AtMarket,def,MaxContracts*2);
Else
sell("bs2",AtMarket,def,기본진입수량);
}
}
}
if MarketPosition == 1 Then{
#10틱 수익
if MaxContracts == 1 Then
ExitLong("bx11",AtLimit,EntryPrice+PriceScale*10,"",1,1);
if MaxContracts >= 2 Then
ExitLong("bx12",AtLimit,EntryPrice+PriceScale*10,"",Floor(MaxContracts*0.5),1);
#15틱 수익
ExitLong("bx2",AtLimit,EntryPrice+PriceScale*15);
#10틱이상 수익후 8틱 감소
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then
ExitLong("bx21",atlimit,highest(H,BarsSinceEntry)-PriceScale*8);
}
if MarketPosition == -1 Then{
#10틱 수익
if MaxContracts == 1 Then
ExitShort("sx11",AtLimit,EntryPrice-PriceScale*10,"",1,1);
if MaxContracts >= 2 Then
ExitShort("sx12",AtLimit,EntryPrice-PriceScale*10,"",Floor(MaxContracts*0.5),1);
#15틱 수익
ExitShort("sx2",AtLimit,EntryPrice-PriceScale*15);
#10틱이상 수익후 8틱 감소
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*10 Then
ExitShort("sx3",atlimit,Lowest(L,BarsSinceEntry)+PriceScale*8);
}
SetStopLoss(PriceScale*10,PointStop);
SetStopProfittarget(PriceScale*10,PointStop);
즐거운 하루되세요
> 고운무지개 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 42939에 답변 감사합니다.
1-1 수식을 적용해보니 2014년에만 진입이 됩니다.
2015년에는 진입이 한 건도 되지 않네요.
수정 부탁합니다. 감사합니다.
고운무지개
2015-07-09 15:07:56
안됩니다.
그리고 1분, 2분, 3분, 5분으로 바꿔서 적용해봤는데 진입하는 날이 전부 다르네요.
제대로 진입도 안하구요.
고운무지개
2015-07-09 15:08:55
다시 부탁합니다.
감사합니다.