커뮤니티

시스템식

프로필 이미지
외국인
2011-06-15 13:05:10
648
글번호 39760
답변완료
안녕하세요 하기 시스템식으로 문의 부탁 드립니다. 매수 매도 청산시 진입금지 식 부탁드리며 청산후 다시 시스템 가동 할수 있도록부탁드립니다 매수매도후 즉시 진입이되는되 안되게부탁드립니다 Var : value(0); Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; If (stime >= 90110 and stime < 91000) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) THEN { if crossup(c,dayopen) Then buy("시초가매수"); if CrossDown(c,dayopen) Then sell("시초가매도"); } If (stime > 91000 and stime < 111000) THEN { if BarsSinceExit(1) > 1 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라 if stime>=090100 and Stime< 150300 and marketposition==0 then if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("매수"); if MarketPosition == 1 Then sell("반대매도",AtStop,L[BarsSinceEntry]-PriceScale); ##진입봉의 고가는 H[BarsSinceEntry] if MarketPosition == -1 Then buy("SB",AtStop,H[BarsSinceEntry]+PriceScale); ##매도진입후 매도진입봉의 고가+1틱이상의 시세가 발생하면 매도로 전환 ##진입봉의 저가는 L[BarsSinceEntry] if MarketPosition == 1 Then sell("BS",AtStop,L[BarsSinceEntry]-PriceScale); ##매수진입후 매수진입봉의 저가-1틱 이하의 시세가 발생하면 매수로 전환 if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell("매도"); if MarketPosition == -1 Then buy("반대매수",AtStop,H[BarsSinceEntry]+PriceScale); } } If (stime > 110000 and stime < 144900) THEN { Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62); Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False); PcntR = PercentR(PercentRLen); AvgValue = MA(Close, PercentRLen); If PcntR < OverSold Then Setup1 = True; If PcntR > OverBought Then Setup1 = False; If PcntR > OverBought Then Setup2 = True; If PcntR < OverSold Then Setup2 = False; If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{ Setup1 = False; //Buy ("11시이후매수"); } End; If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{ Setup2 = False; } End; If (stime >= 120000 and stime < 145000) THEN { Inputs: Length1(5),Length2(3),Length3(3),OverSold11(30),OverBought11(70); Variables: KLine(0), DLine(0); KLine = StochasticsK(Length1,Length2); DLine = StochasticsD(Length1,Length2,Length3); If Crossup(KLine[5], DLine[5]) AND KLine[5] < OverSold11 AND DLine[5] < OverSold11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then ##스토매수 신호을 3개봉뒤에 신호나옴 buy("스토매수",AtStop,value); If (stime >= 100000 and stime < 135000) THEN { If CrossDown(KLine, DLine) AND KLine > OverBought11 AND DLine > OverBought11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell ("스토매도",AtStop,value); } } } If (stime >= 90000 and stime < 150000) THEN { Input : Period(12), Period1(5), Period2(5); value1 = StochasticsK(Period,Period1); value2 = StochasticsD(Period,Period1,Period2); If CrossDown(value1, value2) Then { var1 = C;#데드크로스시 발생시 초기값 var2 = var1[1]; # 직전 데드크로스 구간의 종가 중 최저가 } #가장 최근 데드크로스 구간의 종가중 최저가 계산 if value1[1] < value2[1] Then{ if C < var1 Then var1 = L; } if CrossUp(value1,value2) Then{ Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; var3 = value1; #골든크로스시 value1값 var4 = var3[1];#직전골든크로스시 value1값 if var3 > var4 and var1 < var2 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("골든크로스시",atmarket); if MarketPosition == 1 Then sell("골등반대매도",AtStop,L[BarsSinceEntry]-PriceScale); } } If (stime >= 100000 and stime < 150000) THEN { Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; if min(c,O) > ma(c,3) and min(C,H) > ma(c,10) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("이평매수"); } If (stime >= 100000 and stime < 150000) THEN { if max(c,O) < ma(c,10) and max(C,H) > ma(c,10) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell("이평매도"); } If (stime >= 100000 and stime < 150000) THEN { var : slowK1(0), slowD1(0), slowK2(0), slowD2(0); slowK1 = stochasticsK(12,3); slowD1 = stochasticsD(20,12,12); slowK2 = stochasticsK(12,5); slowD2 = stochasticsD(12,5,5); if BarsSinceExit(1) > 3 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라 if stime>=120000 and Stime< 150300 and marketposition==0 then Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; if slowK1 > slowD1 and crossup(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("스토12"); if CrossDown(slowK1,slowD1) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell("스토5"); } }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2011-06-15 15:22:12

안녕하세요 예스스탁입니다. 현재 수식상에 외부변수(input)와 내부변수(var)의 선언이 시간조건으로 묶여 있는등 이해하기 어려운 부분이 많아 수식을 어떻게 정비해 드려야 할지 모르겠습니다. 식을 조금 정리하셔서 올려주시기 바랍니다. 기본적으로 역방향 진입을 하지 않으시려면 즉 청산후에 조건 다시 탐색하여 진입하고자 하시면 진입식에 marketposition == 0이라는 내용이 들어가게 하시면 되며 각 식의 반대방행 진입을 청산으로 따로 추가해 주셔야 합니다. 즐거운 하루되세요 > 외국인 님이 쓴 글입니다. > 제목 : 시스템식 > 안녕하세요 하기 시스템식으로 문의 부탁 드립니다. 매수 매도 청산시 진입금지 식 부탁드리며 청산후 다시 시스템 가동 할수 있도록부탁드립니다 매수매도후 즉시 진입이되는되 안되게부탁드립니다 Var : value(0); Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; If (stime >= 90110 and stime < 91000) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) THEN { if crossup(c,dayopen) Then buy("시초가매수"); if CrossDown(c,dayopen) Then sell("시초가매도"); } If (stime > 91000 and stime < 111000) THEN { if BarsSinceExit(1) > 1 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라 if stime>=090100 and Stime< 150300 and marketposition==0 then if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("매수"); if MarketPosition == 1 Then sell("반대매도",AtStop,L[BarsSinceEntry]-PriceScale); ##진입봉의 고가는 H[BarsSinceEntry] if MarketPosition == -1 Then buy("SB",AtStop,H[BarsSinceEntry]+PriceScale); ##매도진입후 매도진입봉의 고가+1틱이상의 시세가 발생하면 매도로 전환 ##진입봉의 저가는 L[BarsSinceEntry] if MarketPosition == 1 Then sell("BS",AtStop,L[BarsSinceEntry]-PriceScale); ##매수진입후 매수진입봉의 저가-1틱 이하의 시세가 발생하면 매수로 전환 if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell("매도"); if MarketPosition == -1 Then buy("반대매수",AtStop,H[BarsSinceEntry]+PriceScale); } } If (stime > 110000 and stime < 144900) THEN { Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62); Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False); PcntR = PercentR(PercentRLen); AvgValue = MA(Close, PercentRLen); If PcntR < OverSold Then Setup1 = True; If PcntR > OverBought Then Setup1 = False; If PcntR > OverBought Then Setup2 = True; If PcntR < OverSold Then Setup2 = False; If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{ Setup1 = False; //Buy ("11시이후매수"); } End; If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{ Setup2 = False; } End; If (stime >= 120000 and stime < 145000) THEN { Inputs: Length1(5),Length2(3),Length3(3),OverSold11(30),OverBought11(70); Variables: KLine(0), DLine(0); KLine = StochasticsK(Length1,Length2); DLine = StochasticsD(Length1,Length2,Length3); If Crossup(KLine[5], DLine[5]) AND KLine[5] < OverSold11 AND DLine[5] < OverSold11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then ##스토매수 신호을 3개봉뒤에 신호나옴 buy("스토매수",AtStop,value); If (stime >= 100000 and stime < 135000) THEN { If CrossDown(KLine, DLine) AND KLine > OverBought11 AND DLine > OverBought11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell ("스토매도",AtStop,value); } } } If (stime >= 90000 and stime < 150000) THEN { Input : Period(12), Period1(5), Period2(5); value1 = StochasticsK(Period,Period1); value2 = StochasticsD(Period,Period1,Period2); If CrossDown(value1, value2) Then { var1 = C;#데드크로스시 발생시 초기값 var2 = var1[1]; # 직전 데드크로스 구간의 종가 중 최저가 } #가장 최근 데드크로스 구간의 종가중 최저가 계산 if value1[1] < value2[1] Then{ if C < var1 Then var1 = L; } if CrossUp(value1,value2) Then{ Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; var3 = value1; #골든크로스시 value1값 var4 = var3[1];#직전골든크로스시 value1값 if var3 > var4 and var1 < var2 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("골든크로스시",atmarket); if MarketPosition == 1 Then sell("골등반대매도",AtStop,L[BarsSinceEntry]-PriceScale); } } If (stime >= 100000 and stime < 150000) THEN { Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; if min(c,O) > ma(c,3) and min(C,H) > ma(c,10) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("이평매수"); } If (stime >= 100000 and stime < 150000) THEN { if max(c,O) < ma(c,10) and max(C,H) > ma(c,10) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell("이평매도"); } If (stime >= 100000 and stime < 150000) THEN { var : slowK1(0), slowD1(0), slowK2(0), slowD2(0); slowK1 = stochasticsK(12,3); slowD1 = stochasticsD(20,12,12); slowK2 = stochasticsK(12,5); slowD2 = stochasticsD(12,5,5); if BarsSinceExit(1) > 3 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라 if stime>=120000 and Stime< 150300 and marketposition==0 then Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate; if slowK1 > slowD1 and crossup(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then buy("스토12"); if CrossDown(slowK1,slowD1) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then sell("스토5"); } }
프로필 이미지

외국인

2011-06-15 15:29:25

외국인 님에 의해 삭제된 답변입니다.