커뮤니티

문의 드립니다.

프로필 이미지
느와르
2020-03-31 13:02:19
538
글번호 137383
답변완료

첨부 이미지

안녕하세요 항상 빠른 답변 감사드립니다. 오전에 전화 문의 드렸던 하루에 한번만 시스템 매수식이 작동하는 진입회수에 관한 문의들 드린바 아래와 같이 시스템식에 , 1%로스컷 설정을 적용 하였으나 제대로 적용이 안되어 재차 문의 드립니다. 1분봉상 가비아 1분봉에 적용하여 두번의 매수진입과 손절이 발생하였습니다. 그럼 좋은 하루 되세요 #당일진입횟수 카운트 var : entry(0); if bdate != bdate[1] Then entry = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry = entry+1; Input : 투입금액(10000000); Var : 진입수량(0); 진입수량 = int(투입금액/C); ################################################################################################## var : bbup1(0),bbup2(0); var : bbdn1(0),bbdn2(0); var : mav1(0),mav2(0),mav3(0); bbup1 = BollBandUp(20,1); bbdn1 = BollBandDown(20,1); bbup2 = BollBandUp(20,2); bbdn2 = BollBandDown(20,2); mav1 = ma(C,1); mav2 = ma(C,5); mav3 = ma(c,240); ################################################################################################## If CrossUp(C, DayOpen) && CountIF(H < DayOpen,5) > 0 && (C > ma(c,240)*0.95 or C < ma(c,240)*1.05) && (C < DayClose(1)*1.20) && MarketPosition == 0 and entry < 1 && mav3[1] <= mav3 && CurrentDate == sDate Then buy("시초돌파",OnClose,def,진입수량); ################################################################################################## if mav1 > mav2 and C >= bbup1 and bbup2 > c and C > bbdn2 and countif(crossup(c,bbup2),5) >= 1 && Condition1 == false && (C < DayClose(1)*1.25) && MarketPosition == 0 and entry < 1 && CurrentDate == sDate then buy("눌림",OnClose,def,진입수량); ################################################################################################## If CurrentContracts == MaxContracts && C >= EntryPrice*1.05 // 1%이상 Then ExitLong("5%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.10 // 1%이상 Then ExitLong("10%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.15 // 1%이상 Then ExitLong("15%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If sTime > 150500 Then ExitLong("장마감",atlimit,def); ################################################################################################## var : 상한가(0), UpLimit(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 MarketPosition == 1 Then { ExitLong("상한가",atlimit,상한가); if CurrentContracts == MaxContracts and C >= EntryPrice*1.03 Then ExitLong("3%익절",atlimit,def,"",int(MaxContracts*(50/100)),2); if CurrentContracts < MaxContracts then { if highest(c,BarsSinceEntry) >= EntryPrice*1.10 and highest(c,BarsSinceEntry) < EntryPrice*1.15 and C < EntryPrice*1.10 Then ExitLong("10%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.15 and highest(c,BarsSinceEntry) < EntryPrice*1.20 and C < EntryPrice*1.15 Then ExitLong("15%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.20 and C < EntryPrice*1.20 Then ExitLong("20%"); } }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2020-03-31 13:43:50

