커뮤니티

76518 종목검색식 질문에 대한 답변대로 하였는데에도 오류가 납니다.

프로필 이미지
당일선물
2022-05-23 07:03:10
1105
글번호 159121
답변완료
76501 76518 문의글에 대하여 답변주신대로 해보았는데도 종목검색 결과를 보면 아예 한종목도 검색이 안나오는가 하면 종목이 검색되어놔와도 ht가 약세(down)인 종목도 검색되는 오류가 있습니다. 지표식을 챠트에 출력하면 지표는 정상인데 종목검색에서는 조건에 부합하지 않는 종목까지도 검색되어 나옵니다. 종목검색식을 다시 한번 부탁드립니다. 지표수식 ============== input : amplitude(20); var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0); var : up(0),down(0); var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0); highPrice = Highest(H,amplitude); lowPrice = Lowest(L,amplitude); highma = ma(high, amplitude); lowma = ma(low, amplitude); if nextTrend == 1 Then { maxLowPrice = max(lowPrice, maxLowPrice); if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then { trend = 1; nextTrend = 0; minHighPrice = highPrice; } } else { minHighPrice = min(highPrice, minHighPrice); if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then { trend = 0; nextTrend = 1; maxLowPrice = lowPrice; } } if trend == 0 Then { if IsNaN(trend[1]) == False and trend[1] != 0 Then { up = iff(IsNaN(down[1]) == true,down,down[1]); } else { up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1])); } } else { if isnan(trend[1]) == False and trend[1] != 1 Then { down = iff(IsNan(up[1]) == true, up , up[1]); } else { down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1])); } } ht = iff(trend == 0 , up , down); plot1(ht, "HalfTrend",iff(trend == 0 ,red,blue)); =========================================== 희망하는 종목검색식 1-1. 현재가 C 가 ht 선을 돌파하는 종목을 검색 1-2. 현재가 C 가 ht 선위에 있는 종목을 검색 2-1. 현재가 C 가 25개봉 이전 ht[25] 선을 돌파하는 종목을 검색 2-2. 현재가 C 가 25개봉 이전 ht[25] 선위에 있는 종목을 검색 수고스럽더라도 수식작성 후 검색을 한번 돌려본후 결과를 검증해보아주시기 바랍니다.
종목검색
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-05-23 11:50:14

