커뮤니티
확인좀 해주세요
2013-10-11 16:36:45
144
글번호 68346
input : 고점(15900),저점(3850),투자금액(10000000);
var : 매수1(0),매수2(0),매수3(0),진입수량1(0),진입수량2(0),진입수량3(0);
var : 분할청산수량(0);
매수1 = 저점+(고점-저점)*0.550;
매수2 = 저점+(고점-저점)*0.382;
매수3 = 저점+(고점-저점)*0.236;
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
진입수량1 = int(int((투자금액*0.20)/C)/10)*10;
진입수량2 = int(int((투자금액*0.30)/C)/10)*10;
진입수량3 = int(int((투자금액*0.50)/C)/10)*10;
}
Else{
진입수량1 = int((투자금액*0.20)/C);
진입수량2 = int((투자금액*0.30)/C);
진입수량3 = int((투자금액*0.50)/C);
}
if MarketPosition == 0 and L > 매수1 Then
buy("1차매수",AtLimit,매수1,진입수량1);
if MarketPosition == 1 and
countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{
if CurrentEntries == 1 then
buy("2차매수",AtLimit,매수2,진입수량1);
if CurrentEntries == 1 then
buy("3차매수",AtLimit,매수3,진입수량1);
}
if MarketPosition == 1 Then{
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
분할청산수량 = int(int(MaxContracts*0.5)/10)*10;
}
Else{
분할청산수량 = int(MaxContracts*0.5);
}
if CurrentEntries == 1 Then
ExitLong("청산1차",Atlimit,고점);//전량청산
if CurrentEntries == 2 Then{
if CurrentContracts == MaxContracts Then
ExitLong("청산21",Atlimit,매수1,"",분할청산수량,1);
if CurrentContracts < MaxContracts Then
ExitLong("청산22",Atlimit,고점); //나머지 전량청산
}
if CurrentEntries == 3 Then{
if CurrentContracts == MaxContracts Then
ExitLong("청산31",Atlimit,매수2,"",분할청산수량,1);
if CurrentContracts < MaxContracts Then
ExitLong("청산32",Atlimit,매수1);//나머지 전량청산
}
}
3차매수를 하지를 않습니다 뭐가 잘못된건지 수정 부탁 드립니다 만약 수량이나 계산식이 잘못된거라면 수정부탁좀 드립니다
답변 1
예스스탁 예스스탁 답변
2013-10-11 17:43:41
안녕하세요
예스스탁입니다.
식을 수정했습니다.
input : 고점(15900),저점(3850),투자금액(10000000);
var : 매수1(0),매수2(0),매수3(0),진입수량1(0),진입수량2(0),진입수량3(0);
var : 분할청산수량(0);
매수1 = 저점+(고점-저점)*0.550;
매수2 = 저점+(고점-저점)*0.382;
매수3 = 저점+(고점-저점)*0.236;
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
진입수량1 = int(int((투자금액*0.20)/C)/10)*10;
진입수량2 = int(int((투자금액*0.30)/C)/10)*10;
진입수량3 = int(int((투자금액*0.50)/C)/10)*10;
}
Else{
진입수량1 = int((투자금액*0.20)/C);
진입수량2 = int((투자금액*0.30)/C);
진입수량3 = int((투자금액*0.50)/C);
}
if MarketPosition == 0 and L > 매수1 Then
buy("1차매수",AtLimit,매수1,진입수량1);
if MarketPosition == 1 and
countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{
if CurrentEntries == 1 then
buy("2차매수",AtLimit,매수2,진입수량1);
if CurrentEntries == 2 then
buy("3차매수",AtLimit,매수3,진입수량1);
}
if MarketPosition == 1 Then{
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
분할청산수량 = int(int(MaxContracts*0.5)/10)*10;
}
Else{
분할청산수량 = int(MaxContracts*0.5);
}
if CurrentEntries == 1 Then
ExitLong("청산1차",Atlimit,고점);//전량청산
if CurrentEntries == 2 Then{
if CurrentContracts == MaxContracts Then
ExitLong("청산21",Atlimit,매수1,"",분할청산수량,1);
if CurrentContracts < MaxContracts Then
ExitLong("청산22",Atlimit,고점); //나머지 전량청산
}
if CurrentEntries == 3 Then{
if CurrentContracts == MaxContracts Then
ExitLong("청산31",Atlimit,매수2,"",분할청산수량,1);
if CurrentContracts < MaxContracts Then
ExitLong("청산32",Atlimit,매수1);//나머지 전량청산
}
}
즐거운 하루되세요
> 데스나이트 님이 쓴 글입니다.
> 제목 : 확인좀 해주세요
> input : 고점(15900),저점(3850),투자금액(10000000);
var : 매수1(0),매수2(0),매수3(0),진입수량1(0),진입수량2(0),진입수량3(0);
var : 분할청산수량(0);
매수1 = 저점+(고점-저점)*0.550;
매수2 = 저점+(고점-저점)*0.382;
매수3 = 저점+(고점-저점)*0.236;
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
진입수량1 = int(int((투자금액*0.20)/C)/10)*10;
진입수량2 = int(int((투자금액*0.30)/C)/10)*10;
진입수량3 = int(int((투자금액*0.50)/C)/10)*10;
}
Else{
진입수량1 = int((투자금액*0.20)/C);
진입수량2 = int((투자금액*0.30)/C);
진입수량3 = int((투자금액*0.50)/C);
}
if MarketPosition == 0 and L > 매수1 Then
buy("1차매수",AtLimit,매수1,진입수량1);
if MarketPosition == 1 and
countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{
if CurrentEntries == 1 then
buy("2차매수",AtLimit,매수2,진입수량1);
if CurrentEntries == 1 then
buy("3차매수",AtLimit,매수3,진입수량1);
}
if MarketPosition == 1 Then{
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
분할청산수량 = int(int(MaxContracts*0.5)/10)*10;
}
Else{
분할청산수량 = int(MaxContracts*0.5);
}
if CurrentEntries == 1 Then
ExitLong("청산1차",Atlimit,고점);//전량청산
if CurrentEntries == 2 Then{
if CurrentContracts == MaxContracts Then
ExitLong("청산21",Atlimit,매수1,"",분할청산수량,1);
if CurrentContracts < MaxContracts Then
ExitLong("청산22",Atlimit,고점); //나머지 전량청산
}
if CurrentEntries == 3 Then{
if CurrentContracts == MaxContracts Then
ExitLong("청산31",Atlimit,매수2,"",분할청산수량,1);
if CurrentContracts < MaxContracts Then
ExitLong("청산32",Atlimit,매수1);//나머지 전량청산
}
}
3차매수를 하지를 않습니다 뭐가 잘못된건지 수정 부탁 드립니다 만약 수량이나 계산식이 잘못된거라면 수정부탁좀 드립니다