커뮤니티

추가 시스템서식 부탁드립니다.

프로필 이미지
미완
2016-08-23 17:34:16
96
글번호 101288
답변완료
아래 수식에서 청산방법을 추가로 부탁드립니다. {추가내용} 지금 현재서식은 매수추세와 매도추세시 매매진입하고 상단, 하단을 돌파하면 무조건 청산되도록 되어있으나 변경하려는 내용은 추세변경없이 청산 구간 돌파시 손실로 있으면 2틱 이익이 되는 시점에 청산되도록 시스템 서식 변경 부탁드립니다. input:b_time1(000000),e_time1(240000), stoK_p11(150),stoK_p12(50),stoK_p13(10), ma_p11(25),ma_p12(5),ma_p13(15),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 = StochasticsKs(stoK_p11,stoK_p12); stoD = StochasticsDs(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);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-08-24 10:48:40

안녕하세요 예스스탁입니다. input:b_time1(000000),e_time1(240000), stoK_p11(150),stoK_p12(50),stoK_p13(10), ma_p11(25),ma_p12(5),ma_p13(15),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 = StochasticsKs(stoK_p11,stoK_p12); stoD = StochasticsDs(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,상단) and c >= EntryPrice Then exitlong("매수청산1",AtMarket); if crossup(stok,상단) and c <= EntryPrice Then exitlong("매수청산2",atlimit,EntryPrice+PriceScale*2); if T == -1 Then exitlong("추세전환(-)",AtMarket); } if T == -1 and Crossup(stok,상단) Then sell("매도",AtMarket); if MarketPosition == -1 Then { if Crossdown(stok,하단) and C <= EntryPrice Then ExitShort("매도청산1",AtMarket); if Crossdown(stok,하단) and C > EntryPrice Then ExitShort("매도청산2",Atlimit,EntryPrice-PriceScale*2); if T == 1 Then exitShort("추세전환(+)",AtMarket); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); 즐거운 하루되세요 > 미완 님이 쓴 글입니다. > 제목 : 추가 시스템서식 부탁드립니다. > 아래 수식에서 청산방법을 추가로 부탁드립니다. {추가내용} 지금 현재서식은 매수추세와 매도추세시 매매진입하고 상단, 하단을 돌파하면 무조건 청산되도록 되어있으나 변경하려는 내용은 추세변경없이 청산 구간 돌파시 손실로 있으면 2틱 이익이 되는 시점에 청산되도록 시스템 서식 변경 부탁드립니다. input:b_time1(000000),e_time1(240000), stoK_p11(150),stoK_p12(50),stoK_p13(10), ma_p11(25),ma_p12(5),ma_p13(15),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 = StochasticsKs(stoK_p11,stoK_p12); stoD = StochasticsDs(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);