아래 종목검색 수식에서
halftrend 가 강세 up 인 종목만 검색하려하는데,
검색 결과치를 보면 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),rsiv(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 ht == up Then
value1 = 1;
Else
value1 = 0;
Find(value1);
답변 1
예스스탁
예스스탁 답변
2022-03-28 10:22:06
안녕하세요
예스스탁입니다.
해당식에서 up,down 가격입니다.
2개가 같은 값일 경우도 있습니다.
ht = iff(trend == 0 , up , down);
위 내용에 보시면 ht에는 trend가 0일떄 up이 저장되고 0이 아니면 down이 저장됩니다.
ht가 up일 때는 trend == 0일때 이므로
if ht == up Then를 if trend == 0 Then으로 변경하시면 됩니다.
즐거운 하루되세요
> 당일선물 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> 아래 종목검색 수식에서
halftrend 가 강세 up 인 종목만 검색하려하는데,
검색 결과치를 보면 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),rsiv(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 ht == up Then
value1 = 1;
Else
value1 = 0;
Find(value1);