답변완료
종목 검색식 부탁드립니다.
아래 지표를 종목검색식으로 바꾸고 싶은데
일봉상
if long = longCond and CondIni[1] == -1
Then Find(1);
이렇게 하니 제대로 안나오네요 종목검색식으로 부탁드리며
추가로
1. 일봉상 최근10봉 이내 short이 발생했을시 검색제외
or
2. 최근 5봉이내 long 신호가 발생했을시 검색제외
이 두개조건을 추가하고 싶습니다.
-----------------------------------------------------------------------------
input : source(close),per1(27),mult1(1.6),per2(55),mult2(2);
var : wper1(0),avrng1(0),smrng1(0),wper2(0),avrng2(0),smrng2(0);
var : smrng(0),filt(0);
var : upward(0),downward(0);
var : hband(0),lband(0);
var : longCond(False),shortcond(False),CondIni(0);
var : long(False),short(False),tx(0);
wper1 = per1 * 2 - 1;
avrng1 = ema(abs(source - source[1]), per1);
smrng1 = ema(avrng1, wper1) * mult1;
wper2 = per2 * 2 - 1;
avrng2 = ema(abs(source - source[1]), per2);
smrng2 = ema(avrng2, wper2) * mult2;
smrng = (smrng1 + smrng2) / 2;
// Range Filter
#rngfilt(source, smrng) =>
var1 = iff(IsNaN(filt[1])==true,0,filt[1]);
filt = source;
filt = iff(source > var1,
iff(source - smrng < var1 , var1 , source - smrng),
iff(source + smrng > var1 , var1 , source + smrng));
var2 = iff(IsNaN(upward[1])==true,0,upward[1]);
upward = 0.0;
upward = iff(filt > filt[1] , Var2 + 1 ,IFf(filt < filt[1] , 0 , Var2));
var3 = iff(IsNaN(downward[1])==true,0,downward[1]);
downward = 0.0;
downward = iff(filt < filt[1] , Var3 + 1 , iff(filt > filt[1] , 0 , Var3));
hband = filt + smrng;
lband = filt - smrng;
longCond = source > filt and source > source[1] and upward > 0 or source > filt and source < source[1] and upward > 0;
shortCond = source < filt and source < source[1] and downward > 0 or source < filt and source > source[1] and downward > 0;
CondIni = IFf(longCond , 1 , IFf(shortCond , -1 , CondIni[1]));
long = longCond and CondIni[1] == -1;
short = shortCond and CondIni[1] == 1;
if long Then
{
tx = Text_New(sDate,sTime,L,"Long");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Lime);
}
if short Then
{
tx = Text_New(sDate,sTime,H,"Short");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
}
2024-08-29
765
글번호 182922
종목검색