커뮤니티

피봇수식 수정 부탁드립니다.

프로필 이미지
승부사1
2019-11-18 12:18:12
290
글번호 133679
답변완료

첨부 이미지

아래의 수식을 적용해 보았는데 시그널이 발생하지 않는 구간이 일부 있어서 문의드립니다. 항셍지수선물 챠트에 적용하였구요. 예상하였던 시그널 발생구간에서 발생하지 않은 사례를 파일로 첨부해 드립니다. 점검 좀 부탁드리겠습니다. ~~^^ - 아 래 - input : n(20); input : starttime(101500),endtime(183000); var : Tcond(false); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0),T(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("매수청산"); if MarketPosition == -1 Then ExitShort("매도청산"); } Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; R1 = 2*Pivot-DayLow(1); R2 = Pivot+DayHigh(1)-DayLow(1); S1 = 2*Pivot-DayHigh(1); S2 = Pivot-DayHigh(1)+DayLow(1); if crossup(C,R2+PriceScale*n) Then T = 5; if crossup(C,R1+PriceScale*n) Then T = 4; if crossup(C,Pivot+PriceScale*n) Then T = 3; if crossup(C,S1+PriceScale*n) Then T = 2; if crossup(C,S2+PriceScale*n) Then T = 1; if CrossDown(C,R2-PriceScale*n) Then T = -5; if CrossDown(C,R1-PriceScale*n) Then T = -4; if CrossDown(C,Pivot-PriceScale*n) Then T = -3; if CrossDown(C,S1-PriceScale*n) Then T = -2; if CrossDown(C,S2-PriceScale*n) Then T = -1; if Tcond == true then { if T != T[1] and T > 0 and T[1] < 0 Then Buy("매수"); if T != T[1] and T < 0 and T[1] > 0 Then Sell("매도"); } if MarketPosition == 1 then { if crossup(c,R2+PriceScale*10) Then exitlong("매수청산H"); if CrossDown(c,S2-PriceScale*10) Then exitlong("매수청산L"); } if MarketPosition == -1 then { if crossup(c,R2+PriceScale*10) Then ExitShort("매도청산H"); if CrossDown(c,S2-PriceScale*10) Then ExitShort("매도청산L"); }
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2019-11-18 09:56:23

> 승부사1 님이 쓴 글입니다. > 제목 : 피봇수식 수정 부탁드립니다. > 아래의 수식을 적용해 보았는데 시그널이 발생하지 않는 구간이 일부 있어서 문의드립니다. 항셍지수선물 챠트에 적용하였구요. 예상하였던 시그널 발생구간에서 발생하지 않은 사례를 파일로 첨부해 드립니다. 점검 좀 부탁드리겠습니다. ~~^^ - 아 래 - input : n(20); input : starttime(101500),endtime(183000); var : Tcond(false); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0),T(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("매수청산"); if MarketPosition == -1 Then ExitShort("매도청산"); } Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; R1 = 2*Pivot-DayLow(1); R2 = Pivot+DayHigh(1)-DayLow(1); S1 = 2*Pivot-DayHigh(1); S2 = Pivot-DayHigh(1)+DayLow(1); if crossup(C,R2+PriceScale*n) Then T = 5; if crossup(C,R1+PriceScale*n) Then T = 4; if crossup(C,Pivot+PriceScale*n) Then T = 3; if crossup(C,S1+PriceScale*n) Then T = 2; if crossup(C,S2+PriceScale*n) Then T = 1; if CrossDown(C,R2-PriceScale*n) Then T = -5; if CrossDown(C,R1-PriceScale*n) Then T = -4; if CrossDown(C,Pivot-PriceScale*n) Then T = -3; if CrossDown(C,S1-PriceScale*n) Then T = -2; if CrossDown(C,S2-PriceScale*n) Then T = -1; if Tcond == true then { if T != T[1] and T > 0 and T[1] < 0 Then Buy("매수"); if T != T[1] and T < 0 and T[1] > 0 Then Sell("매도"); } if MarketPosition == 1 then { if crossup(c,R2+PriceScale*10) Then exitlong("매수청산H"); if CrossDown(c,S2-PriceScale*10) Then exitlong("매수청산L"); } if MarketPosition == -1 then { if crossup(c,R2+PriceScale*10) Then ExitShort("매도청산H"); if CrossDown(c,S2-PriceScale*10) Then ExitShort("매도청산L"); }
프로필 이미지

승부사1

2019-11-18 12:20:00

첨부파일 빠트렸네요 ㅎㅎ 다시 올려드립니다~~~ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 첨부된 파일이 없습니다. > > 승부사1 님이 쓴 글입니다. > 제목 : 피봇수식 수정 부탁드립니다. > 아래의 수식을 적용해 보았는데 시그널이 발생하지 않는 구간이 일부 있어서 문의드립니다. 항셍지수선물 챠트에 적용하였구요. 예상하였던 시그널 발생구간에서 발생하지 않은 사례를 파일로 첨부해 드립니다. 점검 좀 부탁드리겠습니다. ~~^^ - 아 래 - input : n(20); input : starttime(101500),endtime(183000); var : Tcond(false); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0),T(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("매수청산"); if MarketPosition == -1 Then ExitShort("매도청산"); } Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; R1 = 2*Pivot-DayLow(1); R2 = Pivot+DayHigh(1)-DayLow(1); S1 = 2*Pivot-DayHigh(1); S2 = Pivot-DayHigh(1)+DayLow(1); if crossup(C,R2+PriceScale*n) Then T = 5; if crossup(C,R1+PriceScale*n) Then T = 4; if crossup(C,Pivot+PriceScale*n) Then T = 3; if crossup(C,S1+PriceScale*n) Then T = 2; if crossup(C,S2+PriceScale*n) Then T = 1; if CrossDown(C,R2-PriceScale*n) Then T = -5; if CrossDown(C,R1-PriceScale*n) Then T = -4; if CrossDown(C,Pivot-PriceScale*n) Then T = -3; if CrossDown(C,S1-PriceScale*n) Then T = -2; if CrossDown(C,S2-PriceScale*n) Then T = -1; if Tcond == true then { if T != T[1] and T > 0 and T[1] < 0 Then Buy("매수"); if T != T[1] and T < 0 and T[1] > 0 Then Sell("매도"); } if MarketPosition == 1 then { if crossup(c,R2+PriceScale*10) Then exitlong("매수청산H"); if CrossDown(c,S2-PriceScale*10) Then exitlong("매수청산L"); } if MarketPosition == -1 then { if crossup(c,R2+PriceScale*10) Then ExitShort("매도청산H"); if CrossDown(c,S2-PriceScale*10) Then ExitShort("매도청산L"); }
프로필 이미지

