커뮤니티

분할청산 및 매매 시간 설정

프로필 이미지
phoenix
2017-01-09 15:00:12
115
글번호 105709
답변완료
아래 수식에서 매매 시간을 설정하고 3계약 진입 후 분할 청산을 하고 싶습니다.. 매매 시간 : 오전 10시 15분 ~ 12시 50분 (항생 오전 시간 틱차트 매매로 12시 50분에 생성되는 봉 완성 시 일괄청산 ) 진입 수량 : 3계약 분할 청산 : 1계약 10틱, 1계약 30틱, 1계약 반대 신호 스위칭 (반대신호 스위칭 시 3계약 진입이 되어야 합니다.) 손절 : -30틱 (반대 신호 발생 전에 -30틱 도달 시 일괄 손절) 매번 성심 성의것 작성해 주셔서 감사 합니다. input : P(5); var : rr(0),tx(0); var1 = ma(C,P); if MarketPosition <= 0 and #현재 무포지션이거나 매도포지션 C[1] > O[1] and #전봉 양봉 var1[1] <= max(C[1],O[1]) and #전봉 몸통상단(종가)는 이평보다 같거나 큼 C > O Then{ #현재봉 양봉 buy(); if MarketPosition == -1 Then{ tx = Text_New(sdate,stime,H,"S:"+NumToStr((EntryPrice-C)/PriceScale,0)); Text_SetStyle(tx,1,1); } } if MarketPosition >= 0 and #현재 무포지션이거나 매수포지션 C[1] < O[1] and #전봉 음봉 var1[1] >= min(c[1],o[1]) and #전봉 몸통하단(종가)은 이평보다 같거나 작음 C < O Then{ #현재봉 음봉 sell(); if MarketPosition == 1 Then{ tx = Text_New(sdate,stime,H,"S:"+NumToStr((c-EntryPrice)/PriceScale,0)); Text_SetStyle(tx,1,1); } } if MarketPosition == 1 Then{ rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10)); if rr > rr[1] Then{ tx = Text_New(sdate,stime,H,NumToStr(RR*10,0)+"틱"); Text_SetStyle(tx,1,1); } } if MarketPosition == -1 Then{ rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10)); if rr > rr[1] Then{ tx = Text_New(sdate,stime,H,NumToStr(RR*10,0)+"틱"); Text_SetStyle(tx,1,1); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-01-11 09:47:24

안녕하세요 예스스탁입니다. input : P(5),시작시간(101500),종료시간(125000); var : rr(0),tx(0),Tcond(false); var1 = ma(C,P); if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then Tcond = true; if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true and MarketPosition <= 0 and #현재 무포지션이거나 매도포지션 C[1] > O[1] and #전봉 양봉 var1[1] <= max(C[1],O[1]) and #전봉 몸통상단(종가)는 이평보다 같거나 큼 C > O Then{ #현재봉 양봉 buy("b",OnClose,def,3); if MarketPosition == -1 Then{ tx = Text_New(sdate,stime,H,"S:"+NumToStr((EntryPrice-C)/PriceScale,0)); Text_SetStyle(tx,1,1); } } if Tcond == true and MarketPosition >= 0 and #현재 무포지션이거나 매수포지션 C[1] < O[1] and #전봉 음봉 var1[1] >= min(c[1],o[1]) and #전봉 몸통하단(종가)은 이평보다 같거나 작음 C < O Then{ #현재봉 음봉 sell("s",OnClose,def,3); if MarketPosition == 1 Then{ tx = Text_New(sdate,stime,H,"S:"+NumToStr((c-EntryPrice)/PriceScale,0)); Text_SetStyle(tx,1,1); } } if MarketPosition == 1 Then{ ExitLong("bp1",atlimit,EntryPrice+PriceScale*10,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*20,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*30,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*30,"",1,1); rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10)); if rr > rr[1] Then{ tx = Text_New(sdate,stime,H,NumToStr(RR*10,0)+"틱"); Text_SetStyle(tx,1,1); } } if MarketPosition == -1 Then{ ExitShort("sp1",atlimit,EntryPrice-PriceScale*10,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*20,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*30,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*30,"",1,1); rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10)); if rr > rr[1] Then{ tx = Text_New(sdate,stime,H,NumToStr(RR*10,0)+"틱"); Text_SetStyle(tx,1,1); } } 즐거운 하루되세요 > phoenix 님이 쓴 글입니다. > 제목 : 분할청산 및 매매 시간 설정 > 아래 수식에서 매매 시간을 설정하고 3계약 진입 후 분할 청산을 하고 싶습니다.. 매매 시간 : 오전 10시 15분 ~ 12시 50분 (항생 오전 시간 틱차트 매매로 12시 50분에 생성되는 봉 완성 시 일괄청산 ) 진입 수량 : 3계약 분할 청산 : 1계약 10틱, 1계약 30틱, 1계약 반대 신호 스위칭 (반대신호 스위칭 시 3계약 진입이 되어야 합니다.) 손절 : -30틱 (반대 신호 발생 전에 -30틱 도달 시 일괄 손절) 매번 성심 성의것 작성해 주셔서 감사 합니다. input : P(5); var : rr(0),tx(0); var1 = ma(C,P); if MarketPosition <= 0 and #현재 무포지션이거나 매도포지션 C[1] > O[1] and #전봉 양봉 var1[1] <= max(C[1],O[1]) and #전봉 몸통상단(종가)는 이평보다 같거나 큼 C > O Then{ #현재봉 양봉 buy(); if MarketPosition == -1 Then{ tx = Text_New(sdate,stime,H,"S:"+NumToStr((EntryPrice-C)/PriceScale,0)); Text_SetStyle(tx,1,1); } } if MarketPosition >= 0 and #현재 무포지션이거나 매수포지션 C[1] < O[1] and #전봉 음봉 var1[1] >= min(c[1],o[1]) and #전봉 몸통하단(종가)은 이평보다 같거나 작음 C < O Then{ #현재봉 음봉 sell(); if MarketPosition == 1 Then{ tx = Text_New(sdate,stime,H,"S:"+NumToStr((c-EntryPrice)/PriceScale,0)); Text_SetStyle(tx,1,1); } } if MarketPosition == 1 Then{ rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10)); if rr > rr[1] Then{ tx = Text_New(sdate,stime,H,NumToStr(RR*10,0)+"틱"); Text_SetStyle(tx,1,1); } } if MarketPosition == -1 Then{ rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10)); if rr > rr[1] Then{ tx = Text_New(sdate,stime,H,NumToStr(RR*10,0)+"틱"); Text_SetStyle(tx,1,1); } }