커뮤니티

수식 2 요청 드립니다.

프로필 이미지
dandy
2015-09-29 19:20:40
132
글번호 90752
답변완료
수식 2가지 요청 드립니다. 1. 수익 보전 이평 추적 청산 수식 오버형 기존 시스템에서 매수 신호 발생 후 ->시초가 기준 3일 이상 경과(신호 발생일 제외, 외부변수) + 1.5PT(외부변수) 이상 수익 발생 (당일 직전봉 종가 기준) 2가지 조건 충족한 후, 5이평이 10이평을 하향돌파 조건 발생 즉시 수익보전 청산수식 오버형 기존 시스템에서 매도 신호 발생 후 ->시초가 기준 3일 이상 경과(신호 발생일 제외, 외부변수) + 1.5PT(외부변수) 이상 수익 발생 (당일 직전봉 종가 기준) 2가지 조건 충족한 후, 5이평이 10이평을 상향돌파 조건 발생 즉시 수익보전 청산수식 ----------------------------------------------------------------------------------------------------------- 2. 아래 오버형 기존 수식에서, 설정 변폭내 진입과 청산을 제한하는 수식의 고정설정 변폭을 -> 1개월 전( 매일 전 22 거래일 만 합산 )부터 전일 종가까지 매일 누적 합산한 변폭의 평균변폭 값으로 시초가(09:00)에 매일 변동 적용되는 수식으로 변경 요청 드립니다. 감사합니다. 2. input : Pt(4); if 매수조건 Then{ #첫매수 if MarketPosition == 0 Then buy(); #추가매수 if MarketPosition != 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then buy(); } if 매도조건 Then{ #첫매도 if MarketPosition == 0 Then sell(); #추가매도 if MarketPosition != 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then buy(); } #매수진입후 pt이상 변폭이 발생하고 매수청산조건이 만족하면 청산 if MarketPosition == 1 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ if 매수청산조건 Then exitlong(); } #매도진입후 pt이상 변폭이 발생하고 매도청산조건이 만족하면 청산 if MarketPosition == -1 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ if 매도청산조건 Then ExitShort(); } #무포지션이거나 스위칭이 되면 강제청산 해제 if MarketPosition != 0 or (MarketPosition != 0 and MarketPosition != MarketPosition[1]) Then{ SetStopProfittarget(0); SetStoploss(0); } #포지션 진입후 pt이상 변폭이 발생하면 셋팅 if MarketPosition == 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ SetStopProfittarget(1,PointStop); SetStoploss(1,PointStop); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-09-30 13:58:55

안녕하세요 예스스탁입니다. 1. input : N(3),Pt(1.5); var : Didx(0),Bidx(0),Sidx(0),mav1(0),mav2(0); mav1 = ma(c,5); mav2 = ma(c,10); if date != date[1] Then Didx = Didx+1; if MarketPosition == 1 Then{ if MarketPosition[1] != 1 Then Bidx = Didx; if Didx >= Bidx+N then{ if C >= EntryPrice+pt Then Condition1 = true; if Condition1 == true and CrossDown(mav1,mav2) Then exitlong(); } } if MarketPosition != 1 Then Condition1 = false; if MarketPosition == -1 Then{ if MarketPosition[1] != -1 Then Sidx = Didx; if Didx >= Sidx+N then{ if C <= EntryPrice-pt Then Condition2 = true; if Condition2 == true and CrossUp(mav1,mav2) Then ExitShort(); } } if MarketPosition != -1 Then Condition2 = false; 2. input : Pt(4); var : HH(0),LL(0),cnt(0); if 매수조건 Then{ #첫매수 if MarketPosition == 0 Then buy(); #추가매수 if MarketPosition != 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then buy(); } if 매도조건 Then{ #첫매도 if MarketPosition == 0 Then sell(); #추가매도 if MarketPosition != 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then buy(); } HH = dayhigh(1); LL = daylow(1); for cnt = 1 to 22{ if dayhigh(cnt) > HH Then HH = dayhigh(cnt); if dayLow(cnt) < LL Then LL = DayLow(cnt); } #매수진입후 pt이상 변폭이 발생하고 매수청산조건이 만족하면 청산 if MarketPosition == 1 and HH-LL >= pt Then{ if 매수청산조건 Then exitlong(); } #매도진입후 pt이상 변폭이 발생하고 매도청산조건이 만족하면 청산 if MarketPosition == -1 and HH-LL >= pt Then{ if 매도청산조건 Then ExitShort(); } #무포지션이거나 스위칭이 되면 강제청산 해제 if MarketPosition != 0 or (MarketPosition != 0 and MarketPosition != MarketPosition[1]) Then{ SetStopProfittarget(0); SetStoploss(0); } #포지션 진입후 pt이상 변폭이 발생하면 셋팅 if MarketPosition == 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ SetStopProfittarget(1,PointStop); SetStoploss(1,PointStop); } 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식 2 요청 드립니다. > 수식 2가지 요청 드립니다. 1. 수익 보전 이평 추적 청산 수식 오버형 기존 시스템에서 매수 신호 발생 후 ->시초가 기준 3일 이상 경과(신호 발생일 제외, 외부변수) + 1.5PT(외부변수) 이상 수익 발생 (당일 직전봉 종가 기준) 2가지 조건 충족한 후, 5이평이 10이평을 하향돌파 조건 발생 즉시 수익보전 청산수식 오버형 기존 시스템에서 매도 신호 발생 후 ->시초가 기준 3일 이상 경과(신호 발생일 제외, 외부변수) + 1.5PT(외부변수) 이상 수익 발생 (당일 직전봉 종가 기준) 2가지 조건 충족한 후, 5이평이 10이평을 상향돌파 조건 발생 즉시 수익보전 청산수식 ----------------------------------------------------------------------------------------------------------- 2. 아래 오버형 기존 수식에서, 설정 변폭내 진입과 청산을 제한하는 수식의 고정설정 변폭을 -> 1개월 전( 매일 전 22 거래일 만 합산 )부터 전일 종가까지 매일 누적 합산한 변폭의 평균변폭 값으로 시초가(09:00)에 매일 변동 적용되는 수식으로 변경 요청 드립니다. 감사합니다. 2. input : Pt(4); if 매수조건 Then{ #첫매수 if MarketPosition == 0 Then buy(); #추가매수 if MarketPosition != 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then buy(); } if 매도조건 Then{ #첫매도 if MarketPosition == 0 Then sell(); #추가매도 if MarketPosition != 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then buy(); } #매수진입후 pt이상 변폭이 발생하고 매수청산조건이 만족하면 청산 if MarketPosition == 1 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ if 매수청산조건 Then exitlong(); } #매도진입후 pt이상 변폭이 발생하고 매도청산조건이 만족하면 청산 if MarketPosition == -1 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ if 매도청산조건 Then ExitShort(); } #무포지션이거나 스위칭이 되면 강제청산 해제 if MarketPosition != 0 or (MarketPosition != 0 and MarketPosition != MarketPosition[1]) Then{ SetStopProfittarget(0); SetStoploss(0); } #포지션 진입후 pt이상 변폭이 발생하면 셋팅 if MarketPosition == 0 and highest(H,BarsSinceEntry)-lowest(L,BarsSinceEntry) >= pt Then{ SetStopProfittarget(1,PointStop); SetStoploss(1,PointStop); }