커뮤니티

시스템문의드립니다

프로필 이미지
겐지
2017-02-09 13:04:38
132
글번호 106692
답변완료
input : P5(5), P20(20), P60(60), get(25), cut(25); var : mav2(0,data2), mav19(0,data2), mav20(0,data2), mav60(0,data2), tic20(0), tic60(0), tic5(0); mav2 = data2(c); mav19 = data2(c[19]); mav20 = data2(c[20]); mav60 = data2(c[60]); tic20=ma(c,P20); tic60=ma(c,P60); tic5=ma(c,P5); if stime >= 170000 or stime < 030000 Then{ if c>mav20 and c>mav19 then{ if crossup(tic5,tic20) or crossup(tic5,tic60) then{ if MarketPosition == 0 Then buy("매수"); if MarketPosition == -1 Then buy("리버스매수"); } } if c<mav20 and c<mav19 then{ if CrossDown(tic5,tic20) or crossdown(tic5,tic60) then{ if MarketPosition == 0 Then sell("매도"); if MarketPosition == 1 Then sell("리버스매도"); } } } if stime >= 220000 or stime < 030000 Then{ if c<mav20 and c<mav19 then exitlong("불매수청산"); if c>mav20 and c>mav19 Then ExitShort("불매도청산"); } SetStopProfittarget(PriceScale*get,PointStop); SetStopLoss(PriceScale*cut,PointStop); if stime == 030000 or (stime > 030000 and stime[1] < 030000) Then{ exitlong(); ExitShort(); } 1.혼자서 머리싸매고 해도 답을 찾기가 어렵습니다ㅜ 위에식에서 청산식적용할때요~ 밤10시~새벽3시사이에만 따로 청산조건을 설정해 놨는데 이전에 포지션이 있는 경우는 밤10시에 그냥 청산이 되 버리거든요 밤10시이전에 포지션이 있는 경우는 이전청산조건을 그대로 유지하고 밤10시이후에 나오는 새로생성된 진입신호에만 새로운 청산기준을 적용하고 싶습니다. 2.항생에는 진입청산조건은 같이두고 시간을 10시30분~오후4시까지 매매시간을 설정하고 위에따로정해놓은청산기준을10시30분~12시까지로 설정했거든요 그런데 이번에도 진입신호가 누락되면서 시간설정이 제대로 안먹히고 24시간으로 진행됩니다. 아래에 적어놨는데 항생시간설정을 어떻게 해야될지 모르겠습니다 input : P5(5), P20(20), P60(60), get(25), cut(25); var : mav2(0,data2), mav19(0,data2), mav20(0,data2), mav60(0,data2), tic20(0), tic60(0), tic5(0); mav2 = data2(c); mav19 = data2(c[19]); mav20 = data2(c[20]); mav60 = data2(c[60]); tic20=ma(c,P20); tic60=ma(c,P60); tic5=ma(c,P5); if stime >= 103000 or stime < 160000 Then{ if c>mav20 and c>mav19 then{ if crossup(tic5,tic20) or crossup(tic5,tic60) then{ if MarketPosition == 0 Then buy("매수"); if MarketPosition == -1 Then buy("리버스매수"); } } if c<mav20 and c<mav19 then{ if CrossDown(tic5,tic20) or crossdown(tic5,tic60) then{ if MarketPosition == 0 Then sell("매도"); if MarketPosition == 1 Then sell("리버스매도"); } } } if stime >= 103000 or stime < 120000 Then{ if c<mav20 and c<mav19 then exitlong("불매수청산"); if c>mav20 and c>mav19 Then ExitShort("불매도청산"); } SetStopProfittarget(PriceScale*get,PointStop); SetStopLoss(PriceScale*cut,PointStop); if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong(); ExitShort(); } 오늘도 좋은하루보내시구요!
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-02-10 15:33:35

