커뮤니티

수식 문의 드립니다

프로필 이미지
푸른
2022-11-10 14:45:00
1182
글번호 163684
답변완료

첨부 이미지

1. 지표 input : Per1(23.6),Per2(38.2),Per3(50.0),Per4(61.8),Per5(76.4); var : HH(0),LL(0); if date > date[1]+1 Then{ HH = H; LL = L; } if H > HH Then HH = H; if L < LL Then LL = L; var1 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per1/100)); var2 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per2/100)); var3 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per3/100)); var4 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per4/100)); var5 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per5/100)); plot1(HH,"H"); plot2(var1,"23.6"); plot3(var2,"38.2"); plot4(var3,"50.0"); plot5(var4,"61.8"); plot6(var5,"76.4"); plot7(LL,"L"); ---------------- 위 지표를 이용한 아래 시스템 작성을 부탁드립니다. 매수 plot2 청산 plot6 매도 plot2 청산 plot6 매매시간 08 : 00 ~ 익일 05 :00 손절 100틱 ----------------------------------- input : starttime(110000),endtime(500000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); 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("bx"); if MarketPosition == -1 Then ExitShort("sx"); } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; } if NextBarSdate == sDate Then { if NextBarOpen >= C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*20); Sell("s2",AtStop,NextBarOpen-PriceScale*20); } if NextBarOpen <= C Then { ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10); } } if MarketPosition > 1 Then Sell("sss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("sss1",AtStop,EntryPrice+10); if NextBarSdate == sDate Then { if NextBarOpen <= C Then { Buy("b3",AtStop,NextBarOpen+PriceScale*20); Sell("s3",AtStop,NextBarOpen-PriceScale*20); } if NextBarOpen >= C Then { ExitLong("bx3",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx3",AtStop,NextBarOpen+PriceScale*10); } if MarketPosition > 1 Then Sell("ssss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("ssss1",AtStop,EntryPrice+10); } if NextBarSdate != sDate Then { if NextBarOpen <= C Then { Buy("b4",AtStop,NextBarOpen+PriceScale*20); Sell("s4",AtStop,NextBarOpen-PriceScale*20); } if NextBarOpen >= C Then { ExitLong("bx4",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx4",AtStop,NextBarOpen+PriceScale*10); } if MarketPosition > 1 Then Sell("sssss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("sssss1",AtStop,EntryPrice+10); } 진입 매수,매도1회 청산은 익일 5시의 수식어를 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-11-10 16:41:46

안녕하세요 예스스탁입니다. input : starttime(80000),endtime(50000); input : Per1(23.6),Per2(38.2),Per3(50.0),Per4(61.8),Per5(76.4); var : HH(0),LL(0); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } if date > date[1]+1 Then { HH = H; LL = L; } if H > HH Then HH = H; if L < LL Then LL = L; var1 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per1/100));#plot2 var2 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per2/100)); var3 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per3/100)); var4 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per4/100)); var5 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per5/100));#plot6 if Tcond == true Then { if CrossDown(c,Var2) Then Sell(); if CrossUp(c,Var6) Then Buy(); } SetStopLoss(PriceScale*100,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 수식 문의 드립니다 > 1. 지표 input : Per1(23.6),Per2(38.2),Per3(50.0),Per4(61.8),Per5(76.4); var : HH(0),LL(0); if date > date[1]+1 Then{ HH = H; LL = L; } if H > HH Then HH = H; if L < LL Then LL = L; var1 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per1/100)); var2 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per2/100)); var3 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per3/100)); var4 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per4/100)); var5 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per5/100)); plot1(HH,"H"); plot2(var1,"23.6"); plot3(var2,"38.2"); plot4(var3,"50.0"); plot5(var4,"61.8"); plot6(var5,"76.4"); plot7(LL,"L"); ---------------- 위 지표를 이용한 아래 시스템 작성을 부탁드립니다. 매수 plot2 청산 plot6 매도 plot2 청산 plot6 매매시간 08 : 00 ~ 익일 05 :00 손절 100틱 ----------------------------------- input : starttime(110000),endtime(500000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); 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("bx"); if MarketPosition == -1 Then ExitShort("sx"); } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; } if NextBarSdate == sDate Then { if NextBarOpen >= C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*20); Sell("s2",AtStop,NextBarOpen-PriceScale*20); } if NextBarOpen <= C Then { ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10); } } if MarketPosition > 1 Then Sell("sss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("sss1",AtStop,EntryPrice+10); if NextBarSdate == sDate Then { if NextBarOpen <= C Then { Buy("b3",AtStop,NextBarOpen+PriceScale*20); Sell("s3",AtStop,NextBarOpen-PriceScale*20); } if NextBarOpen >= C Then { ExitLong("bx3",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx3",AtStop,NextBarOpen+PriceScale*10); } if MarketPosition > 1 Then Sell("ssss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("ssss1",AtStop,EntryPrice+10); } if NextBarSdate != sDate Then { if NextBarOpen <= C Then { Buy("b4",AtStop,NextBarOpen+PriceScale*20); Sell("s4",AtStop,NextBarOpen-PriceScale*20); } if NextBarOpen >= C Then { ExitLong("bx4",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx4",AtStop,NextBarOpen+PriceScale*10); } if MarketPosition > 1 Then Sell("sssss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("sssss1",AtStop,EntryPrice+10); } 진입 매수,매도1회 청산은 익일 5시의 수식어를 부탁드립니다.