커뮤니티

질문드립니다.

프로필 이미지
부자청년28
2009-10-11 23:06:34
879
글번호 25271
답변완료
현물 거래 3분할 매수식 2분할 매도식을 만들고 싶습니다. 분봉차트로 매매 할때 기준은 일봉차트에 있는 120일 이평선입니다. input : p1(120),account(100000) 을 기본으로 두고 주가가 5분봉차트에서 일봉 120일이동평균선에 주가가 닿을때 전체 물량의 10% 매수(1차매수) 그가격에서 +5% 상승시 전체 물량의 50% 매도(1차매도) 8% 상승시 남은 물량매도(2차매도) or 그가격에서 -10% 하락시 전체물량의 30% 매수(2차매수) 2차매수된 가격과 물량을 기준으로 +5% 상승시 전체 물량의 50% 매도(1차매도) 8% 상승시 남은 물량매도(2차매도) or 그 가격에서 -10% 하락시 전체 물량의 60% 매수(3차매수) 3차매수된 가격과 물량을 기준으로 +5% 상승시 전체 물량의 50% 매도(1차매도) 8%상승시 남은물량매도(2차매도) or 그가격에서 -5% 하락시 전체 물량 손절 이런 식을 만들고 싶습니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2009-10-12 14:47:33

안녕하세요 예스스탁입니다. input : P1(120),ACCOUNT(1000000); var : cnt(0),sumV(0), maV(0), count(0), chk_price(0); sumV = 0; for count = 0 to P1-1 { sumV = sumV+DayClose(count); } maV = sumV / P1; value1 = account*0.2; value2 = account*0.3; value3 = account*0.5; if CodeCategory == 1 Then{ if MarketPosition == 0 and L <=mav and H >= mav then buy("거래소매수1", onclose, def, int(int(value1/C)/10)*10); if MarketPosition == 1 and Highest(CurrentContracts,BarsSinceEntry) == CurrentContracts then{ if CurrentEntries == 1 and C <= chk_price*0.9 Then buy("거래소매수2", OnClose, def, int(int(value2/C)/10)*10); if CurrentEntries == 2 and C <= chk_price*0.9 Then buy("거래소매수3", OnClose, def, int(int(value2/C)/10)*10); } } if CodeCategory == 2 Then{ if MarketPosition == 0 and L <=mav and H >= mav then buy("코스닥매수1", onclose, def, int(Value1/C)); if MarketPosition == 1 and Highest(CurrentContracts,BarsSinceEntry) == CurrentContracts then{ if CurrentEntries == 1 and C <= chk_price*0.9 Then buy("코스닥매수2", OnClose,DEF,int(Value2/C)); if CurrentEntries == 2 and C <= chk_price*0.9 Then buy("코스닥매수3", OnClose,DEF,int(Value2/C)); } } if MarketPosition == 1 Then{ if CurrentEntries > CurrentEntries[1] Then{ chk_price = C[1]; if CodeCategory == 1 Then{ var1 = CurrentContracts; var2 = int(int(var1*0.5/10)*10); var3 = var1 - var2; } if CodeCategory == 2 Then{ var1 = CurrentContracts; var2 = int(var1*0.5); var3 = var1 - var2; } } if CurrentContracts == var1 Then # 1차청산 exitlong("bx1",AtLimit,chk_price*1.03,"",var2,1); if CurrentContracts == var3 Then # 2차청산 exitlong("bx2",AtLimit,chk_price*1.08,"",var3,1); } 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 질문드립니다. > 현물 거래 3분할 매수식 2분할 매도식을 만들고 싶습니다. 분봉차트로 매매 할때 기준은 일봉차트에 있는 120일 이평선입니다. input : p1(120),account(100000) 을 기본으로 두고 주가가 5분봉차트에서 일봉 120일이동평균선에 주가가 닿을때 전체 물량의 10% 매수(1차매수) 그가격에서 +5% 상승시 전체 물량의 50% 매도(1차매도) 8% 상승시 남은 물량매도(2차매도) or 그가격에서 -10% 하락시 전체물량의 30% 매수(2차매수) 2차매수된 가격과 물량을 기준으로 +5% 상승시 전체 물량의 50% 매도(1차매도) 8% 상승시 남은 물량매도(2차매도) or 그 가격에서 -10% 하락시 전체 물량의 60% 매수(3차매수) 3차매수된 가격과 물량을 기준으로 +5% 상승시 전체 물량의 50% 매도(1차매도) 8%상승시 남은물량매도(2차매도) or 그가격에서 -5% 하락시 전체 물량 손절 이런 식을 만들고 싶습니다.