커뮤니티

검토 부탁드립니다.

프로필 이미지
쌀사비팔
2013-09-24 21:15:15
123
글번호 67777
답변완료

첨부 이미지

시뮬레이션 해 봤는데요. 9월 16일, 09:02시에 청산되었는데.. 또 매수되고 다시 청산되는 현상이 있습니다. 사진 한번 봐주십시요. *오늘 청산되어다면, 오늘은 매수금지가 되야 합니다. =============================== input : P(5); var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0),PredayVol(0); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0); var : 상한가(0), UpLimit(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else UpLimit = (BP[0] * 1.15); if CodeCategory() == 2 then { if date >= 20030721 then { up1 = int(UpLimit/100+0.00001)*100; up2 = int(UpLimit/100+0.00001)*100; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; } else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/10+0.00001)*10; } } Else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; } if CodeCategory() == 1 || CodeCategory() == 2 then { If BP >= 500000 Then 상한가 = up1; Else If BP >= 100000 Then 상한가 = iff(up2>=500000, up1, up2); Else If BP >= 50000 Then 상한가 = iff(up3>=100000, up2, up3); Else If BP >= 10000 Then 상한가 = iff(up4>=50000, up3, up4); Else If BP >= 5000 Then 상한가 = iff(up5>=10000, up4, up5); Else 상한가 = iff(up6>=5000, up5, up6); } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } value1 = 상한가; Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; 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; for cnt = 1 to 1000 { if stime == stime[cnt] and sdate != sdate[cnt] then{ PredayVol = DayVolume[cnt]; cnt = 1001; } } if date != date[1] Then{ Daycnt = daycnt+1; var1 = dayopen/mav*100; value2 = value1[1]; value3 = value2[1]; value4 = value3[1]; value5 = value4[1]; } #5일 상한가 평균 value99 = (value1+value2+value3+value4+value5)/5; if dayopen <= DayClose(1)*1.01 and dayhigh <= dayopen*1.04 and dis1 >= 103 and ExitDate(1) != sdate and DayVolume < PredayVol*1 and var1 > 100 Then{ if stime >= 90000 and stime < 100000 and dis >= 100.5 and dis < 101.5 Then buy("b1",AtMarket); if stime >= 100000 and stime < 110000 and dis >= 100.5 and dis < 102.0 Then buy("b2",AtMarket); if stime >= 110000 and stime < 120000 and dis >= 100.5 and dis < 102.5 Then buy("b3",AtMarket); if stime >= 120000 and stime < 130000 and dis >= 100.5 and dis < 103.0 Then buy("b4",AtMarket); if stime >= 130000 and stime < 140000 and dis >= 100.5 and dis < 103.5 Then buy("b5",AtMarket); if stime >= 140000 and stime < 144800 and dis >= 100.5 and dis < 104.0 Then buy("b6",AtMarket); if stime >= 143000 and stime < 144800 and c < Pivot and dis >= 100.5 and dis < 104.5 Then buy("b7",AtMarket); } if MarketPosition == 1 Then{ if C <= EntryPrice*0.945 Then ExitLong("x",AtMarket); if sdate == EntryDate and C >= EntryPrice*1.06 Then ExitLong("bx",AtMarket); if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+1 and dayopen < value99 Then{ if stime >= 090000 and stime <= 093000 and C >= EntryPrice*1.01 Then ExitLong("bx11",AtMarket); if stime >= 093100 and stime <= 100000 and CrossUp(C,EntryPrice) Then ExitLong("bx12",AtMarket); if stime > 100000 Then ExitLong("bx13",AtMarket); } if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+1 and dayopen > value99 Then{ if C <= value99-PriceScale*2 Then ExitLong("bx21",AtMarket); if C >= EntryPrice*1.10 Then ExitLong("bx22",AtMarket); if C >= dayopen*1.075 Then ExitLong("bx23",AtMarket); } if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+2 Then{ if C >= EntryPrice*1.15 Then ExitLong("bx31",AtMarket); if C >= DayOpen*1.10 Then ExitLong("bx32",AtMarket); if stime >= 94000 Then ExitLong("bx33",AtMarket); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-09-25 14:42:06

