커뮤니티

오류 부분 수정부탁드립니다.

프로필 이미지
고박사122
2017-02-19 12:05:21
83
글번호 106988
답변완료
안녕하세요.. 다음 수식의 16 과 21번째 줄의 오류 수정 부탁드립니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (30),손절틱수 (15); input : LENGTH(17), Period(14); var : TCHAN(0), BCHAN(0), ADXv(0), HH(0), LL(0); ADXv = ADX(Period); TCHAN = HIGHEST(HIGH, LENGTH); BCHAN = LOWEST(LOW, LENGTH); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간); Else condition3 = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and C = HIGHEST(HIGH, LENGTH) and adx(Period) < 25 Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and C = LOWEST(LOW, LENGTH) and adx(Period) < 25 Then Sell(); if MarketPosition == 1 Then{ HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*HH); } if MarketPosition == -1 Then{ LL = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수)); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-02-20 16:20:43

안녕하세요 예스스탁입니다. C = HIGHEST(HIGH, LENGTH) C = LOWEST(LOW, LENGTH) 같다라는 표현은 ==입니다. C == HIGHEST(HIGH, LENGTH) C == LOWEST(LOW, LENGTH) 수정한 식입니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (30),손절틱수 (15); input : LENGTH(17), Period(14); var : TCHAN(0), BCHAN(0), ADXv(0), HH(0), LL(0); ADXv = ADX(Period); TCHAN = HIGHEST(HIGH, LENGTH); BCHAN = LOWEST(LOW, LENGTH); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간); Else condition3 = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and C == HIGHEST(HIGH, LENGTH) and adx(Period) < 25 Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and C == LOWEST(LOW, LENGTH) and adx(Period) < 25 Then Sell(); if MarketPosition == 1 Then{ HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*HH); } if MarketPosition == -1 Then{ LL = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수)); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 오류 부분 수정부탁드립니다. > 안녕하세요.. 다음 수식의 16 과 21번째 줄의 오류 수정 부탁드립니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (30),손절틱수 (15); input : LENGTH(17), Period(14); var : TCHAN(0), BCHAN(0), ADXv(0), HH(0), LL(0); ADXv = ADX(Period); TCHAN = HIGHEST(HIGH, LENGTH); BCHAN = LOWEST(LOW, LENGTH); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간); Else condition3 = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and C = HIGHEST(HIGH, LENGTH) and adx(Period) < 25 Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and C = LOWEST(LOW, LENGTH) and adx(Period) < 25 Then Sell(); if MarketPosition == 1 Then{ HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*HH); } if MarketPosition == -1 Then{ LL = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수)); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); }