안녕하세요 예스스탁입니다. 랭귀지에서 포지션은 봉완성이 되어야 판단이 됩니다. 봉완성은 다음봉 시가수신될때입니다. 수식에서 진입이 onclose타입이면 다음봉 시가수신될때 신호가 발생하고 신호는 완성봉의 종가에 표시를 합니다. 다음봉에서 봉 중간에 청산이 되면 전봉과 현재봉의 포지션이 같기에 전봉과 현재봉의 포지션변화로 체크하는 내용만으로는 진입카운트가 되지 않습니다. var : T1(0),entry(0); if bdate != bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; 진입을 카운트 하는 내용을 위와 같이 수정했습니다. #당일진입횟수 카운트 var : T1(0),entry(0); if bdate != bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; Input : 투입금액(10000000); Var : 진입수량(0); 진입수량 = int(투입금액/C); ################################################################################################## var : bbup1(0),bbup2(0); var : bbdn1(0),bbdn2(0); var : mav1(0),mav2(0),mav3(0); bbup1 = BollBandUp(20,1); bbdn1 = BollBandDown(20,1); bbup2 = BollBandUp(20,2); bbdn2 = BollBandDown(20,2); mav1 = ma(C,1); mav2 = ma(C,5); mav3 = ma(c,240); ################################################################################################## If CrossUp(C, DayOpen) && CountIF(H < DayOpen,5) > 0 && (C > ma(c,240)*0.95 or C < ma(c,240)*1.05) && (C < DayClose(1)*1.20) && MarketPosition == 0 and entry < 1 && mav3[1] <= mav3 && CurrentDate == sDate Then buy("시초돌파",OnClose,def,진입수량); ################################################################################################## if mav1 > mav2 and C >= bbup1 and bbup2 > c and C > bbdn2 and countif(crossup(c,bbup2),5) >= 1 && Condition1 == false && (C < DayClose(1)*1.25) && MarketPosition == 0 and entry < 1 && CurrentDate == sDate then buy("눌림",OnClose,def,진입수량); ################################################################################################## If CurrentContracts == MaxContracts && C >= EntryPrice*1.05 // 1%이상 Then ExitLong("5%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.10 // 1%이상 Then ExitLong("10%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.15 // 1%이상 Then ExitLong("15%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If sTime > 150500 Then ExitLong("장마감",atlimit,def); ################################################################################################## var : 상한가(0), UpLimit(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 MarketPosition == 1 Then { ExitLong("상한가",atlimit,상한가); if CurrentContracts == MaxContracts and C >= EntryPrice*1.03 Then ExitLong("3%익절",atlimit,def,"",int(MaxContracts*(50/100)),2); if CurrentContracts < MaxContracts then { if highest(c,BarsSinceEntry) >= EntryPrice*1.10 and highest(c,BarsSinceEntry) < EntryPrice*1.15 and C < EntryPrice*1.10 Then ExitLong("10%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.15 and highest(c,BarsSinceEntry) < EntryPrice*1.20 and C < EntryPrice*1.15 Then ExitLong("15%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.20 and C < EntryPrice*1.20 Then ExitLong("20%"); } } 즐거운 하루되세요 > 느와르 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요 항상 빠른 답변 감사드립니다. 오전에 전화 문의 드렸던 하루에 한번만 시스템 매수식이 작동하는 진입회수에 관한 문의들 드린바 아래와 같이 시스템식에 , 1%로스컷 설정을 적용 하였으나 제대로 적용이 안되어 재차 문의 드립니다. 1분봉상 가비아 1분봉에 적용하여 두번의 매수진입과 손절이 발생하였습니다. 그럼 좋은 하루 되세요 #당일진입횟수 카운트 var : entry(0); if bdate != bdate[1] Then entry = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry = entry+1; Input : 투입금액(10000000); Var : 진입수량(0); 진입수량 = int(투입금액/C); ################################################################################################## var : bbup1(0),bbup2(0); var : bbdn1(0),bbdn2(0); var : mav1(0),mav2(0),mav3(0); bbup1 = BollBandUp(20,1); bbdn1 = BollBandDown(20,1); bbup2 = BollBandUp(20,2); bbdn2 = BollBandDown(20,2); mav1 = ma(C,1); mav2 = ma(C,5); mav3 = ma(c,240); ################################################################################################## If CrossUp(C, DayOpen) && CountIF(H < DayOpen,5) > 0 && (C > ma(c,240)*0.95 or C < ma(c,240)*1.05) && (C < DayClose(1)*1.20) && MarketPosition == 0 and entry < 1 && mav3[1] <= mav3 && CurrentDate == sDate Then buy("시초돌파",OnClose,def,진입수량); ################################################################################################## if mav1 > mav2 and C >= bbup1 and bbup2 > c and C > bbdn2 and countif(crossup(c,bbup2),5) >= 1 && Condition1 == false && (C < DayClose(1)*1.25) && MarketPosition == 0 and entry < 1 && CurrentDate == sDate then buy("눌림",OnClose,def,진입수량); ################################################################################################## If CurrentContracts == MaxContracts && C >= EntryPrice*1.05 // 1%이상 Then ExitLong("5%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.10 // 1%이상 Then ExitLong("10%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.15 // 1%이상 Then ExitLong("15%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If sTime > 150500 Then ExitLong("장마감",atlimit,def); ################################################################################################## var : 상한가(0), UpLimit(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 MarketPosition == 1 Then { ExitLong("상한가",atlimit,상한가); if CurrentContracts == MaxContracts and C >= EntryPrice*1.03 Then ExitLong("3%익절",atlimit,def,"",int(MaxContracts*(50/100)),2); if CurrentContracts < MaxContracts then { if highest(c,BarsSinceEntry) >= EntryPrice*1.10 and highest(c,BarsSinceEntry) < EntryPrice*1.15 and C < EntryPrice*1.10 Then ExitLong("10%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.15 and highest(c,BarsSinceEntry) < EntryPrice*1.20 and C < EntryPrice*1.15 Then ExitLong("15%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.20 and C < EntryPrice*1.20 Then ExitLong("20%"); } }
프로필 이미지

