커뮤니티
문의 드립니다.
2014-08-14 15:58:07
150
글번호 77674
안녕하세요.
분할매수 분할매도에 대해 문의 드립니다.
도움 부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2014-08-13 18:41:54
안녕하세요
예스스탁입니다.
피라미딩을 다른진입신호만 허용으로 설정하고 적용하시기 바라빈다.
청산함수에 진입명을 지정하면 해당 진입명이 발생했을때의 수량만 매도를 합니다.
1.
input : 투자금액1(1000000),투자금액2(1000000),투자금액3(1000000);
Input : Period(10) ;
var : Vol1(0),vol2(0),vol3(0),value(0),Mom(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int((투자금액1)/C)/10)*10;
vol2 = int(int((투자금액2)/C)/10)*10;
vol3 = int(int((투자금액3)/C)/10)*10;
}
Else{
vol1 = int((투자금액1)/C);
vol2 = int((투자금액2)/C);
vol3 = int((투자금액3)/C);
}
value = CCI(Period);
Mom = C/ C[10]*100;
if MarketPosition == 0 and crossup(value,-120) Then
buy("b1",OnClose,def,vol1);
if MarketPosition == 1 and MaxEntries == 1 and crossup(value,-120) Then
buy("b2",OnClose,def,vol2);
if MarketPosition == 1 and MaxEntries == 2 and crossup(value,-120) Then
buy("b3",OnClose,def,vol3);
if MarketPosition == 1 Then {
var1 = countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry);//청산횟수
If var1 == 0 and CrossDown(value,120) Then
ExitLong("Exit1",OnClose,def,"b1");
If var1 == 1 and CrossDown(value,100) and mom > 100 Then
ExitLong("Exit2",OnClose,def,"b2");
If var1 == 2 and CrossDown(value,100) and mom > 100 Then
ExitLong("Exit3",OnClose,def,"b3");
}
2.
input : 투자금액1(1000000),투자금액2(1000000),투자금액3(1000000);
Input : Period(10) ;
var : Vol1(0),vol2(0),vol3(0),value(0),Mom(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int((투자금액1)/C)/10)*10;
vol2 = int(int((투자금액2)/C)/10)*10;
vol3 = int(int((투자금액3)/C)/10)*10;
}
Else{
vol1 = int((투자금액1)/C);
vol2 = int((투자금액2)/C);
vol3 = int((투자금액3)/C);
}
value = CCI(Period);
Mom = C/ C[10]*100;
if MarketPosition == 0 and crossup(value,-120) Then
buy("b1",OnClose,def,vol1);
if MarketPosition == 1 and MaxEntries == 1 Then
buy("b2",atlimit,EntryPrice*0.95,vol2);
if MarketPosition == 1 and MaxEntries == 2 Then
buy("b3",atlimit,EntryPrice*0.90,vol3);
if MarketPosition == 1 Then {
var1 = countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry);//청산횟수
if CurrentContracts > CurrentContracts[1] Then
var2 = AvgEntryPrice;
If var1 == 0 Then
ExitLong("Exit1",AtLimit,var2*1.10,"b1");
If var1 == 1 Then
{
ExitLong("Exit21",AtLimit,LatestExitPrice(0)*1.05,"b2");
ExitLong("Exit22",AtStop,LatestExitPrice(0)*0.95,"b2");
}
If var1 == 2 Then
{
ExitLong("Exit31",AtLimit,LatestExitPrice(0)*1.05,"b2");
ExitLong("Exit32",AtStop,LatestExitPrice(0)*0.95,"b2");
}
}
즐거운 하루되세요
> 양치기 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 안녕하세요.
분할매수 분할매도에 대해 문의 드립니다.
도움 부탁드립니다.
다음글
이전글