커뮤니티

시스템 오류검증

프로필 이미지
조민철
2017-09-06 11:30:31
101
글번호 112537
답변완료
항상 감사드립니다. 질의_1. 아래의 시스템_1식은 신호발생후 기준선이나 선행스팬2를 터치할때 진입되도록 만든식인데 장시작후 처음에 다르게 나오고 있습니다. 또한 기준선이나 선행스팬2가 급격히 수직으로 움직일때 고가/저가 가 crossup/crossdown 되지 않고 수평으로 통과하다보니 신호가 발생하지 않습니다 수정부탁드립니다 질의_2. 시스템1과 시스템_2 는 동일한 시스템으로 만들엇는데 결과치는 다르게 나오고 잇습니다 두시스템의 차이점을 알고 싶습니다 1_시스템 1 /**************************************************************************/ Var : 기준선(0), 전환선(0), 선행스팬1(0), 선행스팬2(0),선행스팬3(0); 전환선 = (Highest(H, 9) + Lowest(L, 9)) / 2; 기준선 = (Highest(H, 26) + Lowest(L, 26)) / 2; 선행스팬1 = (전환선[25] + 기준선[25]) / 2 ; 선행스팬2 = (Highest(H, 52)[25] + Lowest(L, 52)[25]) / 2; 선행스팬3 = (highest(H,48)+lowest(L,48))/2; /************************************************************************/ Input : Period1(200),Period2(100); var : CCIv(0),CCIs(0); CCIv = CCI(Period1); CCIs = ema(CCIv,Period2); /***************************************/ Input : short(30),long(65),sig(9); Var : MACDv(0),MACDS(0); MACDv = MACD(short, long); MACDs = ema(MACDv,sig); /*****************************************/ Input: DIP(46); var : DP1(0),DM1(0),ZZ(0); DP1 = ema(iff(H-H[1]>0 && H-H[1]>L[1]-L,H-H[1],0),DIP)/ ema(max(max(H-L,abs(C[1]-H)),abs(C[1]-L)),DIP)*100; DM1 = ema(iff(L[1]-L>0 && H-H[1]<L[1]-L,L[1]-L,0),DIP)/ ema(max(max(H-L,abs(C[1]-H)),abs(C[1]-L)),DIP)*100; ZZ=ema(accum(ema(ema(DP1-DM1, 2), 2)),20); if ZZ > ZZ[1] Then var6 = 1; Else var6 = 0; #BASELINE: 0.5 # /*************************************************/ var: t(0),t1(0),t2(0),t3(0),t4(0),t5(0); if crossup(전환선,선행스팬3) Then T2 = 1 ; if CrossDown(전환선,선행스팬3) Then T2 = -1 ; if T2==1 and CCIv>0 Then T3 = 1 ; if T2==-1 and CCIv<0 Then T3 = -1 ; /*************************************/ ### 동일방향 재진입금지/전일 마지막신호와 무관하게 진입 ### var : entrycnt(0); if stime == 090000 or (stime > 090000 and stime[1] < 090000) Then Entrycnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then Entrycnt = Entrycnt+1; if (stime >= 090000 and stime < 150000) Then{ if T2 == 1 and C > 선행스팬2 and macdv>macds and 기준선>선행스팬2 Then T4 = 1; if T4 == 1 and (crossup(H,선행스팬2) or CrossDown(L,선행스팬2)) Then T5 = 1; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and t5==1 and var6==1 then buy("B_1"); if T2 == -1 and C < 선행스팬2 and macdv<macds and 기준선<선행스팬2 Then T4 = -1; if T4 == -1 and (crossup(H,기준선) or CrossDown(L,기준선)) Then T5 = -1; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and t5==-1 and var6==0 then sell("S_1"); } ########################## ##### 청산 ##### ########################## if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then ExitShort("sx2",AtStop,EntryPrice-(EntryPrice-Lowest(L,BarsSinceEntry))*0.75); } ######################################## ##### 손절20틱/매일 15:00 강제청산 ##### ######################################## SetStopLoss(PriceScale*20,PointStop); if stime == 150000 or (stime > 150000 and stime[1] < 150000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } /*#####################################################*/ 2_시스템2 /*************************************************/ var: t(0),t1(0),t2(0),t3(0),t4(0); if 전환선==선행스팬3 Then # 전환선이 선행스팬3과 같으면 0 T = 0 ; if T==0 and CCIv>0 Then # t=0 인상태에서 cciv>0 이면 t1=1 T1 = 1 ; if T==0 and CCIv<0 Then # t=0 인상태에서 cciv<0 이면 t1=-1 T1= -1 ; /**************************************/ if crossup(전환선,선행스팬3) Then #전환선이 선행스팬3을 상향돌파하면 1 T = 1 ; if CrossDown(전환선,선행스팬3) Then #전환선이 선행스팬3을 하향돌파하면 -1 T = -1 ; if T==1 and CCIv>0 Then T1 = 2 ; if T==-1 and CCIv<0 Then T1 = -2 ; /*************************************/ ### 동일방향 재진입금지/전일 마지막신호와 무관하게 진입 ### var : entrycnt(0); if stime == 090000 or (stime > 090000 and stime[1] < 090000) Then Entrycnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then ### 동일방향 재진입금지 설정식 ### Entrycnt = Entrycnt+1; if (stime >= 090000 and stime < 150000) Then{ /***************************************************************************/ if T1 == 2 and C > 선행스팬2 and macdv>macds and 기준선>선행스팬2 Then T = 2; #t가 2인 상태에서 선행스팬2를 터치하면 3 if T == 2 and (crossup(H,선행스팬2) or CrossDown(L,선행스팬2)) Then T = 3; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지# t==3 and var6==1 then buy("B_1"); if T1 == -2 and C < 선행스팬2 and macdv<macds and 기준선<선행스팬2 Then T = -2; #t가 -2인 상태에서 선행스팬2를 터치하면 -3 if T == -2 and (crossup(H,기준선) or CrossDown(L,기준선)) Then T = -3; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지# t==-3 and var6==0 then sell("S_1"); } ########################## ##### 청산 ##### ########################## if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then ExitShort("sx2",AtStop,EntryPrice-(EntryPrice-Lowest(L,BarsSinceEntry))*0.75); } ######################################## ##### 손절40틱/매일 12:00 강제청산 ##### ######################################## SetStopLoss(PriceScale*20,PointStop); if stime == 150000 or (stime > 150000 and stime[1] < 150000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-09-06 16:52:04