안녕하세요 예스스탁입니다. 수정한 식입니다. input : P(5); var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0),PredayVol(0); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0); var : 상한가(0), UpLimit(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else UpLimit = (BP[0] * 1.15); if CodeCategory() == 2 then { if date >= 20030721 then { up1 = int(UpLimit/100+0.00001)*100; up2 = int(UpLimit/100+0.00001)*100; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; } else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/10+0.00001)*10; } } Else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; } if CodeCategory() == 1 || CodeCategory() == 2 then { If BP >= 500000 Then 상한가 = up1; Else If BP >= 100000 Then 상한가 = iff(up2>=500000, up1, up2); Else If BP >= 50000 Then 상한가 = iff(up3>=100000, up2, up3); Else If BP >= 10000 Then 상한가 = iff(up4>=50000, up3, up4); Else If BP >= 5000 Then 상한가 = iff(up5>=10000, up4, up5); Else 상한가 = iff(up6>=5000, up5, up6); } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } value1 = 상한가; Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; 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; for cnt = 1 to 1000 { if stime == stime[cnt] and sdate != sdate[cnt] then{ PredayVol = DayVolume[cnt]; cnt = 1001; } } if date != date[1] Then{ Daycnt = daycnt+1; var1 = dayopen/mav*100; value2 = value1[1]; value3 = value2[1]; value4 = value3[1]; value5 = value4[1]; } #5일 상한가 평균 value99 = (value1+value2+value3+value4+value5)/5; if MarketPosition == 0 and dayopen <= DayClose(1)*1.01 and dayhigh <= dayopen*1.04 and dis1 >= 103 and ExitDate(1) != sdate and DayVolume < PredayVol*1 and var1 > 100 Then{ if stime >= 90000 and stime < 100000 and dis >= 100.5 and dis < 101.5 Then buy("b1",AtMarket); if stime >= 100000 and stime < 110000 and dis >= 100.5 and dis < 102.0 Then buy("b2",AtMarket); if stime >= 110000 and stime < 120000 and dis >= 100.5 and dis < 102.5 Then buy("b3",AtMarket); if stime >= 120000 and stime < 130000 and dis >= 100.5 and dis < 103.0 Then buy("b4",AtMarket); if stime >= 130000 and stime < 140000 and dis >= 100.5 and dis < 103.5 Then buy("b5",AtMarket); if stime >= 140000 and stime < 144800 and dis >= 100.5 and dis < 104.0 Then buy("b6",AtMarket); if stime >= 143000 and stime < 144800 and c < Pivot and dis >= 100.5 and dis < 104.5 Then buy("b7",AtMarket); } if MarketPosition == 1 Then{ if C <= EntryPrice*0.945 Then ExitLong("x",AtMarket); if sdate == EntryDate and C >= EntryPrice*1.06 Then ExitLong("bx",AtMarket); if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+1 and dayopen < value99 Then{ if stime >= 090000 and stime <= 093000 and C >= EntryPrice*1.01 Then ExitLong("bx11",AtMarket); if stime >= 093100 and stime <= 100000 and CrossUp(C,EntryPrice) Then ExitLong("bx12",AtMarket); if stime > 100000 Then ExitLong("bx13",AtMarket); } if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+1 and dayopen > value99 Then{ if C <= value99-PriceScale*2 Then ExitLong("bx21",AtMarket); if C >= EntryPrice*1.10 Then ExitLong("bx22",AtMarket); if C >= dayopen*1.075 Then ExitLong("bx23",AtMarket); } if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+2 Then{ if C >= EntryPrice*1.15 Then ExitLong("bx31",AtMarket); if C >= DayOpen*1.10 Then ExitLong("bx32",AtMarket); if stime >= 94000 Then ExitLong("bx33",AtMarket); } } 즐거운 하루되세요 > 쌀사비팔 님이 쓴 글입니다. > 제목 : 검토 부탁드립니다. > 시뮬레이션 해 봤는데요. 9월 16일, 09:02시에 청산되었는데.. 또 매수되고 다시 청산되는 현상이 있습니다. 사진 한번 봐주십시요. *오늘 청산되어다면, 오늘은 매수금지가 되야 합니다. =============================== input : P(5); var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0),PredayVol(0); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0); var : 상한가(0), UpLimit(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else UpLimit = (BP[0] * 1.15); if CodeCategory() == 2 then { if date >= 20030721 then { up1 = int(UpLimit/100+0.00001)*100; up2 = int(UpLimit/100+0.00001)*100; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; } else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/10+0.00001)*10; } } Else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; } if CodeCategory() == 1 || CodeCategory() == 2 then { If BP >= 500000 Then 상한가 = up1; Else If BP >= 100000 Then 상한가 = iff(up2>=500000, up1, up2); Else If BP >= 50000 Then 상한가 = iff(up3>=100000, up2, up3); Else If BP >= 10000 Then 상한가 = iff(up4>=50000, up3, up4); Else If BP >= 5000 Then 상한가 = iff(up5>=10000, up4, up5); Else 상한가 = iff(up6>=5000, up5, up6); } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } value1 = 상한가; Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; 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; for cnt = 1 to 1000 { if stime == stime[cnt] and sdate != sdate[cnt] then{ PredayVol = DayVolume[cnt]; cnt = 1001; } } if date != date[1] Then{ Daycnt = daycnt+1; var1 = dayopen/mav*100; value2 = value1[1]; value3 = value2[1]; value4 = value3[1]; value5 = value4[1]; } #5일 상한가 평균 value99 = (value1+value2+value3+value4+value5)/5; if dayopen <= DayClose(1)*1.01 and dayhigh <= dayopen*1.04 and dis1 >= 103 and ExitDate(1) != sdate and DayVolume < PredayVol*1 and var1 > 100 Then{ if stime >= 90000 and stime < 100000 and dis >= 100.5 and dis < 101.5 Then buy("b1",AtMarket); if stime >= 100000 and stime < 110000 and dis >= 100.5 and dis < 102.0 Then buy("b2",AtMarket); if stime >= 110000 and stime < 120000 and dis >= 100.5 and dis < 102.5 Then buy("b3",AtMarket); if stime >= 120000 and stime < 130000 and dis >= 100.5 and dis < 103.0 Then buy("b4",AtMarket); if stime >= 130000 and stime < 140000 and dis >= 100.5 and dis < 103.5 Then buy("b5",AtMarket); if stime >= 140000 and stime < 144800 and dis >= 100.5 and dis < 104.0 Then buy("b6",AtMarket); if stime >= 143000 and stime < 144800 and c < Pivot and dis >= 100.5 and dis < 104.5 Then buy("b7",AtMarket); } if MarketPosition == 1 Then{ if C <= EntryPrice*0.945 Then ExitLong("x",AtMarket); if sdate == EntryDate and C >= EntryPrice*1.06 Then ExitLong("bx",AtMarket); if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+1 and dayopen < value99 Then{ if stime >= 090000 and stime <= 093000 and C >= EntryPrice*1.01 Then ExitLong("bx11",AtMarket); if stime >= 093100 and stime <= 100000 and CrossUp(C,EntryPrice) Then ExitLong("bx12",AtMarket); if stime > 100000 Then ExitLong("bx13",AtMarket); } if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+1 and dayopen > value99 Then{ if C <= value99-PriceScale*2 Then ExitLong("bx21",AtMarket); if C >= EntryPrice*1.10 Then ExitLong("bx22",AtMarket); if C >= dayopen*1.075 Then ExitLong("bx23",AtMarket); } if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+2 Then{ if C >= EntryPrice*1.15 Then ExitLong("bx31",AtMarket); if C >= DayOpen*1.10 Then ExitLong("bx32",AtMarket); if stime >= 94000 Then ExitLong("bx33",AtMarket); } }