커뮤니티
문의드립니다.
2014-03-11 13:33:23
173
글번호 73377
항상 신경써 주셔서 감사합니다.
아래의 식에 분할매수를 얼마씩 나누어서 하라는 수식이 없는것 같은데 분할매수 수식 부탁드립니다.
==================================================================================
주가가 Price1 가격밑에 오면 1차매수는 Totalmoney의 50% , 이후로는 10% 씩 5회에 걸쳐 분할매수를 하려고 합니다.
(그리고 수익률 2%를 돌파하면 처음의 손절라인 -2%가 수익률 2% 로 손절라인이 이동해서 수익률이 2% 밑으로 다시 내려갈때는 2%수익으로 손절이 돼야 하는데 청산이 안됩니다. 수식확인 좀 부탁합니다.)
===================================================================================
input : Price1(2010),Totalmoney(100000); //Price1 밑의 가격이기만 하면 Totalmoney 금액을 분할매수
var : Price0(0),Vol(0);
var1 = max(Price1,Price1);
if CodeCategoryEx == 11 and BasePrice < 50000 Then
Vol = int(int(Totalmoney/C)/10)*10;
Else
Vol = int(Totalmoney/C);
if MarketPosition == 0 and var1 >= C and stime < 110000 Then{
buy("B1");
buy("B21",Atlimit,C-PriceScale*1,Vol);
buy("B31",Atlimit,C-PriceScale*2,Vol);
}
if MarketPosition == 1 and stime < 110000 Then{
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*1 Then
buy("B22",atlimit,EntryPrice-PriceScale*1,Vol);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*2 Then
buy("B32",atlimit,EntryPrice-PriceScale*2,Vol);
}
if MarketPosition == 1 and stime < 110000 Then{
if highest(H,BarsSinceEntry) < EntryPrice*1.02 Then
ExitLong("Bloss1",AtStop,EntryPrice*0.98);
if highest(H,BarsSinceEntry) > EntryPrice*1.02 Then
ExitLong("Bloss2",AtStop,EntryPrice*1.02);
if highest(H,BarsSinceEntry) > EntryPrice*1.02 Then
ExitLong("Bloss3",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.2);
}
if stime == 110000 and highest(H,BarsSinceEntry) < EntryPrice*1.02 and C >= EntryPrice Then
ExitLong("x");
답변 1
예스스탁 예스스탁 답변
2014-03-11 16:35:48
안녕하세요
예스스탁입니다.
피라미딩(진입을 누적)하는 식은 차트
적용하실 때 시스템 트레이딩 설정창에서 피라미딩을 설정하셔야 추가 진입신호가 발생합니다.
다른진입신호만 허용으로 설정하고 적용하시면 됩니다.
input : Price1(2010),Totalmoney(100000); //Price1 밑의 가격이기만 하면 Totalmoney 금액을 분할매수
var : Price0(0),Vol1(0),Vol2(0);
var1 = max(Price1,Price1);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
Vol1 = int(int((Totalmoney*0.5)/C)/10)*10;
Vol2 = int(int((Totalmoney*0.1)/C)/10)*10;
}
Else{
Vol1 = int((Totalmoney*0.5)/C);
Vol2 = int((Totalmoney*0.1)/C);
}
if MarketPosition == 0 and var1 >= C and stime < 110000 Then{
buy("B11",OnClose,def,Vol1);
buy("B21",Atlimit,C-PriceScale*1,Vol2);
buy("B31",Atlimit,C-PriceScale*2,Vol2);
buy("B41",Atlimit,C-PriceScale*3,Vol2);
buy("B51",Atlimit,C-PriceScale*4,Vol2);
buy("B61",Atlimit,C-PriceScale*5,Vol2);
}
if MarketPosition == 1 and stime < 110000 Then{
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*1 Then
buy("B22",atlimit,EntryPrice-PriceScale*1,Vol1);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*2 Then
buy("B32",atlimit,EntryPrice-PriceScale*2,Vol1);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*3 Then
buy("B42",atlimit,EntryPrice-PriceScale*3,Vol1);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*4 Then
buy("B52",atlimit,EntryPrice-PriceScale*4,Vol1);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*5 Then
buy("B62",atlimit,EntryPrice-PriceScale*5,Vol1);
}
if MarketPosition == 1 and stime < 110000 Then{
//진입이후 최고가가 진입가 대비 2% 이하이면 진입가 대비 -2%에 청산
if highest(H,BarsSinceEntry) < EntryPrice*1.02 Then
ExitLong("Bloss1",AtStop,EntryPrice*0.98);
//진입이후 최고가가 진입가 대비 2% 이상이면 진입가 대비 +2%에 청산
if highest(H,BarsSinceEntry) > EntryPrice*1.02 Then
ExitLong("Bloss2",AtStop,EntryPrice*1.02);
//진입이후 최고가가 진입가 대비 +2% 이상이면 최고가 대비 수익폭이 20% 감소하면 청산
if highest(H,BarsSinceEntry) > EntryPrice*1.02 Then
ExitLong("Bloss3",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.2);
}
if stime == 110000 and highest(H,BarsSinceEntry) < EntryPrice*1.02 and C >= EntryPrice Then
ExitLong("x");
즐거운 하루되세요
> 웹피 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 항상 신경써 주셔서 감사합니다.
아래의 식에 분할매수를 얼마씩 나누어서 하라는 수식이 없는것 같은데 분할매수 수식 부탁드립니다.
==================================================================================
주가가 Price1 가격밑에 오면 1차매수는 Totalmoney의 50% , 이후로는 10% 씩 5회에 걸쳐 분할매수를 하려고 합니다.
(그리고 수익률 2%를 돌파하면 처음의 손절라인 -2%가 수익률 2% 로 손절라인이 이동해서 수익률이 2% 밑으로 다시 내려갈때는 2%수익으로 손절이 돼야 하는데 청산이 안됩니다. 수식확인 좀 부탁합니다.)
===================================================================================
input : Price1(2010),Totalmoney(100000); //Price1 밑의 가격이기만 하면 Totalmoney 금액을 분할매수
var : Price0(0),Vol(0);
var1 = max(Price1,Price1);
if CodeCategoryEx == 11 and BasePrice < 50000 Then
Vol = int(int(Totalmoney/C)/10)*10;
Else
Vol = int(Totalmoney/C);
if MarketPosition == 0 and var1 >= C and stime < 110000 Then{
buy("B1");
buy("B21",Atlimit,C-PriceScale*1,Vol);
buy("B31",Atlimit,C-PriceScale*2,Vol);
}
if MarketPosition == 1 and stime < 110000 Then{
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*1 Then
buy("B22",atlimit,EntryPrice-PriceScale*1,Vol);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*2 Then
buy("B32",atlimit,EntryPrice-PriceScale*2,Vol);
}
if MarketPosition == 1 and stime < 110000 Then{
if highest(H,BarsSinceEntry) < EntryPrice*1.02 Then
ExitLong("Bloss1",AtStop,EntryPrice*0.98);
if highest(H,BarsSinceEntry) > EntryPrice*1.02 Then
ExitLong("Bloss2",AtStop,EntryPrice*1.02);
if highest(H,BarsSinceEntry) > EntryPrice*1.02 Then
ExitLong("Bloss3",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.2);
}
if stime == 110000 and highest(H,BarsSinceEntry) < EntryPrice*1.02 and C >= EntryPrice Then
ExitLong("x");
이전글