커뮤니티
32899 재부탁
2013-10-25 02:13:21
131
글번호 68822
알려주셔서 감사합니다
그런데 시험적용 해보니 매수금액 (1000만) 의 20%씩
5회에 분할매수 경우
첫번째와 두번째에 매수물량이 있지만
세번째 ~5번째 매수점에서는 수량이 1주만 매수나타남
5회에 걸쳐 같은 비중으로 분할매수 시스템식 부타합니다
답변 1
예스스탁 예스스탁 답변
2013-10-25 14:40:54
안녕하세요
예스스탁입니다.
식을 수정했습니다.
input : 투자금액(1000000),진입당비중(20);
var : Vol(0),xvol1(0),xvol2(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then
vol = int(int((투자금액*(진입당비중/100))/C)/10)*10;
Else
vol = int((투자금액*(진입당비중/100))/C);
if MarketPosition == 0 and crossup(c,ma(C,5)) Then{
buy("b1",OnClose,def,Vol);
buy("b2",AtLimit,c-PriceScale*1,Vol);
buy("b3",AtLimit,c-PriceScale*2,Vol);
buy("b4",AtLimit,c-PriceScale*3,Vol);
buy("b5",AtLimit,c-PriceScale*4,Vol);
}
if MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*1 Then
buy("b21",atlimit,EntryPrice-PriceScale*1,Vol);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*2 Then
buy("b31",atlimit,EntryPrice-PriceScale*2,Vol);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*3 Then
buy("b41",atlimit,EntryPrice-PriceScale*3,Vol);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*4 Then
buy("b51",atlimit,EntryPrice-PriceScale*4,Vol);
}
if MarketPosition == 1 Then{
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
xvol1 = int(int(MaxContracts*0.4)/10)*10;
xvol2 = int(int(MaxContracts*0.3)/10)*10;
}
Else{
xvol1 = int(MaxContracts*0.4);
xvol2 = int(MaxContracts*0.3);
}
if CurrentContracts == MaxContracts Then
ExitLong("bx1",atlimit,AvgEntryPrice*1.045,"",xvol1,1);
if CurrentContracts < MaxContracts Then{
if countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 1 Then
ExitLong("bx2",atlimit,AvgEntryPrice*1.065,"",xvol2,1);
if countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 2 Then
ExitLong("bx3",atlimit,AvgEntryPrice*1.085);
}
ExitLong("losscut",AtStop,AvgEntryPrice*0.97);
}
즐거운 하루되세요
> 미래테크 님이 쓴 글입니다.
> 제목 : 32899 재부탁
> 알려주셔서 감사합니다
그런데 시험적용 해보니 매수금액 (1000만) 의 20%씩
5회에 분할매수 경우
첫번째와 두번째에 매수물량이 있지만
세번째 ~5번째 매수점에서는 수량이 1주만 매수나타남
5회에 걸쳐 같은 비중으로 분할매수 시스템식 부타합니다
다음글
이전글