커뮤니티

추가 좀 부탁드립니다.

프로필 이미지
쌀사비팔
2013-09-04 21:10:31
110
글번호 67199
답변완료
아래 두 가지 식이 있는데요... 청산을 두 가지 식에 모두 넣어주세요. *오늘 매수되었고, 14:40시에 매수가 대비 5% 이상 상승햇다면 다음 첫봉에 청산. *주가가 3분동안 5%이상을 상승하면 청산. 단, 청산시점의 주가는 매수가 대비 6%이상이어야 함. *그리고, 거래량이 적을은 경우 매수가 안될 때가 있는 것 같은데, 매수조건이 되면 발생되는 첫봉에 매수되도록 해 주세요. 감사합니다. ================================================= input : P(20); var : cnt(0),sum1(0),mav1(0),sum2(0),mav2(0); var : dis1(0),dis2(0),daycnt(0); if date != date[1] Then daycnt = daycnt+1; sum1 = 0; sum2 = 0; for cnt = 0 to P-1{ sum1 = sum1+DayClose(cnt); sum2 = sum2+DayClose(cnt+1); } mav1 = sum1/P; mav2 = sum2/P; dis1 = c/mav1*100; dis2 = DayClose(1)/mav2*100; if MarketPosition == 0 and ExitDate(1) != sdate and dayhigh <= DayClose(1)*1.08 and DayOpen <= DayClose(1)*1.04 and dis2 >= 104 Then{ if C <= DayClose(1)*0.98 and C > DayClose(1)*0.94 and dis1 >= 100 and dis1 <= 102 Then buy("매수1"); if C <= DayClose(1)*0.94 and C > DayClose(1)*0.91 and dis1 >= 100 and dis1 <= 102.5 Then buy("매수2"); if C <= DayClose(1)*0.91 and dis1 >= 100 and dis1 <= 103 Then buy("매수3"); } if MarketPosition == 1 Then{ ExitLong("Profit",Atlimit,EntryPrice*1.13); ExitLong("bx1",AtStop,EntryPrice*0.86,"매수1"); ExitLong("bx2",AtStop,EntryPrice*0.88,"매수2"); ExitLong("bx3",AtStop,EntryPrice*0.90,"매수3"); if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then ExitLong("x"); } ----------------------------------------------------- input : P(5); var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0); if date != date[1] Then Daycnt = daycnt+1; sum = 0; sum1 = 0; for cnt = 0 to P-1{ sum = sum+DayClose(cnt); sum1 = sum1+DayClose(cnt+1); } mav = sum/P; mav1 = sum1/P; dis = c/mav*100; dis1 = DayClose(1)/mav1*100; if date != date[1] Then var1 = O/mav*100; if ExitDate(1) != sdate and MarketPosition == 0 and var1 > 100 and dayhigh <= DayClose(1)*1.10 and dayopen <= DayClose(1)*1.06 and dis1 >= 104 then{ if daylow <= DayClose(1)*0.99 and daylow > DayClose(1)*0.96 and dis >= 100 and dis <= 102.5 Then buy("매수1"); if daylow <= DayClose(1)*0.96 and daylow > DayClose(1)*0.93 and dis >= 100 and dis <= 102.75 Then buy("매수2"); if daylow <= DayClose(1)*0.93 and daylow > DayClose(1)*0.90 and dis >= 100 and dis <= 103 Then buy("매수3"); if daylow <= DayClose(1)*0.90 and daylow > DayClose(1)*0.87 and dis >= 100 and dis <= 103.25 Then buy("매수4"); if daylow <= DayClose(1)*0.87 and dis >= 100 and dis <= 103.5 Then buy("매수5"); } if MarketPosition == 1 Then{ exitlong("Profit",Atlimit,EntryPrice*1.135); exitlong("bx1",AtStop,EntryPrice*0.865,"매수1"); exitlong("bx2",AtStop,EntryPrice*0.87,"매수2"); exitlong("bx3",AtStop,EntryPrice*0.875,"매수3"); exitlong("bx4",AtStop,EntryPrice*0.88,"매수4"); exitlong("bx5",AtStop,EntryPrice*0.885,"매수5"); if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then ExitLong("x"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-09-05 11:19:44

안녕하세요 예스스탁입니다. 3번과 같은 경우에는 수식이 기본적으로 봉완성시에 신호가 발생하고 봉완성시는 다음봉 시가가 수신될때 입니다. 다음봉이 들어오면 신호가 발생하게 되어 있습니다. 1. input : P(20); var : cnt(0),sum1(0),mav1(0),sum2(0),mav2(0); var : dis1(0),dis2(0),daycnt(0); if date != date[1] Then daycnt = daycnt+1; sum1 = 0; sum2 = 0; for cnt = 0 to P-1{ sum1 = sum1+DayClose(cnt); sum2 = sum2+DayClose(cnt+1); } mav1 = sum1/P; mav2 = sum2/P; dis1 = c/mav1*100; dis2 = DayClose(1)/mav2*100; if MarketPosition == 0 and ExitDate(1) != sdate and dayhigh <= DayClose(1)*1.08 and DayOpen <= DayClose(1)*1.04 and dis2 >= 104 Then{ if C <= DayClose(1)*0.98 and C > DayClose(1)*0.94 and dis1 >= 100 and dis1 <= 102 Then buy("매수1"); if C <= DayClose(1)*0.94 and C > DayClose(1)*0.91 and dis1 >= 100 and dis1 <= 102.5 Then buy("매수2"); if C <= DayClose(1)*0.91 and dis1 >= 100 and dis1 <= 103 Then buy("매수3"); } if MarketPosition == 1 Then{ ExitLong("Profit",Atlimit,EntryPrice*1.13); ExitLong("bx1",AtStop,EntryPrice*0.86,"매수1"); ExitLong("bx2",AtStop,EntryPrice*0.88,"매수2"); ExitLong("bx3",AtStop,EntryPrice*0.90,"매수3"); if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then ExitLong("x"); if EntryDate == sdate and stime == 144000 and C > EntryPrice*1.05 Then ExitLong("bxx1",AtMarket); if BarsSinceEntry >= 3 and C >= C[2]*1.05 and C >= EntryPrice*1.06 Then exitlong("bxx2"); } 2. input : P(5); var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0); if date != date[1] Then Daycnt = daycnt+1; sum = 0; sum1 = 0; for cnt = 0 to P-1{ sum = sum+DayClose(cnt); sum1 = sum1+DayClose(cnt+1); } mav = sum/P; mav1 = sum1/P; dis = c/mav*100; dis1 = DayClose(1)/mav1*100; if date != date[1] Then var1 = O/mav*100; if ExitDate(1) != sdate and MarketPosition == 0 and var1 > 100 and dayhigh <= DayClose(1)*1.10 and dayopen <= DayClose(1)*1.06 and dis1 >= 104 then{ if daylow <= DayClose(1)*0.99 and daylow > DayClose(1)*0.96 and dis >= 100 and dis <= 102.5 Then buy("매수1"); if daylow <= DayClose(1)*0.96 and daylow > DayClose(1)*0.93 and dis >= 100 and dis <= 102.75 Then buy("매수2"); if daylow <= DayClose(1)*0.93 and daylow > DayClose(1)*0.90 and dis >= 100 and dis <= 103 Then buy("매수3"); if daylow <= DayClose(1)*0.90 and daylow > DayClose(1)*0.87 and dis >= 100 and dis <= 103.25 Then buy("매수4"); if daylow <= DayClose(1)*0.87 and dis >= 100 and dis <= 103.5 Then buy("매수5"); } if MarketPosition == 1 Then{ exitlong("Profit",Atlimit,EntryPrice*1.135); exitlong("bx1",AtStop,EntryPrice*0.865,"매수1"); exitlong("bx2",AtStop,EntryPrice*0.87,"매수2"); exitlong("bx3",AtStop,EntryPrice*0.875,"매수3"); exitlong("bx4",AtStop,EntryPrice*0.88,"매수4"); exitlong("bx5",AtStop,EntryPrice*0.885,"매수5"); if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then ExitLong("x"); if EntryDate == sdate and stime == 144000 and C > EntryPrice*1.05 Then ExitLong("bxx1",AtMarket); if BarsSinceEntry >= 3 and C >= C[2]*1.05 and C >= EntryPrice*1.06 Then ExitLong("bxx2"); } 즐거운 하루되세요 > 쌀사비팔 님이 쓴 글입니다. > 제목 : 추가 좀 부탁드립니다. > 아래 두 가지 식이 있는데요... 청산을 두 가지 식에 모두 넣어주세요. *오늘 매수되었고, 14:40시에 매수가 대비 5% 이상 상승햇다면 다음 첫봉에 청산. *주가가 3분동안 5%이상을 상승하면 청산. 단, 청산시점의 주가는 매수가 대비 6%이상이어야 함. *그리고, 거래량이 적을은 경우 매수가 안될 때가 있는 것 같은데, 매수조건이 되면 발생되는 첫봉에 매수되도록 해 주세요. 감사합니다. ================================================= input : P(20); var : cnt(0),sum1(0),mav1(0),sum2(0),mav2(0); var : dis1(0),dis2(0),daycnt(0); if date != date[1] Then daycnt = daycnt+1; sum1 = 0; sum2 = 0; for cnt = 0 to P-1{ sum1 = sum1+DayClose(cnt); sum2 = sum2+DayClose(cnt+1); } mav1 = sum1/P; mav2 = sum2/P; dis1 = c/mav1*100; dis2 = DayClose(1)/mav2*100; if MarketPosition == 0 and ExitDate(1) != sdate and dayhigh <= DayClose(1)*1.08 and DayOpen <= DayClose(1)*1.04 and dis2 >= 104 Then{ if C <= DayClose(1)*0.98 and C > DayClose(1)*0.94 and dis1 >= 100 and dis1 <= 102 Then buy("매수1"); if C <= DayClose(1)*0.94 and C > DayClose(1)*0.91 and dis1 >= 100 and dis1 <= 102.5 Then buy("매수2"); if C <= DayClose(1)*0.91 and dis1 >= 100 and dis1 <= 103 Then buy("매수3"); } if MarketPosition == 1 Then{ ExitLong("Profit",Atlimit,EntryPrice*1.13); ExitLong("bx1",AtStop,EntryPrice*0.86,"매수1"); ExitLong("bx2",AtStop,EntryPrice*0.88,"매수2"); ExitLong("bx3",AtStop,EntryPrice*0.90,"매수3"); if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then ExitLong("x"); } ----------------------------------------------------- input : P(5); var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0); if date != date[1] Then Daycnt = daycnt+1; sum = 0; sum1 = 0; for cnt = 0 to P-1{ sum = sum+DayClose(cnt); sum1 = sum1+DayClose(cnt+1); } mav = sum/P; mav1 = sum1/P; dis = c/mav*100; dis1 = DayClose(1)/mav1*100; if date != date[1] Then var1 = O/mav*100; if ExitDate(1) != sdate and MarketPosition == 0 and var1 > 100 and dayhigh <= DayClose(1)*1.10 and dayopen <= DayClose(1)*1.06 and dis1 >= 104 then{ if daylow <= DayClose(1)*0.99 and daylow > DayClose(1)*0.96 and dis >= 100 and dis <= 102.5 Then buy("매수1"); if daylow <= DayClose(1)*0.96 and daylow > DayClose(1)*0.93 and dis >= 100 and dis <= 102.75 Then buy("매수2"); if daylow <= DayClose(1)*0.93 and daylow > DayClose(1)*0.90 and dis >= 100 and dis <= 103 Then buy("매수3"); if daylow <= DayClose(1)*0.90 and daylow > DayClose(1)*0.87 and dis >= 100 and dis <= 103.25 Then buy("매수4"); if daylow <= DayClose(1)*0.87 and dis >= 100 and dis <= 103.5 Then buy("매수5"); } if MarketPosition == 1 Then{ exitlong("Profit",Atlimit,EntryPrice*1.135); exitlong("bx1",AtStop,EntryPrice*0.865,"매수1"); exitlong("bx2",AtStop,EntryPrice*0.87,"매수2"); exitlong("bx3",AtStop,EntryPrice*0.875,"매수3"); exitlong("bx4",AtStop,EntryPrice*0.88,"매수4"); exitlong("bx5",AtStop,EntryPrice*0.885,"매수5"); if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then ExitLong("x"); }