커뮤니티

추가질문 드립니다~

프로필 이미지
메디사
2016-06-17 13:16:05
190
글번호 99222
답변완료
# 해당 수식이 틱차트에서는 잘 구현이 되지 않는것 같아요..ㅠ.ㅠ # 그리고 횟수제한이라는 의미가 첫매수후 추가매수에 대한 횟수제한을 말씀드렸는데.. 하루에 매수총횟수가 제한이 걸려있어요..ㅠ.ㅠ 첫매수 후 추가매수5회이하로 하며, 다시 재매수되면 추가매수 다시 5회 요로케..ㅎㅎ 그리고 하루에 매수횟수제한은 없는걸로..ㅎㅎ # 추가로 당일 시초가가 5%이상(변수) 일때만 매수할수 있게 제한 걸어 주세요~ 매번 감사합니다~ Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),횟수제한(5); input : sto1(10),sto2(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0),stok(0); 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; } } VRatio = VR(Period); MACDV = MACD(short,long); stok = StochasticsK(sto1,sto2); Bcond = Vratio > 100 and MACDV > 0 and stok >= 30; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if count == 0 and MarketPosition == 0 and Bcond == true and Bcond[1] == false Then buy("b",OnClose,def,int(금액/C)); if count > 0 and count < 횟수제한 and MarketPosition == 0 and VRatio > 100 and stok >= 30 and crossup(MACDv,0) Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CurrentContracts == MaxContracts Then ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); if CurrentContracts < MaxContracts Then ExitLong("btr",AtStop,highest(h,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.3); if CrossDown(MACDV,0) Then exitlong("bx1"); if stime == 143000 and C < 상한가 Then exitlong(); }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2016-06-17 15:19:45

> 메디사 님이 쓴 글입니다. > 제목 : 추가질문 드립니다~ > # 해당 수식이 틱차트에서는 잘 구현이 되지 않는것 같아요..ㅠ.ㅠ # 그리고 횟수제한이라는 의미가 첫매수후 추가매수에 대한 횟수제한을 말씀드렸는데.. 하루에 매수총횟수가 제한이 걸려있어요..ㅠ.ㅠ 첫매수 후 추가매수5회이하로 하며, 다시 재매수되면 추가매수 다시 5회 요로케..ㅎㅎ 그리고 하루에 매수횟수제한은 없는걸로..ㅎㅎ # 추가로 당일 시초가가 5%이상(변수) 일때만 매수할수 있게 제한 걸어 주세요~ 매번 감사합니다~ Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),횟수제한(5); input : sto1(10),sto2(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0),stok(0); 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; } } VRatio = VR(Period); MACDV = MACD(short,long); stok = StochasticsK(sto1,sto2); Bcond = Vratio > 100 and MACDV > 0 and stok >= 30; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if count == 0 and MarketPosition == 0 and Bcond == true and Bcond[1] == false Then buy("b",OnClose,def,int(금액/C)); if count > 0 and count < 횟수제한 and MarketPosition == 0 and VRatio > 100 and stok >= 30 and crossup(MACDv,0) Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CurrentContracts == MaxContracts Then ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); if CurrentContracts < MaxContracts Then ExitLong("btr",AtStop,highest(h,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.3); if CrossDown(MACDV,0) Then exitlong("bx1"); if stime == 143000 and C < 상한가 Then exitlong(); }
프로필 이미지

예스스탁 예스스탁 답변

2016-06-17 17:12:58

안녕하세요 예스스탁입니다. Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),추가진입횟수(5); input : sto1(10),sto2(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0),stok(0); 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; } } VRatio = VR(Period); MACDV = MACD(short,long); stok = StochasticsK(sto1,sto2); Bcond = Vratio > 100 and MACDV > 0 and stok >= 30; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if MarketPosition == 0 and Bcond == true and Bcond[1] == false and C >= DayClose(1)*1.05 Then buy("b",OnClose,def,int(금액/C)); if MarketPosition == 1 and MaxEntries < 추가진입횟수 and crossup(VRatio,100) and C >= DayClose(1)*1.05 Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CurrentContracts == MaxContracts Then ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); if CurrentContracts < MaxContracts Then ExitLong("btr",AtStop,highest(h,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.3); if CrossDown(MACDV,0) Then exitlong("bx1"); if stime == 143000 and C < 상한가 Then exitlong(); } 즐거운 하루되세요 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 전화주시기 바랍니다.(02-3453-1060) > > 메디사 님이 쓴 글입니다. > 제목 : 추가질문 드립니다~ > # 해당 수식이 틱차트에서는 잘 구현이 되지 않는것 같아요..ㅠ.ㅠ # 그리고 횟수제한이라는 의미가 첫매수후 추가매수에 대한 횟수제한을 말씀드렸는데.. 하루에 매수총횟수가 제한이 걸려있어요..ㅠ.ㅠ 첫매수 후 추가매수5회이하로 하며, 다시 재매수되면 추가매수 다시 5회 요로케..ㅎㅎ 그리고 하루에 매수횟수제한은 없는걸로..ㅎㅎ # 추가로 당일 시초가가 5%이상(변수) 일때만 매수할수 있게 제한 걸어 주세요~ 매번 감사합니다~ Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),횟수제한(5); input : sto1(10),sto2(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0),stok(0); 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; } } VRatio = VR(Period); MACDV = MACD(short,long); stok = StochasticsK(sto1,sto2); Bcond = Vratio > 100 and MACDV > 0 and stok >= 30; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if count == 0 and MarketPosition == 0 and Bcond == true and Bcond[1] == false Then buy("b",OnClose,def,int(금액/C)); if count > 0 and count < 횟수제한 and MarketPosition == 0 and VRatio > 100 and stok >= 30 and crossup(MACDv,0) Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CurrentContracts == MaxContracts Then ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); if CurrentContracts < MaxContracts Then ExitLong("btr",AtStop,highest(h,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.3); if CrossDown(MACDV,0) Then exitlong("bx1"); if stime == 143000 and C < 상한가 Then exitlong(); }