커뮤니티

질문드립니다.

프로필 이미지
부자청년28
2010-11-02 09:48:46
552
글번호 33241
답변완료
현물 3분할매수 2분할매도 시스템식을 만들고 싶습니다. 매매는 분봉에서 하지만 매수의 기준은 일봉상 엔벨로프 20,20 의 하단선 입니다. 금액을 자유롭게 할수 있는 수식을 맨위에 삽입. 1차매수 :: 주가가 엔벨로프 하단선에 2%이내로 근접할때 전체금액의 30% 매수 매수후 5% 상승시 전체 물량의 50% 매도 / 10% 상승시 남은 물량 전부 매도 매수후 5% 상승후 다시 2%로 떨어지면 전체 물량 매도 1차매수 후 -5% 시에 2차매수 :: 전체금액의 30% 매수 2차 매수후 5% 상승시 전체 물량의 50% 매도 / 10% 상승시 남은 물량 전부 매도 2차 매수후 5% 상승후 다시 2%로 떨어지면 전체 물량 매도 2차매수 후 -5% 시에 3차매수 :: 전체금액의 40% 매수 3차 매수후 5% 상승시 전체 물량의 50% 매도 / 10% 상승시 남은 물량 전부 매도 3차 매수후 5% 상승후 다시 2%로 떨어지면 전체 물량 매도 1차매수후 -20% 시에 전체 물량 손절 당일 1회라도 매도가 일어나면 1차 2차 3차 어떤매수도 일어나지 않게 하기. 이상입니다. 감사합니다~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2010-11-02 14:36:33

안녕하세요 예스스탁입니다. input : P1(20),Percent(20),투입금액(10000000); var : sumV(0), maV(0), count(0),dayEvup(0),dayEvdn(0),finalprice(0); #수량산출 # var1 1차, var2 2차 if CodeCategory == 1 Then{ if BasePrice < 50000 Then{ Var1 = int(int((투입금액*0.3)/C)/10)*10; Var2 = int(int((투입금액*0.3)/C)/10)*10; var3 = int(int((투입금액*0.4)/C)/10)*10; } Else{ Var1 = int((투입금액*0.3)/C); Var2 = int((투입금액*0.3)/C); Var3 = int((투입금액*0.4)/C); } } if CodeCategory == 2 Then{ Var1 = int((투입금액*0.3)/C); Var2 = int((투입금액*0.3)/C); Var3 = int((투입금액*0.4)/C); } if CodeCategory == 6 Then{ Var1 = int((투입금액*0.3)/(C*BigPointValue)); Var2 = int((투입금액*0.3)/(C*BigPointValue)); Var3 = int((투입금액*0.4)/(C*BigPointValue)); } sumV = 0; for count = 0 to P1-1 { sumV = sumV+DayClose(count); } maV = sumV / P1; DayEvUp = mav+mav*(Percent / 100); DayEvDn = mav-mav*(Percent / 100); if MarketPosition == 0 and sDate != ExitDate(1) Then{ if L > dayevdn*1.02 Then{ buy("b1",AtLimit,dayevdn*1.02,var1); } } if MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1 Then{ if CurrentEntries == 1 Then{ buy("b2",AtLimit,EntryPrice*0.95,var2); } if CurrentEntries == 2 Then{ buy("b3",AtLimit,EntryPrice*0.90,var3); } } if MarketPosition == 1 Then{ if CurrentContracts == MaxContracts Then{ #청산수량계산 if CodeCategory == 1 Then{ if BasePrice < 50000 Then{ Var11 = int(int(CurrentContracts*0.5)/10)*10; } Else{ Var11 = int(CurrentContracts*0.5); } } Else{ Var11 = int(CurrentContracts*0.5); } } if MaxEntries == 1 Then{ if CurrentContracts == MaxContracts Then exitlong("bx1_1",atlimit,EntryPrice*1.05,"",var11,1); if CurrentContracts < MaxContracts Then{ exitlong("bx1_2",atlimit,EntryPrice*1.10); if highest(H,BarsSinceEntry) >= EntryPrice*1.05 Then exitlong("bx1_3",atlimit,(EntryPrice*1.05)*0.98); } } if MaxEntries == 2 Then{ if CurrentContracts == MaxContracts Then exitlong("bx2_1",atlimit,(EntryPrice*0.95)*1.05,"",var11,1); if CurrentContracts < MaxContracts Then{ exitlong("bx2_2",atlimit,(EntryPrice*0.95)*1.10); if highest(H,BarsSinceEntry) >= (EntryPrice*0.95)*1.05 Then exitlong("bx2_3",atlimit,((EntryPrice*0.95)*1.05)*0.98); } } if MaxEntries == 3 Then{ if CurrentContracts == MaxContracts Then exitlong("bx3_1",AtLimit,(EntryPrice*0.90)*1.05,"",var11,1); if CurrentContracts < MaxContracts Then{ exitlong("bx3_2",atlimit,(EntryPrice*0.90)*1.10); if highest(H,BarsSinceEntry) >= (EntryPrice*0.90)*1.05 Then exitlong("bx3_3",atlimit,((EntryPrice*0.90)*1.05)*0.98); } } Exitlong("Loss",AtStop,EntryPrice*0.8); } 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 질문드립니다. > 현물 3분할매수 2분할매도 시스템식을 만들고 싶습니다. 매매는 분봉에서 하지만 매수의 기준은 일봉상 엔벨로프 20,20 의 하단선 입니다. 금액을 자유롭게 할수 있는 수식을 맨위에 삽입. 1차매수 :: 주가가 엔벨로프 하단선에 2%이내로 근접할때 전체금액의 30% 매수 매수후 5% 상승시 전체 물량의 50% 매도 / 10% 상승시 남은 물량 전부 매도 매수후 5% 상승후 다시 2%로 떨어지면 전체 물량 매도 1차매수 후 -5% 시에 2차매수 :: 전체금액의 30% 매수 2차 매수후 5% 상승시 전체 물량의 50% 매도 / 10% 상승시 남은 물량 전부 매도 2차 매수후 5% 상승후 다시 2%로 떨어지면 전체 물량 매도 2차매수 후 -5% 시에 3차매수 :: 전체금액의 40% 매수 3차 매수후 5% 상승시 전체 물량의 50% 매도 / 10% 상승시 남은 물량 전부 매도 3차 매수후 5% 상승후 다시 2%로 떨어지면 전체 물량 매도 1차매수후 -20% 시에 전체 물량 손절 당일 1회라도 매도가 일어나면 1차 2차 3차 어떤매수도 일어나지 않게 하기. 이상입니다. 감사합니다~