안녕하세요 예스스탁입니다. 1 올려주신 내용은 저희가 답변드리기 모호합니다. 전반적으로 작성하신 식내용 자체가 어떤 내용을 구현하고자 하는지 판단이 잘 되지 않고 어디를 수정해 드려야 할지도 모르겠습니다. 2 수식2번은 하나의 변수(T)가 조건에 따라 값이 변경이 되는데 1번식은 t2,t3,t4등으로 나누어 산재해서 사용되었습니다. 변수는 값 저장 후 다음에 저장이 발생할 때 까지 값을 유지합니다. 수식1은 이전에 저장된 t5값으로 추후에도 또 신호가 발생할수 있는구조입니다. 동일기간 차트에 적용하면 신호가 더 많이 발생하는 이유도 같습니다. 즐거운 하루되세요 > 조민철 님이 쓴 글입니다. > 제목 : 시스템 오류검증 > 항상 감사드립니다. 질의_1. 아래의 시스템_1식은 신호발생후 기준선이나 선행스팬2를 터치할때 진입되도록 만든식인데 장시작후 처음에 다르게 나오고 있습니다. 또한 기준선이나 선행스팬2가 급격히 수직으로 움직일때 고가/저가 가 crossup/crossdown 되지 않고 수평으로 통과하다보니 신호가 발생하지 않습니다 수정부탁드립니다 질의_2. 시스템1과 시스템_2 는 동일한 시스템으로 만들엇는데 결과치는 다르게 나오고 잇습니다 두시스템의 차이점을 알고 싶습니다 1_시스템 1 /**************************************************************************/ Var : 기준선(0), 전환선(0), 선행스팬1(0), 선행스팬2(0),선행스팬3(0); 전환선 = (Highest(H, 9) + Lowest(L, 9)) / 2; 기준선 = (Highest(H, 26) + Lowest(L, 26)) / 2; 선행스팬1 = (전환선[25] + 기준선[25]) / 2 ; 선행스팬2 = (Highest(H, 52)[25] + Lowest(L, 52)[25]) / 2; 선행스팬3 = (highest(H,48)+lowest(L,48))/2; /************************************************************************/ Input : Period1(200),Period2(100); var : CCIv(0),CCIs(0); CCIv = CCI(Period1); CCIs = ema(CCIv,Period2); /***************************************/ Input : short(30),long(65),sig(9); Var : MACDv(0),MACDS(0); MACDv = MACD(short, long); MACDs = ema(MACDv,sig); /*****************************************/ Input: DIP(46); var : DP1(0),DM1(0),ZZ(0); DP1 = ema(iff(H-H[1]>0 && H-H[1]>L[1]-L,H-H[1],0),DIP)/ ema(max(max(H-L,abs(C[1]-H)),abs(C[1]-L)),DIP)*100; DM1 = ema(iff(L[1]-L>0 && H-H[1]<L[1]-L,L[1]-L,0),DIP)/ ema(max(max(H-L,abs(C[1]-H)),abs(C[1]-L)),DIP)*100; ZZ=ema(accum(ema(ema(DP1-DM1, 2), 2)),20); if ZZ > ZZ[1] Then var6 = 1; Else var6 = 0; #BASELINE: 0.5 # /*************************************************/ var: t(0),t1(0),t2(0),t3(0),t4(0),t5(0); if crossup(전환선,선행스팬3) Then T2 = 1 ; if CrossDown(전환선,선행스팬3) Then T2 = -1 ; if T2==1 and CCIv>0 Then T3 = 1 ; if T2==-1 and CCIv<0 Then T3 = -1 ; /*************************************/ ### 동일방향 재진입금지/전일 마지막신호와 무관하게 진입 ### var : entrycnt(0); if stime == 090000 or (stime > 090000 and stime[1] < 090000) Then Entrycnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then Entrycnt = Entrycnt+1; if (stime >= 090000 and stime < 150000) Then{ if T2 == 1 and C > 선행스팬2 and macdv>macds and 기준선>선행스팬2 Then T4 = 1; if T4 == 1 and (crossup(H,선행스팬2) or CrossDown(L,선행스팬2)) Then T5 = 1; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and t5==1 and var6==1 then buy("B_1"); if T2 == -1 and C < 선행스팬2 and macdv<macds and 기준선<선행스팬2 Then T4 = -1; if T4 == -1 and (crossup(H,기준선) or CrossDown(L,기준선)) Then T5 = -1; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and t5==-1 and var6==0 then sell("S_1"); } ########################## ##### 청산 ##### ########################## if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then ExitShort("sx2",AtStop,EntryPrice-(EntryPrice-Lowest(L,BarsSinceEntry))*0.75); } ######################################## ##### 손절20틱/매일 15:00 강제청산 ##### ######################################## SetStopLoss(PriceScale*20,PointStop); if stime == 150000 or (stime > 150000 and stime[1] < 150000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } /*#####################################################*/ 2_시스템2 /*************************************************/ var: t(0),t1(0),t2(0),t3(0),t4(0); if 전환선==선행스팬3 Then # 전환선이 선행스팬3과 같으면 0 T = 0 ; if T==0 and CCIv>0 Then # t=0 인상태에서 cciv>0 이면 t1=1 T1 = 1 ; if T==0 and CCIv<0 Then # t=0 인상태에서 cciv<0 이면 t1=-1 T1= -1 ; /**************************************/ if crossup(전환선,선행스팬3) Then #전환선이 선행스팬3을 상향돌파하면 1 T = 1 ; if CrossDown(전환선,선행스팬3) Then #전환선이 선행스팬3을 하향돌파하면 -1 T = -1 ; if T==1 and CCIv>0 Then T1 = 2 ; if T==-1 and CCIv<0 Then T1 = -2 ; /*************************************/ ### 동일방향 재진입금지/전일 마지막신호와 무관하게 진입 ### var : entrycnt(0); if stime == 090000 or (stime > 090000 and stime[1] < 090000) Then Entrycnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then ### 동일방향 재진입금지 설정식 ### Entrycnt = Entrycnt+1; if (stime >= 090000 and stime < 150000) Then{ /***************************************************************************/ if T1 == 2 and C > 선행스팬2 and macdv>macds and 기준선>선행스팬2 Then T = 2; #t가 2인 상태에서 선행스팬2를 터치하면 3 if T == 2 and (crossup(H,선행스팬2) or CrossDown(L,선행스팬2)) Then T = 3; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지# t==3 and var6==1 then buy("B_1"); if T1 == -2 and C < 선행스팬2 and macdv<macds and 기준선<선행스팬2 Then T = -2; #t가 -2인 상태에서 선행스팬2를 터치하면 -3 if T == -2 and (crossup(H,기준선) or CrossDown(L,기준선)) Then T = -3; if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지# t==-3 and var6==0 then sell("S_1"); } ########################## ##### 청산 ##### ########################## if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then ExitShort("sx2",AtStop,EntryPrice-(EntryPrice-Lowest(L,BarsSinceEntry))*0.75); } ######################################## ##### 손절40틱/매일 12:00 강제청산 ##### ######################################## SetStopLoss(PriceScale*20,PointStop); if stime == 150000 or (stime > 150000 and stime[1] < 150000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); }