커뮤니티

시스템수식 부탁드립니다.

프로필 이미지
미완
2016-08-22 14:10:56
136
글번호 101217
답변완료
[진입조건] 1. 1번 시스템신호 기준으로 진입 [청산조건] => 기존 1번 청산조건에 추가 부문 1. 목표 틱이나 기준선(10, 90) 수익 돌파 시 자동 청산(기존 방식) 2. 1번 시스템신호 조건 진입 후 손실시 추세가 변할 경우 아래 내용 청산조건 추가 ◆ 진입 후 1번 시스템 신호가 추세 변경 시 2번, 3번 지표 추세도 같은 추세신호로 변경 되는 시점일 경우 바로 청산 ◆ 진입 후 1번 시스템 신호가 추세 변경되었으나 2번, 3번 지표 추세중 하나라도 반대 추세 일 경우 2틱 수익에 자동 청산 주문 {1번 시스템 신호} input:b_time1(000000),e_time1(240000), stoK_p11(150),stoK_p12(50),stoK_p13(10), ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15),상단(90),하단(10),익절틱수(10); Var:stoK(0),stoD(0),TRIXv(0),TRIXsig(0),T(0); If b_time1 <= Time and Time <= e_time1 Then { stoK = StochasticsK(stoK_p11,stoK_p12);ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15), stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13); If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1 and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13)) and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1 and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1 and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1 and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1 Then { T = 1; } If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1 and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13)) and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1 and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1 and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1 and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1 Then { T = -1; } if T == 1 and CrossDown(stok,하단) Then buy("매수",AtMarket); if MarketPosition == 1 Then { if crossup(stok,상단) Then exitlong("매수1",AtMarket); if T == -1 Then exitlong("추세전환(-)",AtMarket); } if T == -1 and Crossup(stok,상단) Then sell("매도",AtMarket); if MarketPosition == -1 Then { if Crossdown(stok,하단) Then ExitShort("매도1",AtMarket); if T == 1 Then exitShort("추세전환(+)",AtMarket); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); {2번 추세 지표} input:b_time1(000000),e_time1(240000); Var:ma_p11(10),ma_p12(10),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15); var:ma11(0),ma12(0),ma13(0),ma15(0),ma16(0),ma17(0); var:j(0),매수강도(0),매도강도(0); var : ma_P14_1(0),ma_P14_2(0),ma_P14_3(0),ma_P14_4(0),ma_P14_5(0); var : ma_P14_6(0),ma_P14_7(0),ma_P14_8(0),ma_P14_9(0),ma_P14_10(0); Array:ma14[10](0),추세[10](""); ma11=ma(C,ma_P11); ma12=ma(C,ma_P12); ma13=ma(C,ma_P13); ma15=ma(C,ma_P15); ma16=ma(C,ma_P16); ma17=ma(C,ma_P17); ma_P14_1=ma_P14+1; ma_P14_2=ma_P14+2; ma_P14_3=ma_P14+3; ma_P14_4=ma_P14+4; ma_P14_5=ma_P14+5; ma_P14_6=ma_P14+6; ma_P14_7=ma_P14+7; ma_P14_8=ma_P14+8; ma_P14_9=ma_P14+9; ma_P14_10=ma_P14+10; ma14[1] = ma(C,ma_p14_1); ma14[2] = ma(C,ma_p14_2); ma14[3] = ma(C,ma_p14_3); ma14[4] = ma(C,ma_p14_4); ma14[5] = ma(C,ma_p14_5); ma14[6] = ma(C,ma_p14_6); ma14[7] = ma(C,ma_p14_7); ma14[8] = ma(C,ma_p14_8); ma14[9] = ma(C,ma_p14_9); ma14[10] = ma(C,ma_p14_10); 매수강도=0; 매도강도=0; If b_time1<=Time and Time<= e_time1 Then { For j=1 TO 10 { If countif(ma11[1]<ma11,1)==1 and (ma12[1]<=ma13[1] and ma12>ma13) and countif(ma14[j][1]<ma14[j],1)==1 and countif(ma15[1]<ma15,1)==1 and countif(ma16[1]<ma16,1)==1 and countif(ma17[1]<ma17,1)==1 Then { 추세[j]="매수추세"; } If countif(ma11[1]>ma11,1)==1 and(ma12[1]>=ma13[1] and ma12<ma13) and countif(ma14[j][1]>ma14[j],1)==1 and countif(ma15[1]>ma15,1)==1 and countif(ma16[1]>ma16,1)==1 and countif(ma17[1]>ma17,1)==1 Then { 추세[j] = "매도추세"; } If 추세[j] == "매수추세" Then 매수강도 = 매수강도 +1; If 추세[j] == "매도추세" Then 매도강도 = 매도강도 +1; } If 매수강도 == 10 Then 추세[0] = "매수추세"; If 매도강도 == 10 Then 추세[0] = "매도추세"; Plot1(iff(추세[0]=="매수추세",100,iff(추세[0]=="매도추세",-100,0))); PlotBaseLine1(0); } {3번 추세 지표} 메인화면(3010)에서 기준이 분이나 틱 기준을 몇으로 하든 3번 추세는 무조건 5틱 기준으로 아래의 값이 매수추세와 매도 추세가 나오도록... ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100),ma_p15(10),ma_p16(20),ma_p17(15)
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-08-22 17:28:28