예스스탁 예스스탁 답변

2020-03-31 14:48:23

안녕하세요 예스스탁입니다. var : 상한가(0), UpLimit(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; } } var : HC(0); if MarketPosition == 1 Then { ExitLong("상한가",atlimit,상한가); HC = highest(c,BarsSinceEntry); if C >= EntryPrice*1.10 and (BarsSinceEntry == 1 or (BarsSinceEntry > 1 and HC[1] < EntryPrice*1.10)) Then ExitLong("10%익절",OnClose,def,"",int(MaxContracts*(1/3)),1); if C >= EntryPrice*1.20 and (BarsSinceEntry == 1 or (BarsSinceEntry > 1 and HC[1] < EntryPrice*1.20)) Then ExitLong("20%익절",OnClose,def,"",int(MaxContracts*(1/3)),1); if C >= EntryPrice*1.30 and (BarsSinceEntry == 1 or (BarsSinceEntry > 1 and HC[1] < EntryPrice*1.30)) Then ExitLong("30%익절"); } 즐거운 하루되세요 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 랭귀지에서 포지션은 봉완성이 되어야 판단이 됩니다. 봉완성은 다음봉 시가수신될때입니다. 수식에서 진입이 onclose타입이면 다음봉 시가수신될때 신호가 발생하고 신호는 완성봉의 종가에 표시를 합니다. 다음봉에서 봉 중간에 청산이 되면 전봉과 현재봉의 포지션이 같기에 전봉과 현재봉의 포지션변화로 체크하는 내용만으로는 진입카운트가 되지 않습니다. var : T1(0),entry(0); if bdate != bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; 진입을 카운트 하는 내용을 위와 같이 수정했습니다. #당일진입횟수 카운트 var : T1(0),entry(0); if bdate != bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; Input : 투입금액(10000000); Var : 진입수량(0); 진입수량 = int(투입금액/C); ################################################################################################## var : bbup1(0),bbup2(0); var : bbdn1(0),bbdn2(0); var : mav1(0),mav2(0),mav3(0); bbup1 = BollBandUp(20,1); bbdn1 = BollBandDown(20,1); bbup2 = BollBandUp(20,2); bbdn2 = BollBandDown(20,2); mav1 = ma(C,1); mav2 = ma(C,5); mav3 = ma(c,240); ################################################################################################## If CrossUp(C, DayOpen) && CountIF(H < DayOpen,5) > 0 && (C > ma(c,240)*0.95 or C < ma(c,240)*1.05) && (C < DayClose(1)*1.20) && MarketPosition == 0 and entry < 1 && mav3[1] <= mav3 && CurrentDate == sDate Then buy("시초돌파",OnClose,def,진입수량); ################################################################################################## if mav1 > mav2 and C >= bbup1 and bbup2 > c and C > bbdn2 and countif(crossup(c,bbup2),5) >= 1 && Condition1 == false && (C < DayClose(1)*1.25) && MarketPosition == 0 and entry < 1 && CurrentDate == sDate then buy("눌림",OnClose,def,진입수량); ################################################################################################## If CurrentContracts == MaxContracts && C >= EntryPrice*1.05 // 1%이상 Then ExitLong("5%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.10 // 1%이상 Then ExitLong("10%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.15 // 1%이상 Then ExitLong("15%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If sTime > 150500 Then ExitLong("장마감",atlimit,def); ################################################################################################## var : 상한가(0), UpLimit(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 MarketPosition == 1 Then { ExitLong("상한가",atlimit,상한가); if CurrentContracts == MaxContracts and C >= EntryPrice*1.03 Then ExitLong("3%익절",atlimit,def,"",int(MaxContracts*(50/100)),2); if CurrentContracts < MaxContracts then { if highest(c,BarsSinceEntry) >= EntryPrice*1.10 and highest(c,BarsSinceEntry) < EntryPrice*1.15 and C < EntryPrice*1.10 Then ExitLong("10%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.15 and highest(c,BarsSinceEntry) < EntryPrice*1.20 and C < EntryPrice*1.15 Then ExitLong("15%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.20 and C < EntryPrice*1.20 Then ExitLong("20%"); } } 즐거운 하루되세요 > 느와르 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요 항상 빠른 답변 감사드립니다. 오전에 전화 문의 드렸던 하루에 한번만 시스템 매수식이 작동하는 진입회수에 관한 문의들 드린바 아래와 같이 시스템식에 , 1%로스컷 설정을 적용 하였으나 제대로 적용이 안되어 재차 문의 드립니다. 1분봉상 가비아 1분봉에 적용하여 두번의 매수진입과 손절이 발생하였습니다. 그럼 좋은 하루 되세요 #당일진입횟수 카운트 var : entry(0); if bdate != bdate[1] Then entry = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry = entry+1; Input : 투입금액(10000000); Var : 진입수량(0); 진입수량 = int(투입금액/C); ################################################################################################## var : bbup1(0),bbup2(0); var : bbdn1(0),bbdn2(0); var : mav1(0),mav2(0),mav3(0); bbup1 = BollBandUp(20,1); bbdn1 = BollBandDown(20,1); bbup2 = BollBandUp(20,2); bbdn2 = BollBandDown(20,2); mav1 = ma(C,1); mav2 = ma(C,5); mav3 = ma(c,240); ################################################################################################## If CrossUp(C, DayOpen) && CountIF(H < DayOpen,5) > 0 && (C > ma(c,240)*0.95 or C < ma(c,240)*1.05) && (C < DayClose(1)*1.20) && MarketPosition == 0 and entry < 1 && mav3[1] <= mav3 && CurrentDate == sDate Then buy("시초돌파",OnClose,def,진입수량); ################################################################################################## if mav1 > mav2 and C >= bbup1 and bbup2 > c and C > bbdn2 and countif(crossup(c,bbup2),5) >= 1 && Condition1 == false && (C < DayClose(1)*1.25) && MarketPosition == 0 and entry < 1 && CurrentDate == sDate then buy("눌림",OnClose,def,진입수량); ################################################################################################## If CurrentContracts == MaxContracts && C >= EntryPrice*1.05 // 1%이상 Then ExitLong("5%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.10 // 1%이상 Then ExitLong("10%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If CurrentContracts == MaxContracts && C >= EntryPrice*1.15 // 1%이상 Then ExitLong("15%일부익절",OnClose,def,"",int(MaxContracts*(40/100)),2); If sTime > 150500 Then ExitLong("장마감",atlimit,def); ################################################################################################## var : 상한가(0), UpLimit(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 MarketPosition == 1 Then { ExitLong("상한가",atlimit,상한가); if CurrentContracts == MaxContracts and C >= EntryPrice*1.03 Then ExitLong("3%익절",atlimit,def,"",int(MaxContracts*(50/100)),2); if CurrentContracts < MaxContracts then { if highest(c,BarsSinceEntry) >= EntryPrice*1.10 and highest(c,BarsSinceEntry) < EntryPrice*1.15 and C < EntryPrice*1.10 Then ExitLong("10%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.15 and highest(c,BarsSinceEntry) < EntryPrice*1.20 and C < EntryPrice*1.15 Then ExitLong("15%"); if highest(c,BarsSinceEntry) >= EntryPrice*1.20 and C < EntryPrice*1.20 Then ExitLong("20%"); } }