커뮤니티

수식 수정 부탁드립니다~

프로필 이미지
부자청년28
2019-07-21 21:42:01
218
글번호 130523
답변완료
안녕하세요? 1분봉에 적용하는 식이구요~ 아래의 식은 조건만족시 3시10분에 매수가되도록 되어 있는데요. 아래 1) 2) 3) 조건을 추가하고 싶습니다~ 1) 3시10분에 [일봉상 캔들이] [도지] 캔들일때는 매수가 안되게 하고 싶습니다. 예를들어) 일봉 캔들의 시가 ~ 현재가 범위가 음봉 양봉 상관없이 0.5% 이내일때 매수 금지 2) 가지고 있던 전체물량이 매도되어 물량이 0 이 되는 그 당일날은 재매수가 안일어나게 하고 싶습니다. 감사합니다 input : 금액(3000000); var : 상한가(0), UpLimit(0),count(0),entry(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else if date >= 20050328 and date < 20150615 Then UpLimit = (BP[0] * 1.15); Else UpLimit = (BP[0] * 1.30); 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; up7 = int(UpLimit/1+0.00001)*1; } 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; up7 = int(UpLimit/1+0.00001)*1; } } 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; up7 = int(UpLimit/1+0.00001)*1; } if CodeCategory() == 1 || CodeCategory() == 2 then { if sdate < 20101004 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 If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up6); } Else { 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 If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up7); } } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } if bdate != bdate[1] Then entry = 0; if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if entry < 1 and MarketPosition == 0 and stime >= 151000 and stime[1] < 151000 and dayhigh < Dayclose(1)*1.12 and DayClose(1) > dayopen(1) and DayClose(0) > dayopen(0) and DayHigh < 상한가 then buy("매수☆",OnClose,def,Floor(금액/c)); if MarketPosition == 1 Then { if sdate > EntryDate and stime >= 92000 and stime[1] < 92000 Then { count = count+1; if count == 1 Then ExitLong("1일",OnClose,def,"",floor(CurrentContracts*0.25),1); if count == 2 Then ExitLong("2일",OnClose,def,"",floor(CurrentContracts*0.33),1); if count == 3 Then ExitLong("3일",OnClose,def,"",floor(CurrentContracts*0.50),1); if count == 4 Then ExitLong("4일"); } ExitLong("3%",atlimit,EntryPrice*1.03,"",Floor(CurrentContracts*0.50),1); ExitLong("12%",atlimit,EntryPrice*1.12,"",Floor(CurrentContracts*0.50),1); ExitLong("15%",atlimit,EntryPrice*1.15); ExitLong("5%손",AtStop,EntryPrice*0.95); } Else count = 0;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-07-23 11:25:39

안녕하세요 예스스탁입니다. input : 금액(3000000),per(0.5); var : 상한가(0), UpLimit(0),count(0),entry(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else if date >= 20050328 and date < 20150615 Then UpLimit = (BP[0] * 1.15); Else UpLimit = (BP[0] * 1.30); 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; up7 = int(UpLimit/1+0.00001)*1; } 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; up7 = int(UpLimit/1+0.00001)*1; } } 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; up7 = int(UpLimit/1+0.00001)*1; } if CodeCategory() == 1 || CodeCategory() == 2 then { if sdate < 20101004 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 If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up6); } Else { 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 If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up7); } } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } if bdate != bdate[1] Then entry = 0; if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if entry < 1 and MarketPosition == 0 and ExitDate(1) != sdate and stime >= 151000 and stime[1] < 151000 and dayhigh < Dayclose(1)*1.12 and DayClose(1) > dayopen(1) and (DayClose(0) > dayopen(0)*(1+per/100) or DayClose(0) < dayopen(0)*(1-per/100)) and DayHigh < 상한가 then buy("매수☆",OnClose,def,Floor(금액/c)); if MarketPosition == 1 Then { if sdate > EntryDate and stime >= 92000 and stime[1] < 92000 Then { count = count+1; if count == 1 Then ExitLong("1일",OnClose,def,"",floor(CurrentContracts*0.25),1); if count == 2 Then ExitLong("2일",OnClose,def,"",floor(CurrentContracts*0.33),1); if count == 3 Then ExitLong("3일",OnClose,def,"",floor(CurrentContracts*0.50),1); if count == 4 Then ExitLong("4일"); } ExitLong("3%",atlimit,EntryPrice*1.03,"",Floor(CurrentContracts*0.50),1); ExitLong("12%",atlimit,EntryPrice*1.12,"",Floor(CurrentContracts*0.50),1); ExitLong("15%",atlimit,EntryPrice*1.15); ExitLong("5%손",AtStop,EntryPrice*0.95); } Else count = 0; 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 수식 수정 부탁드립니다~ > 안녕하세요? 1분봉에 적용하는 식이구요~ 아래의 식은 조건만족시 3시10분에 매수가되도록 되어 있는데요. 아래 1) 2) 3) 조건을 추가하고 싶습니다~ 1) 3시10분에 [일봉상 캔들이] [도지] 캔들일때는 매수가 안되게 하고 싶습니다. 예를들어) 일봉 캔들의 시가 ~ 현재가 범위가 음봉 양봉 상관없이 0.5% 이내일때 매수 금지 2) 가지고 있던 전체물량이 매도되어 물량이 0 이 되는 그 당일날은 재매수가 안일어나게 하고 싶습니다. 감사합니다 input : 금액(3000000); var : 상한가(0), UpLimit(0),count(0),entry(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else if date >= 20050328 and date < 20150615 Then UpLimit = (BP[0] * 1.15); Else UpLimit = (BP[0] * 1.30); 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; up7 = int(UpLimit/1+0.00001)*1; } 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; up7 = int(UpLimit/1+0.00001)*1; } } 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; up7 = int(UpLimit/1+0.00001)*1; } if CodeCategory() == 1 || CodeCategory() == 2 then { if sdate < 20101004 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 If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up6); } Else { 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 If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up7); } } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } if bdate != bdate[1] Then entry = 0; if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if entry < 1 and MarketPosition == 0 and stime >= 151000 and stime[1] < 151000 and dayhigh < Dayclose(1)*1.12 and DayClose(1) > dayopen(1) and DayClose(0) > dayopen(0) and DayHigh < 상한가 then buy("매수☆",OnClose,def,Floor(금액/c)); if MarketPosition == 1 Then { if sdate > EntryDate and stime >= 92000 and stime[1] < 92000 Then { count = count+1; if count == 1 Then ExitLong("1일",OnClose,def,"",floor(CurrentContracts*0.25),1); if count == 2 Then ExitLong("2일",OnClose,def,"",floor(CurrentContracts*0.33),1); if count == 3 Then ExitLong("3일",OnClose,def,"",floor(CurrentContracts*0.50),1); if count == 4 Then ExitLong("4일"); } ExitLong("3%",atlimit,EntryPrice*1.03,"",Floor(CurrentContracts*0.50),1); ExitLong("12%",atlimit,EntryPrice*1.12,"",Floor(CurrentContracts*0.50),1); ExitLong("15%",atlimit,EntryPrice*1.15); ExitLong("5%손",AtStop,EntryPrice*0.95); } Else count = 0;