커뮤니티

수식부탁드립니다.

프로필 이미지
디얼디어
2020-03-31 00:24:20
499
글번호 137362
답변완료
매매시간 7시시작~23시까지 파라볼릭 매수나 매도면 1계약 진입 익절 20틱오면청산 그날 진입안함 평단가에서 손실 20틱이면 같은 포지션 1계약 더 진입 평단가에서 익절20틱 손실40틱이면 1계약 진입 총 3계약이상 안들어감 평단가에서 익절 20틱 손실60틱이면 손실청산 당일 진입안함 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-03-31 11:43:35

안녕하세요 예스스탁입니다. 추가진입을 하므로 설정창에서 피라미딩을 다른진입신호만 허용으로 설정하고 적용하시면 됩니다. Input : af(0.02), maxAF(0.2); input : StartTime(70000),EndTime(230000); Var : value(0),Tcond(false),entry(0); if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry = entry+1; value = sar(af,maxAF); if tcond == true then { If MarketPosition <= 0 and crossup(c,value) and entry < 1 Then { Buy("b1"); } If MarketPosition >= 0 and CrossDown(c,value) and entry < 1 Then { Sell("s1"); } if MarketPosition == 1 then { ExitLong("bp",Atlimit,AvgEntryPrice+PriceScale*20); if MaxEntries == 1 Then Buy("b2",AtStop,AvgEntryPrice-PriceScale*20); if MaxEntries == 2 Then Buy("b3",AtStop,AvgEntryPrice-PriceScale*40); if MaxEntries == 3 Then ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*60); } if MarketPosition == -1 then { ExitShort("sp",Atlimit,AvgEntryPrice-PriceScale*20); if MaxEntries == 1 Then sell("s2",AtStop,AvgEntryPrice+PriceScale*20); if MaxEntries == 2 Then sell("s3",AtStop,AvgEntryPrice+PriceScale*40); if MaxEntries == 3 Then ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*60); } } 즐거운 하루되세요 > 디얼디어 님이 쓴 글입니다. > 제목 : 수식부탁드립니다. > 매매시간 7시시작~23시까지 파라볼릭 매수나 매도면 1계약 진입 익절 20틱오면청산 그날 진입안함 평단가에서 손실 20틱이면 같은 포지션 1계약 더 진입 평단가에서 익절20틱 손실40틱이면 1계약 진입 총 3계약이상 안들어감 평단가에서 익절 20틱 손실60틱이면 손실청산 당일 진입안함 부탁드립니다.