예스스탁
예스스탁 답변
2024-08-23 13:22:18
안녕하세요
예스스탁입니다.
input : source(close);
input : per1(27);
input : mult1(1.6);
input : per2(55);
input : mult2(2);
var : wper1(0),avrng1(0),smrng1(0);
var : 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
{
PlotPaintBar(H,L,"강조",Magenta);
}
if short Then
{
PlotPaintBar(H,L,"강조",Cyan);
}
즐거운 하루되세요
> 비듬싸순 님이 쓴 글입니다.
> 제목 : 수고하십니다
>
항상 저희를 위해 수고해주시는데 감사하며
아래식을 캔들에 색을입혀 구분하게 강조로 부탁드립니다
input : source(close);
input : per1(27);
input : mult1(1.6);
input : per2(55);
input : mult2(2);
var : wper1(0),avrng1(0),smrng1(0);
var : 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,"매수");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Lime);
Text_setsize(tx,20);
}
if short Then
{
tx = Text_New(sDate,sTime,H,"매도");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Black);
Text_setsize(tx,20);
}