안녕하세요 예스스탁입니다. 해당지표가 차트의 과거 봉수에 따라 조건만족여부가 달라져 값이 다릅니다. 일정봉수 이상 되면 값이 같게 됩니다. 차트에 50봉,100봉등 조회상태에서 지표의 마지막봉 값을 확인하시기 바랍니다. 종목검색은 속성에서 검색에 필요한 최소기간에 봉수를 설정하지 않으면 최소봉으로 계산해 검색을 하게 됩니다. 종목검색은 최대 500봉까지 제공됩니다. 종목검색 속성에서 검색에 필요한 최소시간에 500봉 지정하시고 차트도 500봉 조회해서 비교해 보시기 바랍니다. 1-1. 현재가 C 가 ht 선을 돌파하는 종목을 검색 1-2. 현재가 C 가 ht 선위에 있는 종목을 검색 2-1. 현재가 C 가 25개봉 이전 ht[25] 선을 돌파하는 종목을 검색 2-2. 현재가 C 가 25개봉 이전 ht[25] 선위에 있는 종목을 검색 올리신 내용에 약세 강세를 판단할 내용은 없습니다. 해당선이 빨간색일 때를 조건으로 추가하고자 하시면 아래식의 종목검색조건을 지정하는 if문에 trend == 0을 지정하시면 됩니다. 1 input : amplitude(20); var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0); var : up(0),down(0); var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0); highPrice = Highest(H,amplitude); lowPrice = Lowest(L,amplitude); highma = ma(high, amplitude); lowma = ma(low, amplitude); if nextTrend == 1 Then { maxLowPrice = max(lowPrice, maxLowPrice); if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then { trend = 1; nextTrend = 0; minHighPrice = highPrice; } } else { minHighPrice = min(highPrice, minHighPrice); if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then { trend = 0; nextTrend = 1; maxLowPrice = lowPrice; } } if trend == 0 Then { if IsNaN(trend[1]) == False and trend[1] != 0 Then { up = iff(IsNaN(down[1]) == true,down,down[1]); } else { up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1])); } } else { if isnan(trend[1]) == False and trend[1] != 1 Then { down = iff(IsNan(up[1]) == true, up , up[1]); } else { down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1])); } } ht = iff(trend == 0 , up , down); if CrossUp(c,ht) Then Find(1); 2 input : amplitude(20); var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0); var : up(0),down(0); var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0); highPrice = Highest(H,amplitude); lowPrice = Lowest(L,amplitude); highma = ma(high, amplitude); lowma = ma(low, amplitude); if nextTrend == 1 Then { maxLowPrice = max(lowPrice, maxLowPrice); if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then { trend = 1; nextTrend = 0; minHighPrice = highPrice; } } else { minHighPrice = min(highPrice, minHighPrice); if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then { trend = 0; nextTrend = 1; maxLowPrice = lowPrice; } } if trend == 0 Then { if IsNaN(trend[1]) == False and trend[1] != 0 Then { up = iff(IsNaN(down[1]) == true,down,down[1]); } else { up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1])); } } else { if isnan(trend[1]) == False and trend[1] != 1 Then { down = iff(IsNan(up[1]) == true, up , up[1]); } else { down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1])); } } ht = iff(trend == 0 , up , down); if c > ht Then Find(1); 3 input : amplitude(20); var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0); var : up(0),down(0); var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0); highPrice = Highest(H,amplitude); lowPrice = Lowest(L,amplitude); highma = ma(high, amplitude); lowma = ma(low, amplitude); if nextTrend == 1 Then { maxLowPrice = max(lowPrice, maxLowPrice); if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then { trend = 1; nextTrend = 0; minHighPrice = highPrice; } } else { minHighPrice = min(highPrice, minHighPrice); if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then { trend = 0; nextTrend = 1; maxLowPrice = lowPrice; } } if trend == 0 Then { if IsNaN(trend[1]) == False and trend[1] != 0 Then { up = iff(IsNaN(down[1]) == true,down,down[1]); } else { up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1])); } } else { if isnan(trend[1]) == False and trend[1] != 1 Then { down = iff(IsNan(up[1]) == true, up , up[1]); } else { down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1])); } } ht = iff(trend == 0 , up , down); if crossup(c,ht[25]) Then Find(1); 4 input : amplitude(20); var : trend(0),nextTrend(0),maxLowPrice(0),minHighPrice(0); var : up(0),down(0); var : highPrice(0),lowPrice(0),highma(0),lowma(0),ht(0); highPrice = Highest(H,amplitude); lowPrice = Lowest(L,amplitude); highma = ma(high, amplitude); lowma = ma(low, amplitude); if nextTrend == 1 Then { maxLowPrice = max(lowPrice, maxLowPrice); if highma < maxLowPrice and close < iff(isnan(low[1])==true,low,Low[1]) Then { trend = 1; nextTrend = 0; minHighPrice = highPrice; } } else { minHighPrice = min(highPrice, minHighPrice); if lowma > minHighPrice and close > iff(isnan(high[1])==true,high,high[1]) Then { trend = 0; nextTrend = 1; maxLowPrice = lowPrice; } } if trend == 0 Then { if IsNaN(trend[1]) == False and trend[1] != 0 Then { up = iff(IsNaN(down[1]) == true,down,down[1]); } else { up = iff(IsNan(up[1]) == true, maxLowPrice , max(maxLowPrice, up[1])); } } else { if isnan(trend[1]) == False and trend[1] != 1 Then { down = iff(IsNan(up[1]) == true, up , up[1]); } else { down = iff(IsNan(down[1]) == true, minHighPrice ,min(minHighPrice, down[1])); } } ht = iff(trend == 0 , up , down); if c > ht[25] Then Find(1); 즐거운 하루되세요