커뮤니티
문의드립니다. ----추가내용---
2012-08-05 19:54:34
374
글번호 53489
input : 금액1(1000000),금액2(1000000),금액3(2000000);
if CodeCategory == 1 Then
{
if BasePrice < 50000 Then
{
Var1 = int(int(금액1/C)/10)*10;
Var2 = int(int(금액1/C)/10)*10;
Var3 = int(int(금액1/C)/10)*10;
}
Else{
Var1 = int(금액1/C);
Var2 = int(금액2/C);
Var3 = int(금액3/C);
}
}
if CodeCategory == 2 Then
{
Var1 = int(금액1/C);
Var2 = int(금액2/C);
Var3 = int(금액3/C);
}
if CodeCategory == 6 Then
{
Var1 = int(금액1/(C*BigPointValue));
Var2 = int(금액2/(C*BigPointValue));
Var3 = int(금액3/(C*BigPointValue));
}
Condition1 = ExitDate(1) == sdate and IsExitName("bxx",1);
value1 = BollBandDown(20,2);
if MarketPosition == 0 and Condition1 == false Then
buy("b",Atlimit,value1*0.92,var1);
if MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{
buy("b2",atlimit,EntryPrice*0.98,var2);
buy("b3",atlimit,EntryPrice*0.94,var3);
}
if MarketPosition == 1 Then{
if CrossDown(c,ma(c,20)) Then
exitlong();
if CurrentEntries == 1 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx11",atlimit,EntryPrice*1.005,"",int(CurrentContracts*0.5),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx12",atlimit,EntryPrice*1.011,"",int(CurrentContracts*0.25),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx13",atlimit,EntryPrice*1.02,"",int(CurrentContracts*0.25),1);
}
if CurrentEntries == 2 Then
{
if CurrentContracts == MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then
ExitLong("bx21",atlimit,EntryPrice,"",int(CurrentContracts*0.5),1);
if CurrentContracts < MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 1 Then
ExitLong("bx22",atlimit,EntryPrice*1.005,"",int(CurrentContracts*0.25),1);
if CurrentContracts < MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 2 Then
ExitLong("bx23",atlimit,EntryPrice*1.011);
}
if CurrentEntries == 3 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx31",atlimit,EntryPrice,"",int(CurrentContracts*0.5),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx32",atlimit,EntryPrice*0.005);
}
if CurrentEntries == 3 Then
exitlong("bxx",AtStop,EntryPrice*0.94);
}
즐거운 하루되세요
> 사과쥬스 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> > 3분봉상 볼린저밴드(20.2) 기준입니다.
매수 매도 시간 09:00~2:20
매수
1차매수 - 현재가 볼린저밴드(20.2) 하단선이하 -0.8% 현재가가 위치시 매수 : 매수금액 1000000원
2차매수 - 1차매수 시점에서 2% 하락시 매수 : 매수금액 1000000원
3차매수 - 2차매수 시점에서 2% 하락시 매수 : 매수금액 2000000원
수익 실현 조건
1차 매수시 0.5%, 1.1%, 2.0% 분할 매도(or 3분봉 상 20일선 닿을 시 전량매도) - 매수 금액의 2:1:1의 비율 -이익보존율 80%
2차 매수시 0%, 0.5%, 1.1% 분할 매도(or 3분봉 상 20일선 닿을 시 전량매도)- 매수 금액의 2:1:1의 비율 -이익보존율 80%
3차 매수시 0%, 0.5% 분할 매도(or 3분봉 상 20일선 닿을 시 전량매도)- 매수 금액의 1:1 의 비율 -이익보존율 80%
손절
3차 매수 후 2% 추가 하락시 전량 매도
3차 매수 후 2% 추가 하락시 전량 매도 된 종목은 그날 매매 하지 않는 수식으로 수정 부탁드립니다.
주문 수량 오류가 나옵니다. 현물 거래로 코스피 거래소 코스닥으로 합니다. 잘부탁드립니다.
추가내용----------------------
1) 1,2,3차 매수시 이익보존율 80%가 적용되지 않는거 같아 수정 부탁드립니다. 수정내용은 예를 들어 1차 매수 시 0.5%에서 매도가 완료되고,
다시 0%로 주가가 하락하였을때는 전량 매도 주문이 들어갈 수 있도록 하는 것입니다. 이런식으로 1.1% 매도가 완료되고 0.5%로 주가가 하락했을때는 전량매도가 되는 방식입니다. 1,2,3차 매수마다 같은 방식으로 매도 주문이 들어갈 수 있도록 수정 부탁드립니다.
2) 수익 실현 조건시-- 3분봉 상 20일선(볼린저밴드 중단선) 닿을 시 전량매도-- 부분이 실행이 되지 않는거 같습니다. 이부분을 ---15분봉 상 20일선(볼린저밴드 중단선) 닿을 시 전량매도-- 수정 부탁드립니다.
감사합니다.
답변 3
예스스탁 예스스탁 답변
2012-08-06 11:39:55
> 사과쥬스 님이 쓴 글입니다.
> 제목 : 문의드립니다. ----추가내용---
> input : 금액1(1000000),금액2(1000000),금액3(2000000);
if CodeCategory == 1 Then
{
if BasePrice < 50000 Then
{
Var1 = int(int(금액1/C)/10)*10;
Var2 = int(int(금액1/C)/10)*10;
Var3 = int(int(금액1/C)/10)*10;
}
Else{
Var1 = int(금액1/C);
Var2 = int(금액2/C);
Var3 = int(금액3/C);
}
}
if CodeCategory == 2 Then
{
Var1 = int(금액1/C);
Var2 = int(금액2/C);
Var3 = int(금액3/C);
}
if CodeCategory == 6 Then
{
Var1 = int(금액1/(C*BigPointValue));
Var2 = int(금액2/(C*BigPointValue));
Var3 = int(금액3/(C*BigPointValue));
}
Condition1 = ExitDate(1) == sdate and IsExitName("bxx",1);
value1 = BollBandDown(20,2);
if MarketPosition == 0 and Condition1 == false Then
buy("b",Atlimit,value1*0.92,var1);
if MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{
buy("b2",atlimit,EntryPrice*0.98,var2);
buy("b3",atlimit,EntryPrice*0.94,var3);
}
if MarketPosition == 1 Then{
if CrossDown(c,ma(c,20)) Then
exitlong();
if CurrentEntries == 1 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx11",atlimit,EntryPrice*1.005,"",int(CurrentContracts*0.5),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx12",atlimit,EntryPrice*1.011,"",int(CurrentContracts*0.25),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx13",atlimit,EntryPrice*1.02,"",int(CurrentContracts*0.25),1);
}
if CurrentEntries == 2 Then
{
if CurrentContracts == MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then
ExitLong("bx21",atlimit,EntryPrice,"",int(CurrentContracts*0.5),1);
if CurrentContracts < MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 1 Then
ExitLong("bx22",atlimit,EntryPrice*1.005,"",int(CurrentContracts*0.25),1);
if CurrentContracts < MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 2 Then
ExitLong("bx23",atlimit,EntryPrice*1.011);
}
if CurrentEntries == 3 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx31",atlimit,EntryPrice,"",int(CurrentContracts*0.5),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx32",atlimit,EntryPrice*0.005);
}
if CurrentEntries == 3 Then
exitlong("bxx",AtStop,EntryPrice*0.94);
}
즐거운 하루되세요
> 사과쥬스 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> > 3분봉상 볼린저밴드(20.2) 기준입니다.
매수 매도 시간 09:00~2:20
매수
1차매수 - 현재가 볼린저밴드(20.2) 하단선이하 -0.8% 현재가가 위치시 매수 : 매수금액 1000000원
2차매수 - 1차매수 시점에서 2% 하락시 매수 : 매수금액 1000000원
3차매수 - 2차매수 시점에서 2% 하락시 매수 : 매수금액 2000000원
수익 실현 조건
1차 매수시 0.5%, 1.1%, 2.0% 분할 매도(or 3분봉 상 20일선 닿을 시 전량매도) - 매수 금액의 2:1:1의 비율 -이익보존율 80%
2차 매수시 0%, 0.5%, 1.1% 분할 매도(or 3분봉 상 20일선 닿을 시 전량매도)- 매수 금액의 2:1:1의 비율 -이익보존율 80%
3차 매수시 0%, 0.5% 분할 매도(or 3분봉 상 20일선 닿을 시 전량매도)- 매수 금액의 1:1 의 비율 -이익보존율 80%
손절
3차 매수 후 2% 추가 하락시 전량 매도
3차 매수 후 2% 추가 하락시 전량 매도 된 종목은 그날 매매 하지 않는 수식으로 수정 부탁드립니다.
주문 수량 오류가 나옵니다. 현물 거래로 코스피 거래소 코스닥으로 합니다. 잘부탁드립니다.
추가내용----------------------
1) 1,2,3차 매수시 이익보존율 80%가 적용되지 않는거 같아 수정 부탁드립니다. 수정내용은 예를 들어 1차 매수 시 0.5%에서 매도가 완료되고,
다시 0%로 주가가 하락하였을때는 전량 매도 주문이 들어갈 수 있도록 하는 것입니다. 이런식으로 1.1% 매도가 완료되고 0.5%로 주가가 하락했을때는 전량매도가 되는 방식입니다. 1,2,3차 매수마다 같은 방식으로 매도 주문이 들어갈 수 있도록 수정 부탁드립니다.
2) 수익 실현 조건시-- 3분봉 상 20일선(볼린저밴드 중단선) 닿을 시 전량매도-- 부분이 실행이 되지 않는거 같습니다. 이부분을 ---15분봉 상 20일선(볼린저밴드 중단선) 닿을 시 전량매도-- 수정 부탁드립니다.
감사합니다.
사과쥬스
2012-08-06 14:29:33
위수식이 수정된 사항인지 확인차문의드립니다
예스스탁 예스스탁 답변
2012-08-06 17:24:12
아직 수정 전입니다.
수정하여 추가로 답변을 드리겠습니다.
감사합니다.