커뮤니티
문의드립니다. --추가내용--
2012-08-01 21:42:50
258
글번호 53440
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
예스스탁 예스스탁 답변
2012-08-02 09:51:50
안녕하세요
예스스탁입니다.
식을 수정했습니다.
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);
}
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 CurrentContracts == MaxContracts and CurrentEntries > CurrentEntries[1] Then{
if CodeCategory == 1 Then
{
if BasePrice < 50000 Then
{
Var11 = int(int(CurrentContracts*0.5)/10)*10;
Var12 = int(int(CurrentContracts*0.25)/10)*10;
}
Else
{
Var11 = int(CurrentContracts*0.5);
Var12 = int(int(CurrentContracts*0.25));
}
}
if CodeCategory == 2 Then
{
Var11 = int(CurrentContracts*0.5);
Var12 = int(int(CurrentContracts*0.25));
}
}
if CurrentEntries == 1 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx11",atlimit,EntryPrice*1.005,"",var11,1);
if CurrentContracts < MaxContracts Then
ExitLong("bx12",atlimit,EntryPrice*1.011,"",var12,1);
if CurrentContracts < MaxContracts Then
ExitLong("bx13",atlimit,EntryPrice*1.02);
}
if CurrentEntries == 2 Then
{
if CurrentContracts == MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then
ExitLong("bx21",atlimit,EntryPrice,"",var11,1);
if CurrentContracts < MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 1 Then
ExitLong("bx22",atlimit,EntryPrice*1.005,"",var12,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,"",var11,1);
if CurrentContracts < MaxContracts Then
ExitLong("bx32",atlimit,EntryPrice*0.005);
}
if CurrentEntries == 3 Then
exitlong("bxx",AtStop,EntryPrice*0.94);
}
즐거운 하루되세요
> 사과쥬스 님이 쓴 글입니다.
> 제목 : 문의드립니다. --추가내용--
> 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% 추가 하락시 전량 매도 된 종목은 그날 매매 하지 않는 수식으로 수정 부탁드립니다.
추가내용 --------------- 주문 수량 오류가 나옵니다. 현물 거래로 코스피 거래소 코스닥으로 합니다. 잘부탁드립니다.
다음글