예스스탁
예스스탁 답변
2020-04-22 10:33:56
안녕하세요
예스스탁입니다.
input : sensitivity(10),fastLength(20),slowLength(40),channelLength(20),mult(2.0);
var : Trend_ZONE(0),macdv(0),t1(0),t2(0),e1(0),trendUp(0),trendDown(0);
Trend_ZONE = (TrueRange+ (100 - 1) * Trend_ZONE) / 100;
macdv = macd(fastLength, slowLength);
t1 = (macdv - macdv[1])*sensitivity;
t2 = (macdv[2] -macdv[3])*sensitivity;
e1 = (BollBandUp(channelLength, mult) - BollBandDown(channelLength, mult));
trendUp = iff(t1 >= 0, t1 , 0);
trendDown = iff(t1 < 0,(-1*t1), 0);
plot1(trendUp, "UB",iff(trendUp<trendUp[1],CYAN,green));
plot2(trendDown,"LB",iff(trendDown<trendDown[1],MAGENTA,red));
plot3(e1,"trendLine",GREEN);
plot4(Trend_ZONE,"TrendZoneLine",blue);
즐거운 하루되세요
> thegin 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> sensitivity = input(10, title="Sensitivity")
fastLength=input(20, title="FastEMA Length")
slowLength=input(40, title="SlowEMA Length")
channelLength=input(20, title="BB Channel Length")
mult=input(2.0, title="BB Stdev Multiplier")
Trend_ZONE = nz(rma(tr(true),100)) * 3.7
calc_macd(source, fastLength, slowLength) =>
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
fastMA - slowMA
calc_BBUpper(source, length, mult) =>
basis = sma(source, length)
dev = mult * stdev(source, length)
basis + dev
calc_BBLower(source, length, mult) =>
basis = sma(source, length)
dev = mult * stdev(source, length)
basis - dev
t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1], fastLength, slowLength))*sensitivity
t2 = (calc_macd(close[2], fastLength, slowLength) - calc_macd(close[3], fastLength, slowLength))*sensitivity
e1 = (calc_BBUpper(close, channelLength, mult) - calc_BBLower(close, channelLength, mult))
trendUp = (t1 >= 0) ? t1 : 0
trendDown = (t1 < 0) ? (-1*t1) : 0
plot(trendUp, style=columns, linewidth=1, color=(trendUp<trendUp[1])?lime:green, transp=45, title="UB")
plot(trendDown, style=columns, linewidth=1, color=(trendDown<trendDown[1])?orange:red, transp=45, title="LB")
plot(e1, style=line, linewidth=2, color=#A0522D, title="trendLine")
plot(Trend_ZONE, color=blue, linewidth=1, style=cross, title="TrendZoneLine")
변환 문의드립니다. 감사합니다.