예스스탁 예스스탁 답변

2019-11-18 14:20:53

안녕하세요 예스스탁입니다. 해외선물은 차트에서 보이는 시간은 해당봉이 완성(다음봉시가)되는 시간입니다. 3분봉에서 stime으로 10시12분봉이 10시 15분으로 표시가 됩니다. 분봉주기에 따라 해당 봉의 시간이 다르므로 100000으로 시작시간을 지정하시면 됩니다. input : n(20); input : starttime(100000),endtime(183000); var : Tcond(false); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0),T(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("매수청산"); if MarketPosition == -1 Then ExitShort("매도청산"); } Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; R1 = 2*Pivot-DayLow(1); R2 = Pivot+DayHigh(1)-DayLow(1); S1 = 2*Pivot-DayHigh(1); S2 = Pivot-DayHigh(1)+DayLow(1); if crossup(C,R2+PriceScale*n) Then T = 5; if crossup(C,R1+PriceScale*n) Then T = 4; if crossup(C,Pivot+PriceScale*n) Then T = 3; if crossup(C,S1+PriceScale*n) Then T = 2; if crossup(C,S2+PriceScale*n) Then T = 1; if CrossDown(C,R2-PriceScale*n) Then T = -5; if CrossDown(C,R1-PriceScale*n) Then T = -4; if CrossDown(C,Pivot-PriceScale*n) Then T = -3; if CrossDown(C,S1-PriceScale*n) Then T = -2; if CrossDown(C,S2-PriceScale*n) Then T = -1; if sdate == 20191115 Then MessageLog("%s %.2f",Tcond,stime); if Tcond == true then { if T != T[1] and T > 0 and T[1] < 0 Then Buy("매수"); if T != T[1] and T < 0 and T[1] > 0 Then Sell("매도"); } if MarketPosition == 1 then { if crossup(c,R2+PriceScale*10) Then exitlong("매수청산H"); if CrossDown(c,S2-PriceScale*10) Then exitlong("매수청산L"); } if MarketPosition == -1 then { if crossup(c,R2+PriceScale*10) Then ExitShort("매도청산H"); if CrossDown(c,S2-PriceScale*10) Then ExitShort("매도청산L"); } 즐거운 하루되세요 > 승부사1 님이 쓴 글입니다. > 제목 : Re : Re : 첨부된 파일이 없습니다. > 첨부파일 빠트렸네요 ㅎㅎ 다시 올려드립니다~~~ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 첨부된 파일이 없습니다. > > 승부사1 님이 쓴 글입니다. > 제목 : 피봇수식 수정 부탁드립니다. > 아래의 수식을 적용해 보았는데 시그널이 발생하지 않는 구간이 일부 있어서 문의드립니다. 항셍지수선물 챠트에 적용하였구요. 예상하였던 시그널 발생구간에서 발생하지 않은 사례를 파일로 첨부해 드립니다. 점검 좀 부탁드리겠습니다. ~~^^ - 아 래 - input : n(20); input : starttime(101500),endtime(183000); var : Tcond(false); Var : Pivot(0),R1(0),R2(0),S1(0),S2(0),T(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("매수청산"); if MarketPosition == -1 Then ExitShort("매도청산"); } Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; R1 = 2*Pivot-DayLow(1); R2 = Pivot+DayHigh(1)-DayLow(1); S1 = 2*Pivot-DayHigh(1); S2 = Pivot-DayHigh(1)+DayLow(1); if crossup(C,R2+PriceScale*n) Then T = 5; if crossup(C,R1+PriceScale*n) Then T = 4; if crossup(C,Pivot+PriceScale*n) Then T = 3; if crossup(C,S1+PriceScale*n) Then T = 2; if crossup(C,S2+PriceScale*n) Then T = 1; if CrossDown(C,R2-PriceScale*n) Then T = -5; if CrossDown(C,R1-PriceScale*n) Then T = -4; if CrossDown(C,Pivot-PriceScale*n) Then T = -3; if CrossDown(C,S1-PriceScale*n) Then T = -2; if CrossDown(C,S2-PriceScale*n) Then T = -1; if Tcond == true then { if T != T[1] and T > 0 and T[1] < 0 Then Buy("매수"); if T != T[1] and T < 0 and T[1] > 0 Then Sell("매도"); } if MarketPosition == 1 then { if crossup(c,R2+PriceScale*10) Then exitlong("매수청산H"); if CrossDown(c,S2-PriceScale*10) Then exitlong("매수청산L"); } if MarketPosition == -1 then { if crossup(c,R2+PriceScale*10) Then ExitShort("매도청산H"); if CrossDown(c,S2-PriceScale*10) Then ExitShort("매도청산L"); }