안녕하세요 예스스탁입니다. 시작시간이 끝시간보다 작으면 조건문을 and로 연결 시작시간이 끝시간보다 크면 조건문을 or로 연결해야 합니다. 시간의 조건연결은 상황에 따라 and나 or로 구성하셔야 합니다. 1 input : P5(5), P20(20), P60(60), get(25), cut(25); var : mav2(0,data2), mav19(0,data2), mav20(0,data2), mav60(0,data2), tic20(0), tic60(0), tic5(0); mav2 = data2(c); mav19 = data2(c[19]); mav20 = data2(c[20]); mav60 = data2(c[60]); tic20=ma(c,P20); tic60=ma(c,P60); tic5=ma(c,P5); if stime >= 170000 or stime < 030000 Then{ if c>mav20 and c>mav19 then{ if crossup(tic5,tic20) or crossup(tic5,tic60) then{ if MarketPosition == 0 Then buy("매수"); if MarketPosition == -1 Then buy("리버스매수"); } } if c<mav20 and c<mav19 then{ if CrossDown(tic5,tic20) or crossdown(tic5,tic60) then{ if MarketPosition == 0 Then sell("매도"); if MarketPosition == 1 Then sell("리버스매도"); } } } if (stime >= 220000 or stime < 030000) or (EntryTime >= 220000 or EntryTime < 030000) Then{ if c<mav20 and c<mav19 then exitlong("불매수청산"); if c>mav20 and c>mav19 Then ExitShort("불매도청산"); } SetStopProfittarget(PriceScale*get,PointStop); SetStopLoss(PriceScale*cut,PointStop); if stime == 030000 or (stime > 030000 and stime[1] < 030000) Then{ exitlong(); ExitShort(); } 2 input : P5(5), P20(20), P60(60), get(25), cut(25); var : mav2(0,data2), mav19(0,data2), mav20(0,data2), mav60(0,data2), tic20(0), tic60(0), tic5(0); mav2 = data2(c); mav19 = data2(c[19]); mav20 = data2(c[20]); mav60 = data2(c[60]); tic20=ma(c,P20); tic60=ma(c,P60); tic5=ma(c,P5); if stime >= 103000 and stime < 160000 Then{ if c>mav20 and c>mav19 then{ if crossup(tic5,tic20) or crossup(tic5,tic60) then{ if MarketPosition == 0 Then buy("매수"); if MarketPosition == -1 Then buy("리버스매수"); } } if c<mav20 and c<mav19 then{ if CrossDown(tic5,tic20) or crossdown(tic5,tic60) then{ if MarketPosition == 0 Then sell("매도"); if MarketPosition == 1 Then sell("리버스매도"); } } } if stime >= 103000 and stime < 120000 Then{ if c<mav20 and c<mav19 then exitlong("불매수청산"); if c>mav20 and c>mav19 Then ExitShort("불매도청산"); } SetStopProfittarget(PriceScale*get,PointStop); SetStopLoss(PriceScale*cut,PointStop); if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong(); ExitShort(); } 즐거운 하루되세요 > 겐지 님이 쓴 글입니다. > 제목 : 시스템문의드립니다 > input : P5(5), P20(20), P60(60), get(25), cut(25); var : mav2(0,data2), mav19(0,data2), mav20(0,data2), mav60(0,data2), tic20(0), tic60(0), tic5(0); mav2 = data2(c); mav19 = data2(c[19]); mav20 = data2(c[20]); mav60 = data2(c[60]); tic20=ma(c,P20); tic60=ma(c,P60); tic5=ma(c,P5); if stime >= 170000 or stime < 030000 Then{ if c>mav20 and c>mav19 then{ if crossup(tic5,tic20) or crossup(tic5,tic60) then{ if MarketPosition == 0 Then buy("매수"); if MarketPosition == -1 Then buy("리버스매수"); } } if c<mav20 and c<mav19 then{ if CrossDown(tic5,tic20) or crossdown(tic5,tic60) then{ if MarketPosition == 0 Then sell("매도"); if MarketPosition == 1 Then sell("리버스매도"); } } } if stime >= 220000 or stime < 030000 Then{ if c<mav20 and c<mav19 then exitlong("불매수청산"); if c>mav20 and c>mav19 Then ExitShort("불매도청산"); } SetStopProfittarget(PriceScale*get,PointStop); SetStopLoss(PriceScale*cut,PointStop); if stime == 030000 or (stime > 030000 and stime[1] < 030000) Then{ exitlong(); ExitShort(); } 1.혼자서 머리싸매고 해도 답을 찾기가 어렵습니다ㅜ 위에식에서 청산식적용할때요~ 밤10시~새벽3시사이에만 따로 청산조건을 설정해 놨는데 이전에 포지션이 있는 경우는 밤10시에 그냥 청산이 되 버리거든요 밤10시이전에 포지션이 있는 경우는 이전청산조건을 그대로 유지하고 밤10시이후에 나오는 새로생성된 진입신호에만 새로운 청산기준을 적용하고 싶습니다. 2.항생에는 진입청산조건은 같이두고 시간을 10시30분~오후4시까지 매매시간을 설정하고 위에따로정해놓은청산기준을10시30분~12시까지로 설정했거든요 그런데 이번에도 진입신호가 누락되면서 시간설정이 제대로 안먹히고 24시간으로 진행됩니다. 아래에 적어놨는데 항생시간설정을 어떻게 해야될지 모르겠습니다 input : P5(5), P20(20), P60(60), get(25), cut(25); var : mav2(0,data2), mav19(0,data2), mav20(0,data2), mav60(0,data2), tic20(0), tic60(0), tic5(0); mav2 = data2(c); mav19 = data2(c[19]); mav20 = data2(c[20]); mav60 = data2(c[60]); tic20=ma(c,P20); tic60=ma(c,P60); tic5=ma(c,P5); if stime >= 103000 or stime < 160000 Then{ if c>mav20 and c>mav19 then{ if crossup(tic5,tic20) or crossup(tic5,tic60) then{ if MarketPosition == 0 Then buy("매수"); if MarketPosition == -1 Then buy("리버스매수"); } } if c<mav20 and c<mav19 then{ if CrossDown(tic5,tic20) or crossdown(tic5,tic60) then{ if MarketPosition == 0 Then sell("매도"); if MarketPosition == 1 Then sell("리버스매도"); } } } if stime >= 103000 or stime < 120000 Then{ if c<mav20 and c<mav19 then exitlong("불매수청산"); if c>mav20 and c>mav19 Then ExitShort("불매도청산"); } SetStopProfittarget(PriceScale*get,PointStop); SetStopLoss(PriceScale*cut,PointStop); if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong(); ExitShort(); } 오늘도 좋은하루보내시구요!