커뮤니티

문의합니다

프로필 이미지
남산
2022-10-25 17:52:20
912
글번호 163283
답변완료
input : 시작시간(090000),종료시간(0); input : Period1(1),Period2(2),Period3(3),Period4(4),Period5(5),Period6(6),Period7(7),Period8(8),Period9(9),Period10(10),Period11(11),Period12(12),Period15(15),Period20(20),Period25(25),Period30(30),Period35(35),Period40(40),Period52(52),Period70(70),Period80(80), Period105(105),Period140(140),Period150(150),Period210(210),Period280(280),Period300(300),Period420(420),Period480(480),Period520(520),Period560(560),Period600(600),Period840(840),Period900(810),Period1120(1120),Period1200(1200),Period1800(1800),Period2400(2400),Period2800(2800),Period3360(3360),Period3600(3600),Period4800(4800),Period7200(7200), Period58(58),Period60(60),Period62(62),Period82(82),Period84(84),Period28(70),Period31(11),Period32(24),Period33(5), Period41(35),Period42(35),Period43(35),Period48(15),Period1001(850),Period1002(520),Period1003(480),Period1008(36),aa4(0.4),aa5(0.5),aa6(0.8),익절틱수(63),손절틱수(91); var : mav1(0),mav2(0),mav3(0),mav4(0),mav5(0),mav6(0),mav7(0),mav8(0),mav9(0),mav10(0),mav11(0),mav12(0),mav15(0),mav20(0),mav25(0),mav30(0),mav35(0),mav40(0),mav52(0),mav70(0),mav80(0),mav105(0),mav140(0),mav150(0),mav210(0),mav280(0),mav300(0),mav420(0),mav480(0),mav520(0),mav560(0),mav600(0), mav840(0),mav900(0),mav1120(0),mav1200(0),mav1800(0),mav2400(0),mav2800(0),mav3360(0),mav3600(0),mav4800(0),mav7200(0), mav58(0),mav60(0),mav62(0),mav82(0),mav84(0),mav28(0),mav31(0),mav32(0),mav33(0), mav41(0),mav42(0),mav43(0),mav48(0),mav1001(0),mav1002(0),mav1003(0),mav1008(0),Bxcond(false),Sxcond(false); var : Tcond(false); var : T(0); var : ii(0); var : BE1(0),BE2(0),BE3(0),BE4(0),BE5(0); var : SE1(0),SE2(0),SE3(0),SE4(0),SE5(0); mav1 = ma(c, Period1); mav2 = ma(c, Period2); mav3 = ma(c, Period3); mav4 = ma(c, Period4); mav5 = ma(c, Period5); mav6 = ma(c, Period6); mav7 = ma(c, Period7); mav8 = ma(c, Period8); mav9 = ma(c, Period9); mav10 = ma(c, Period10); mav11 = ma(c, Period11); mav12 = ma(c, Period12); mav15 = ma(c, Period15); mav20 = ma(c, Period20); mav25 = ma(c, Period25); mav30 = ma(c, Period30); mav35 = ma(c, Period35); mav40 = ma(c, Period40); mav52 = ma(c, Period52); mav70 = ma(c, Period70); mav80 = ma(c, Period80); mav105 = ma(c, Period105); mav140 = ma(c, Period140); mav150 = ma(c, Period150); mav210 = ma(c, Period210); mav280 = ma(c, Period280); mav300 = ma(c, Period300); mav420 = ma(c, Period420); mav480 = ma(c, Period480); mav520 = ma(c, Period520); mav560 = ma(c, Period560); mav600 = ma(c, Period600); mav840 = ma(c, Period840); mav900 = ma(c, Period900); mav1120 = ma(c, Period1120); mav1200 = ma(c, Period1200); mav1800 = ma(c, Period1800); mav2400 = ma(c, Period2400); mav2800 = ma(c, Period2800); mav3360 = ma(c, Period3360); mav3600 = ma(c, Period3600); mav4800 = ma(c, Period4800); mav7200 = ma(c, Period7200); mav58 = ma(c, Period58); mav60 = ma(c, Period60); mav62 = ma(c, Period62); mav82 = ma(c, Period82); mav84 = ma(c, Period84); mav28 = ma(c, Period28); mav31 = ma(c, Period31); mav32 = ma(c, Period32); mav33 = ma(c, Period33); mav41 = ma(c, Period41); mav42 = ma(c, Period42); mav43 = ma(c, Period43); mav48 = ma(c, Period48); mav1001 = ma(c, Period1001); mav1002 = ma(c, Period1002); mav1003 = ma(c, Period1003); mav1008 = ma(c, Period1008); var1 = abs(c-mav70); var2 = abs(mav10-mav20); var3 = abs(mav20-mav35); var4 = abs(mav35-mav70); var5 = abs(mav70-mav140); var6 = abs(mav140-mav280); var7 = abs(mav280-mav560); var8 = abs(mav560-mav1120); var9 = abs(mav1120-mav1800); var10 = abs(mav1800-mav3360); var11 = abs(mav3360-mav3600); input : Atime(20),P1(5),P2(20),P3(60); var : TF(0),cnt(0),sum1(0),mav1(0),sum2(0),mav2(0),sum3(0),mav3(0); Array : CC[500](0); TF = TimeToMinutes(stime)%Atime; if dayindex() == 0 or (TF < TF[1] and stime > stime[1]) Then{ for cnt = 1 to 499{ CC[cnt] = CC[cnt-1][1]; } } CC[0] = C; if CC[P3-1] > 0 then{ sum1 = 0; sum2 = 0; sum3 = 0; for cnt = 0 to P3{ if cnt < P1 Then sum1 = sum1+CC[cnt]; if cnt < P2 Then sum2 = sum2+CC[cnt]; if cnt < P3 Then sum3 = sum3+CC[cnt]; } } if (sdate != sdate[1] and stime >= 시작시간) or (sdate == sdate[1] and (Stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간))) Then { Tcond = True; BXcond = false; SXcond = false; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then { Tcond = false; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true then { if MarketPosition >= 0 Then { if mav600[1] > mav600 and and mav300[1] > mav300 Then { if CurrentContracts < 1 Then sell("s1",OnClose,def,1); } Else { if mav800[1] > mav800 and and mav500[1] > mav500 and CurrentContracts < 1 Then sell("s2",OnClose,def,1); } } 문의합니다 1번. 틱봉에서 분봉(20분) 이평을 수식에 적용하려도 합니다 적용한 수식이 맞는지요 수정 부탁합니다 2번. 매도를 진행할 경우 mav600[1] > mav600 and and mav300[1] > mav300로 매도를 진행할 경우 20분 20이평 > 5이평 클때만 매도진입을 진행하려면 수식을 어떻게 표기하여야 하나요 즉 20분 20이평선 > 5이평선 and mav600[1] > mav600 and and mav300[1] > mav300 일 때 매도를 진입하고자 합니다 수식을 표기하여 주세요 감사합니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-10-26 13:28:26

안녕하세요 예스스탁입니다. 1 랭귀지는 봉의 시고저종가만 사용이 가능합니다. 분봉의 시간경계의 값이 봉내부에 있는 경우가 많습니다. 내부의 특정시간값은 알수 없어틱봉에서 분봉의 지표값은 정확한 계산이 불가능합니다. 해당식은 가장 근사값으로 보기 위함입니다. 2 if CC[P3-1] > 0 then { sum1 = 0; sum2 = 0; sum3 = 0; for cnt = 0 to P3 { if cnt < P1 Then sum1 = sum1+CC[cnt]; if cnt < P2 Then sum2 = sum2+CC[cnt]; if cnt < P3 Then sum3 = sum3+CC[cnt]; } } 올리신 수식에 값을 합산하는 내용만 있고 평균을 계산하는 내용이 없습니다. 이평값을 추가해 드립니다. 변수값이 상단에 지정한 이름과 같이 bmav1,bmav2,bma3로 지정해 드립니다. 3 매도식에 사용된 mav300, mav600가 선언 및 값 저장이 없습니다. 수식 내용 추가하시기 바랍니다. input : 시작시간(090000),종료시간(0); input : Period1(1),Period2(2),Period3(3),Period4(4),Period5(5),Period6(6),Period7(7),Period8(8),Period9(9),Period10(10),Period11(11),Period12(12),Period15(15),Period20(20),Period25(25),Period30(30),Period35(35),Period40(40),Period52(52),Period70(70),Period80(80), Period105(105),Period140(140),Period150(150),Period210(210),Period280(280),Period300(300),Period420(420),Period480(480),Period520(520),Period560(560),Period600(600),Period840(840),Period900(810),Period1120(1120),Period1200(1200),Period1800(1800),Period2400(2400),Period2800(2800),Period3360(3360),Period3600(3600),Period4800(4800),Period7200(7200), Period58(58),Period60(60),Period62(62),Period82(82),Period84(84),Period28(70),Period31(11),Period32(24),Period33(5), Period41(35),Period42(35),Period43(35),Period48(15),Period1001(850),Period1002(520),Period1003(480),Period1008(36),aa4(0.4),aa5(0.5),aa6(0.8),익절틱수(63),손절틱수(91); var : mav1(0),mav2(0),mav3(0),mav4(0),mav5(0),mav6(0),mav7(0),mav8(0),mav9(0),mav10(0),mav11(0),mav12(0),mav15(0),mav20(0),mav25(0),mav30(0),mav35(0),mav40(0),mav52(0),mav70(0),mav80(0),mav105(0),mav140(0),mav150(0),mav210(0),mav280(0),mav300(0),mav420(0),mav480(0),mav520(0),mav560(0),mav600(0), mav840(0),mav900(0),mav1120(0),mav1200(0),mav1800(0),mav2400(0),mav2800(0),mav3360(0),mav3600(0),mav4800(0),mav7200(0), mav58(0),mav60(0),mav62(0),mav82(0),mav84(0),mav28(0),mav31(0),mav32(0),mav33(0), mav41(0),mav42(0),mav43(0),mav48(0),mav1001(0),mav1002(0),mav1003(0),mav1008(0),Bxcond(false),Sxcond(false); var : Tcond(false); var : T(0); var : ii(0); var : BE1(0),BE2(0),BE3(0),BE4(0),BE5(0); var : SE1(0),SE2(0),SE3(0),SE4(0),SE5(0); mav1 = ma(c, Period1); mav2 = ma(c, Period2); mav3 = ma(c, Period3); mav4 = ma(c, Period4); mav5 = ma(c, Period5); mav6 = ma(c, Period6); mav7 = ma(c, Period7); mav8 = ma(c, Period8); mav9 = ma(c, Period9); mav10 = ma(c, Period10); mav11 = ma(c, Period11); mav12 = ma(c, Period12); mav15 = ma(c, Period15); mav20 = ma(c, Period20); mav25 = ma(c, Period25); mav30 = ma(c, Period30); mav35 = ma(c, Period35); mav40 = ma(c, Period40); mav52 = ma(c, Period52); mav70 = ma(c, Period70); mav80 = ma(c, Period80); mav105 = ma(c, Period105); mav140 = ma(c, Period140); mav150 = ma(c, Period150); mav210 = ma(c, Period210); mav280 = ma(c, Period280); mav300 = ma(c, Period300); mav420 = ma(c, Period420); mav480 = ma(c, Period480); mav520 = ma(c, Period520); mav560 = ma(c, Period560); mav600 = ma(c, Period600); mav840 = ma(c, Period840); mav900 = ma(c, Period900); mav1120 = ma(c, Period1120); mav1200 = ma(c, Period1200); mav1800 = ma(c, Period1800); mav2400 = ma(c, Period2400); mav2800 = ma(c, Period2800); mav3360 = ma(c, Period3360); mav3600 = ma(c, Period3600); mav4800 = ma(c, Period4800); mav7200 = ma(c, Period7200); mav58 = ma(c, Period58); mav60 = ma(c, Period60); mav62 = ma(c, Period62); mav82 = ma(c, Period82); mav84 = ma(c, Period84); mav28 = ma(c, Period28); mav31 = ma(c, Period31); mav32 = ma(c, Period32); mav33 = ma(c, Period33); mav41 = ma(c, Period41); mav42 = ma(c, Period42); mav43 = ma(c, Period43); mav48 = ma(c, Period48); mav1001 = ma(c, Period1001); mav1002 = ma(c, Period1002); mav1003 = ma(c, Period1003); mav1008 = ma(c, Period1008); var1 = abs(c-mav70); var2 = abs(mav10-mav20); var3 = abs(mav20-mav35); var4 = abs(mav35-mav70); var5 = abs(mav70-mav140); var6 = abs(mav140-mav280); var7 = abs(mav280-mav560); var8 = abs(mav560-mav1120); var9 = abs(mav1120-mav1800); var10 = abs(mav1800-mav3360); var11 = abs(mav3360-mav3600); input : Atime(20),P1(5),P2(20),P3(60); var : TF(0),cnt(0),sum1(0),bmav1(0),sum2(0),bmav2(0),sum3(0),bmav3(0); Array : CC[500](0); TF = TimeToMinutes(stime)%Atime; if dayindex() == 0 or (TF < TF[1] and stime > stime[1]) Then { for cnt = 1 to 499 { CC[cnt] = CC[cnt-1][1]; } } CC[0] = C; if CC[P3-1] > 0 then { sum1 = 0; sum2 = 0; sum3 = 0; for cnt = 0 to P3 { if cnt < P1 Then sum1 = sum1+CC[cnt]; if cnt < P2 Then sum2 = sum2+CC[cnt]; if cnt < P3 Then sum3 = sum3+CC[cnt]; } Bmav1 = sum1/P1; Bmav2 = sum2/P2; Bmav3 = sum3/P3; } if (sdate != sdate[1] and stime >= 시작시간) or (sdate == sdate[1] and (Stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간))) Then { Tcond = True; BXcond = false; SXcond = false; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then { Tcond = false; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true then { if MarketPosition >= 0 Then { if mav600[1] > mav600 and mav300[1] > mav300 and Bmav2 > Bmav1 Then { if CurrentContracts < 1 Then sell("s1",OnClose,def,1); } Else { if mav800[1] > mav800 and mav500[1] > mav500 and CurrentContracts < 1 Then sell("s2",OnClose,def,1); } } } 즐거운 하루되세요 > 남산 님이 쓴 글입니다. > 제목 : 문의합니다 > input : 시작시간(090000),종료시간(0); input : Period1(1),Period2(2),Period3(3),Period4(4),Period5(5),Period6(6),Period7(7),Period8(8),Period9(9),Period10(10),Period11(11),Period12(12),Period15(15),Period20(20),Period25(25),Period30(30),Period35(35),Period40(40),Period52(52),Period70(70),Period80(80), Period105(105),Period140(140),Period150(150),Period210(210),Period280(280),Period300(300),Period420(420),Period480(480),Period520(520),Period560(560),Period600(600),Period840(840),Period900(810),Period1120(1120),Period1200(1200),Period1800(1800),Period2400(2400),Period2800(2800),Period3360(3360),Period3600(3600),Period4800(4800),Period7200(7200), Period58(58),Period60(60),Period62(62),Period82(82),Period84(84),Period28(70),Period31(11),Period32(24),Period33(5), Period41(35),Period42(35),Period43(35),Period48(15),Period1001(850),Period1002(520),Period1003(480),Period1008(36),aa4(0.4),aa5(0.5),aa6(0.8),익절틱수(63),손절틱수(91); var : mav1(0),mav2(0),mav3(0),mav4(0),mav5(0),mav6(0),mav7(0),mav8(0),mav9(0),mav10(0),mav11(0),mav12(0),mav15(0),mav20(0),mav25(0),mav30(0),mav35(0),mav40(0),mav52(0),mav70(0),mav80(0),mav105(0),mav140(0),mav150(0),mav210(0),mav280(0),mav300(0),mav420(0),mav480(0),mav520(0),mav560(0),mav600(0), mav840(0),mav900(0),mav1120(0),mav1200(0),mav1800(0),mav2400(0),mav2800(0),mav3360(0),mav3600(0),mav4800(0),mav7200(0), mav58(0),mav60(0),mav62(0),mav82(0),mav84(0),mav28(0),mav31(0),mav32(0),mav33(0), mav41(0),mav42(0),mav43(0),mav48(0),mav1001(0),mav1002(0),mav1003(0),mav1008(0),Bxcond(false),Sxcond(false); var : Tcond(false); var : T(0); var : ii(0); var : BE1(0),BE2(0),BE3(0),BE4(0),BE5(0); var : SE1(0),SE2(0),SE3(0),SE4(0),SE5(0); mav1 = ma(c, Period1); mav2 = ma(c, Period2); mav3 = ma(c, Period3); mav4 = ma(c, Period4); mav5 = ma(c, Period5); mav6 = ma(c, Period6); mav7 = ma(c, Period7); mav8 = ma(c, Period8); mav9 = ma(c, Period9); mav10 = ma(c, Period10); mav11 = ma(c, Period11); mav12 = ma(c, Period12); mav15 = ma(c, Period15); mav20 = ma(c, Period20); mav25 = ma(c, Period25); mav30 = ma(c, Period30); mav35 = ma(c, Period35); mav40 = ma(c, Period40); mav52 = ma(c, Period52); mav70 = ma(c, Period70); mav80 = ma(c, Period80); mav105 = ma(c, Period105); mav140 = ma(c, Period140); mav150 = ma(c, Period150); mav210 = ma(c, Period210); mav280 = ma(c, Period280); mav300 = ma(c, Period300); mav420 = ma(c, Period420); mav480 = ma(c, Period480); mav520 = ma(c, Period520); mav560 = ma(c, Period560); mav600 = ma(c, Period600); mav840 = ma(c, Period840); mav900 = ma(c, Period900); mav1120 = ma(c, Period1120); mav1200 = ma(c, Period1200); mav1800 = ma(c, Period1800); mav2400 = ma(c, Period2400); mav2800 = ma(c, Period2800); mav3360 = ma(c, Period3360); mav3600 = ma(c, Period3600); mav4800 = ma(c, Period4800); mav7200 = ma(c, Period7200); mav58 = ma(c, Period58); mav60 = ma(c, Period60); mav62 = ma(c, Period62); mav82 = ma(c, Period82); mav84 = ma(c, Period84); mav28 = ma(c, Period28); mav31 = ma(c, Period31); mav32 = ma(c, Period32); mav33 = ma(c, Period33); mav41 = ma(c, Period41); mav42 = ma(c, Period42); mav43 = ma(c, Period43); mav48 = ma(c, Period48); mav1001 = ma(c, Period1001); mav1002 = ma(c, Period1002); mav1003 = ma(c, Period1003); mav1008 = ma(c, Period1008); var1 = abs(c-mav70); var2 = abs(mav10-mav20); var3 = abs(mav20-mav35); var4 = abs(mav35-mav70); var5 = abs(mav70-mav140); var6 = abs(mav140-mav280); var7 = abs(mav280-mav560); var8 = abs(mav560-mav1120); var9 = abs(mav1120-mav1800); var10 = abs(mav1800-mav3360); var11 = abs(mav3360-mav3600); input : Atime(20),P1(5),P2(20),P3(60); var : TF(0),cnt(0),sum1(0),mav1(0),sum2(0),mav2(0),sum3(0),mav3(0); Array : CC[500](0); TF = TimeToMinutes(stime)%Atime; if dayindex() == 0 or (TF < TF[1] and stime > stime[1]) Then{ for cnt = 1 to 499{ CC[cnt] = CC[cnt-1][1]; } } CC[0] = C; if CC[P3-1] > 0 then{ sum1 = 0; sum2 = 0; sum3 = 0; for cnt = 0 to P3{ if cnt < P1 Then sum1 = sum1+CC[cnt]; if cnt < P2 Then sum2 = sum2+CC[cnt]; if cnt < P3 Then sum3 = sum3+CC[cnt]; } } if (sdate != sdate[1] and stime >= 시작시간) or (sdate == sdate[1] and (Stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간))) Then { Tcond = True; BXcond = false; SXcond = false; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then { Tcond = false; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true then { if MarketPosition >= 0 Then { if mav600[1] > mav600 and and mav300[1] > mav300 Then { if CurrentContracts < 1 Then sell("s1",OnClose,def,1); } Else { if mav800[1] > mav800 and and mav500[1] > mav500 and CurrentContracts < 1 Then sell("s2",OnClose,def,1); } } 문의합니다 1번. 틱봉에서 분봉(20분) 이평을 수식에 적용하려도 합니다 적용한 수식이 맞는지요 수정 부탁합니다 2번. 매도를 진행할 경우 mav600[1] > mav600 and and mav300[1] > mav300로 매도를 진행할 경우 20분 20이평 > 5이평 클때만 매도진입을 진행하려면 수식을 어떻게 표기하여야 하나요 즉 20분 20이평선 > 5이평선 and mav600[1] > mav600 and and mav300[1] > mav300 일 때 매도를 진입하고자 합니다 수식을 표기하여 주세요 감사합니다