안녕하세요 예스스탁입니다. 문의하신 내용 중 5틱기준으로 계산되게는 작성이 되지 않습니다. 기존 1번식에 진입후 1번과 2번이 반대방향으로 추세변경시 청산하는 내용만 추가해 드립니다. input:b_time1(000000),e_time1(240000), stoK_p11(150),stoK_p12(50),stoK_p13(10), ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15),상단(90),하단(10),익절틱수(10); Var:stoK(0),stoD(0),TRIXv(0),TRIXsig(0),T(0); var:ma11(0),ma12(0),ma13(0),ma15(0),ma16(0),ma17(0); var:j(0),매수강도(0),매도강도(0); var : ma_P14_1(0),ma_P14_2(0),ma_P14_3(0),ma_P14_4(0),ma_P14_5(0); var : ma_P14_6(0),ma_P14_7(0),ma_P14_8(0),ma_P14_9(0),ma_P14_10(0),T2(0); Array:ma14[10](0),추세[10](""); ma11=ma(C,ma_P11); ma12=ma(C,ma_P12); ma13=ma(C,ma_P13); ma15=ma(C,ma_P15); ma16=ma(C,ma_P16); ma17=ma(C,ma_P17); ma_P14_1=ma_P14+1; ma_P14_2=ma_P14+2; ma_P14_3=ma_P14+3; ma_P14_4=ma_P14+4; ma_P14_5=ma_P14+5; ma_P14_6=ma_P14+6; ma_P14_7=ma_P14+7; ma_P14_8=ma_P14+8; ma_P14_9=ma_P14+9; ma_P14_10=ma_P14+10; ma14[1] = ma(C,ma_p14_1); ma14[2] = ma(C,ma_p14_2); ma14[3] = ma(C,ma_p14_3); ma14[4] = ma(C,ma_p14_4); ma14[5] = ma(C,ma_p14_5); ma14[6] = ma(C,ma_p14_6); ma14[7] = ma(C,ma_p14_7); ma14[8] = ma(C,ma_p14_8); ma14[9] = ma(C,ma_p14_9); ma14[10] = ma(C,ma_p14_10); 매수강도=0; 매도강도=0; If b_time1 <= Time and Time <= e_time1 Then { For j=1 TO 10 { If countif(ma11[1]<ma11,1)==1 and (ma12[1]<=ma13[1] and ma12>ma13) and countif(ma14[j][1]<ma14[j],1)==1 and countif(ma15[1]<ma15,1)==1 and countif(ma16[1]<ma16,1)==1 and countif(ma17[1]<ma17,1)==1 Then { 추세[j]="매수추세"; } If countif(ma11[1]>ma11,1)==1 and(ma12[1]>=ma13[1] and ma12<ma13) and countif(ma14[j][1]>ma14[j],1)==1 and countif(ma15[1]>ma15,1)==1 and countif(ma16[1]>ma16,1)==1 and countif(ma17[1]>ma17,1)==1 Then { 추세[j] = "매도추세"; } If 추세[j] == "매수추세" Then 매수강도 = 매수강도 +1; If 추세[j] == "매도추세" Then 매도강도 = 매도강도 +1; } If 매수강도 == 10 Then 추세[0] = "매수추세"; If 매도강도 == 10 Then 추세[0] = "매도추세"; T2 = iff(추세[0]=="매수추세",100,iff(추세[0]=="매도추세",-100,0)); stoK = StochasticsK(stoK_p11,stoK_p12); stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13); If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1 and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13)) and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1 and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1 and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1 and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1 Then { T = 1; } If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1 and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13)) and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1 and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1 and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1 and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1 Then { T = -1; } if T == 1 and CrossDown(stok,하단) Then buy("매수",AtMarket); if MarketPosition == 1 Then { if crossup(stok,상단) Then exitlong("매수1",AtMarket); if T == -1 and T2 == -100 Then exitlong("1번2번추세전환(-)",AtMarket); if T == 1 and T2 == -100 Then exitlong("2번추세전환(-)",atlimit,EntryPrice+PriceScale*2); } if T == -1 and Crossup(stok,상단) Then sell("매도",AtMarket); if MarketPosition == -1 Then { if Crossdown(stok,하단) Then ExitShort("매도1",AtMarket); if T == 1 and T2 == 100 Then exitShort("1번2번추세전환(+)",AtMarket); if T == -1 and T2 == 100 Then exitShort("2번추세전환(+)",Atlimit,EntryPrice-PriceScale*2); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); 즐거운 하루되세요 > 미완 님이 쓴 글입니다. > 제목 : 시스템수식 부탁드립니다. > [진입조건] 1. 1번 시스템신호 기준으로 진입 [청산조건] => 기존 1번 청산조건에 추가 부문 1. 목표 틱이나 기준선(10, 90) 수익 돌파 시 자동 청산(기존 방식) 2. 1번 시스템신호 조건 진입 후 손실시 추세가 변할 경우 아래 내용 청산조건 추가 ◆ 진입 후 1번 시스템 신호가 추세 변경 시 2번, 3번 지표 추세도 같은 추세신호로 변경 되는 시점일 경우 바로 청산 ◆ 진입 후 1번 시스템 신호가 추세 변경되었으나 2번, 3번 지표 추세중 하나라도 반대 추세 일 경우 2틱 수익에 자동 청산 주문 {1번 시스템 신호} input:b_time1(000000),e_time1(240000), stoK_p11(150),stoK_p12(50),stoK_p13(10), ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15),상단(90),하단(10),익절틱수(10); Var:stoK(0),stoD(0),TRIXv(0),TRIXsig(0),T(0); If b_time1 <= Time and Time <= e_time1 Then { stoK = StochasticsK(stoK_p11,stoK_p12);ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15), stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13); If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1 and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13)) and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1 and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1 and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1 and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1 Then { T = 1; } If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1 and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13)) and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1 and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1 and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1 and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1 Then { T = -1; } if T == 1 and CrossDown(stok,하단) Then buy("매수",AtMarket); if MarketPosition == 1 Then { if crossup(stok,상단) Then exitlong("매수1",AtMarket); if T == -1 Then exitlong("추세전환(-)",AtMarket); } if T == -1 and Crossup(stok,상단) Then sell("매도",AtMarket); if MarketPosition == -1 Then { if Crossdown(stok,하단) Then ExitShort("매도1",AtMarket); if T == 1 Then exitShort("추세전환(+)",AtMarket); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); {2번 추세 지표} input:b_time1(000000),e_time1(240000); Var:ma_p11(10),ma_p12(10),ma_p13(10),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15); var:ma11(0),ma12(0),ma13(0),ma15(0),ma16(0),ma17(0); var:j(0),매수강도(0),매도강도(0); var : ma_P14_1(0),ma_P14_2(0),ma_P14_3(0),ma_P14_4(0),ma_P14_5(0); var : ma_P14_6(0),ma_P14_7(0),ma_P14_8(0),ma_P14_9(0),ma_P14_10(0); Array:ma14[10](0),추세[10](""); ma11=ma(C,ma_P11); ma12=ma(C,ma_P12); ma13=ma(C,ma_P13); ma15=ma(C,ma_P15); ma16=ma(C,ma_P16); ma17=ma(C,ma_P17); ma_P14_1=ma_P14+1; ma_P14_2=ma_P14+2; ma_P14_3=ma_P14+3; ma_P14_4=ma_P14+4; ma_P14_5=ma_P14+5; ma_P14_6=ma_P14+6; ma_P14_7=ma_P14+7; ma_P14_8=ma_P14+8; ma_P14_9=ma_P14+9; ma_P14_10=ma_P14+10; ma14[1] = ma(C,ma_p14_1); ma14[2] = ma(C,ma_p14_2); ma14[3] = ma(C,ma_p14_3); ma14[4] = ma(C,ma_p14_4); ma14[5] = ma(C,ma_p14_5); ma14[6] = ma(C,ma_p14_6); ma14[7] = ma(C,ma_p14_7); ma14[8] = ma(C,ma_p14_8); ma14[9] = ma(C,ma_p14_9); ma14[10] = ma(C,ma_p14_10); 매수강도=0; 매도강도=0; If b_time1<=Time and Time<= e_time1 Then { For j=1 TO 10 { If countif(ma11[1]<ma11,1)==1 and (ma12[1]<=ma13[1] and ma12>ma13) and countif(ma14[j][1]<ma14[j],1)==1 and countif(ma15[1]<ma15,1)==1 and countif(ma16[1]<ma16,1)==1 and countif(ma17[1]<ma17,1)==1 Then { 추세[j]="매수추세"; } If countif(ma11[1]>ma11,1)==1 and(ma12[1]>=ma13[1] and ma12<ma13) and countif(ma14[j][1]>ma14[j],1)==1 and countif(ma15[1]>ma15,1)==1 and countif(ma16[1]>ma16,1)==1 and countif(ma17[1]>ma17,1)==1 Then { 추세[j] = "매도추세"; } If 추세[j] == "매수추세" Then 매수강도 = 매수강도 +1; If 추세[j] == "매도추세" Then 매도강도 = 매도강도 +1; } If 매수강도 == 10 Then 추세[0] = "매수추세"; If 매도강도 == 10 Then 추세[0] = "매도추세"; Plot1(iff(추세[0]=="매수추세",100,iff(추세[0]=="매도추세",-100,0))); PlotBaseLine1(0); } {3번 추세 지표} 메인화면(3010)에서 기준이 분이나 틱 기준을 몇으로 하든 3번 추세는 무조건 5틱 기준으로 아래의 값이 매수추세와 매도 추세가 나오도록... ma_p11(10),ma_p12(5),ma_p13(10),ma_p14(100),ma_p15(10),ma_p16(20),ma_p17(15)