커뮤니티

질문드립니다

프로필 이미지
toal
2017-05-02 10:49:52
127
글번호 109317
답변완료
아래 답변해 주신부분에서 몇가지 기능을 추가하려고 합니다 1. 지금은 21시에 손절틱수만 변경되게 되어 있지만 거기에 기준가격을 EntryPrice값이 아니라 어떤 특정시간의 시가로 할수 있을까요? 특정시간은 변수로 빼서 조절하게끔하고요 2. 손절틱수가 21시에 변경되었을때 변경된 틱수최종값을 챠트상으로 출력할수있을까요? 3. 손절틱수1의 값도 최초 진입했을 때 출력할수있을까요? input : 손절틱수1(12),손절틱수2(7),당일청산시간(030000),손절변경시간(210000); var : Tcond(false),LossCut(0); #영업일 변경되면 진입가능하게 Tcond는 true if Bdate != Bdate[1] Then{ Tcond = true; LossCut = PriceScale*손절틱수1; } #19시가 되면 더이상 진입못하게 Tcond는 false로 만들고 #보유 포지션있으면 청산 if stime == 당일청산시간 or (stime > 당일청산시간 and stime[1] < 당일청산시간) Then{ Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if stime == 손절변경시간 or (stime > 손절변경시간 and stime[1] < 손절변경시간) Then LossCut = PriceScale*손절틱수2; #Tcond가 true일때만 진입 if Tcond == true then{ if 매수진입조건 Then buy(); if 매도진입조건 Then sell(); } if MarketPosition == 1 Then{ exitlong("bx1",AtStop,EntryPrice-LossCut); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,EntryPrice+LossCut); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-05-08 16:02:01

안녕하세요 예스스탁입니다. input : 손절틱수1(12),손절틱수2(7),당일청산시간(030000),손절변경시간(210000),특정시간(200000); var : Tcond(false),LossCut(0); #영업일 변경되면 진입가능하게 Tcond는 true if Bdate != Bdate[1] Then{ Tcond = true; LossCut = PriceScale*손절틱수1; } if stime == 특정시간 or (stime > 특정시간 and stime[1] < 특정시간) Then{ var1 = O; } #19시가 되면 더이상 진입못하게 Tcond는 false로 만들고 #보유 포지션있으면 청산 if stime == 당일청산시간 or (stime > 당일청산시간 and stime[1] < 당일청산시간) Then{ Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if stime == 손절변경시간 or (stime > 손절변경시간 and stime[1] < 손절변경시간) Then{ LossCut = PriceScale*손절틱수2; text_new(sdate,stime,h,NumToStr(losscut,2)); } #Tcond가 true일때만 진입 if Tcond == true then{ if MarketPosition <= 0 and 매수진입조건 Then{ buy(); text_new(sdate,stime,h,NumToStr(losscut,2)); } if MarketPosition >= 0 and 매도진입조건 Then{ sell(); text_new(sdate,stime,h,NumToStr(losscut,2)); } } if MarketPosition == 1 Then{ exitlong("bx1",AtStop,var1-LossCut); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,var1+LossCut); } 즐거운 하루되세요 > toal 님이 쓴 글입니다. > 제목 : 질문드립니다 > 아래 답변해 주신부분에서 몇가지 기능을 추가하려고 합니다 1. 지금은 21시에 손절틱수만 변경되게 되어 있지만 거기에 기준가격을 EntryPrice값이 아니라 어떤 특정시간의 시가로 할수 있을까요? 특정시간은 변수로 빼서 조절하게끔하고요 2. 손절틱수가 21시에 변경되었을때 변경된 틱수최종값을 챠트상으로 출력할수있을까요? 3. 손절틱수1의 값도 최초 진입했을 때 출력할수있을까요? input : 손절틱수1(12),손절틱수2(7),당일청산시간(030000),손절변경시간(210000); var : Tcond(false),LossCut(0); #영업일 변경되면 진입가능하게 Tcond는 true if Bdate != Bdate[1] Then{ Tcond = true; LossCut = PriceScale*손절틱수1; } #19시가 되면 더이상 진입못하게 Tcond는 false로 만들고 #보유 포지션있으면 청산 if stime == 당일청산시간 or (stime > 당일청산시간 and stime[1] < 당일청산시간) Then{ Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if stime == 손절변경시간 or (stime > 손절변경시간 and stime[1] < 손절변경시간) Then LossCut = PriceScale*손절틱수2; #Tcond가 true일때만 진입 if Tcond == true then{ if 매수진입조건 Then buy(); if 매도진입조건 Then sell(); } if MarketPosition == 1 Then{ exitlong("bx1",AtStop,EntryPrice-LossCut); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,EntryPrice+LossCut); }