커뮤니티

수식문의합니다

프로필 이미지
정상에서야
2016-12-23 21:49:03
124
글번호 105264
답변완료
안녕하세요 수식문의합니다 수식1. 매매시간과 종료시간 설정 수식 시작시간 09시 종료시간 12시 (종료시 모든 포지션 시장가 청산) 수식2. 혹시 가능하시면.... 매매시간을 1차 10시 부터 13시까지 2차 14시 부터 17시까지 3차 18시 부터 23시까지 (종료시 모든 포지션 시장가 청산) 수식3. 분할청산 수식 3계약 진입 후 10틱,20틱,30틱 분할청산
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-12-26 09:11:25

안녕하세요 예스스탁입니다. 1. input : 시작시간(90000),종료시간(120000); var : Tcond(false); if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then Tcond = true; if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = true; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true then{ if 매수진입조건 Then buy(); if 매도진입조건 Then sell(); } 2 input : 시작시간1(100000),종료시간1(130000),시작시간2(140000),종료시간2(170000),시작시간3(180000),종료시간3(230000); var : Tcond(false); if stime == 시작시간1 or (stime > 시작시간1 and stime[1] < 시작시간1) Then Tcond = true; if stime == 종료시간1 or (stime > 종료시간1 and stime[1] < 종료시간1) Then{ Tcond = true; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if stime == 시작시간2 or (stime > 시작시간2 and stime[1] < 시작시간2) Then Tcond = true; if stime == 종료시간2 or (stime > 종료시간2 and stime[1] < 종료시간2) Then{ Tcond = true; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if stime == 시작시간3 or (stime > 시작시간3 and stime[1] < 시작시간3) Then Tcond = true; if stime == 종료시간3 or (stime > 종료시간3 and stime[1] < 종료시간3) Then{ Tcond = true; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true then{ if 매수진입조건 Then buy(); if 매도진입조건 Then sell(); } 3 if MarketPosition == 1 Then{ ExitLong("bp1",atlimit,EntryPrice+PriceScale*10); ExitLong("bp2",atlimit,EntryPrice+PriceScale*20); ExitLong("bp3",atlimit,EntryPrice+PriceScale*30); } if MarketPosition == -1 Then{ ExitShort("sp1",atlimit,EntryPrice-PriceScale*10); ExitShort("sp2",atlimit,EntryPrice-PriceScale*20); ExitShort("sp3",atlimit,EntryPrice-PriceScale*30); } 즐거운 하루되세요 > 정상에서야 님이 쓴 글입니다. > 제목 : 수식문의합니다 > 안녕하세요 수식문의합니다 수식1. 매매시간과 종료시간 설정 수식 시작시간 09시 종료시간 12시 (종료시 모든 포지션 시장가 청산) 수식2. 혹시 가능하시면.... 매매시간을 1차 10시 부터 13시까지 2차 14시 부터 17시까지 3차 18시 부터 23시까지 (종료시 모든 포지션 시장가 청산) 수식3. 분할청산 수식 3계약 진입 후 10틱,20틱,30틱 분할청산