커뮤니티

안녕하세요

프로필 이미지
로즈버드
2024-07-30 23:38:09
1154
글번호 182053
답변완료
무더운 날씨에 노고가 많으십니다 혹시 예스랭귀지로 변환이 가능할지하여 문의드립니다. 항상 도움주셔서 감사드립니다 좋은 하루되세요! study("SHK") sensitivity = input(150, 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") DEAD_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 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="UpTrend") plot(trendDown, style=columns, linewidth=1, color=(trendDown<trendDown[1])?orange:red, transp=45, title="DownTrend") plot(e1, style=line, linewidth=2, color=#A0522D, title="ExplosionLine") plot(DEAD_ZONE, color=blue, linewidth=1, style=cross, title="DeadZoneLine")
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-07-31 11:41:31

안녕하세요 예스스탁입니다. input : sensitivity(150); input : fastLength(20); input : slowLength(40); input : channelLength(20); input : mult(2.0); var : alpha(0),Rma(0),DEAD_ZONE(0),calc_macd(0),calc_BBUpper(0),calc_BBLower(0); var : t1(0),e1(0),trendUp(0),trendDown(0); alpha = 1/100; RMA = iff(IsNan(RMA[1]) == true , ma(TrueRange, 100) , alpha * TrueRange + (1 - alpha) * RMA[1]); DEAD_ZONE = IFf(IsNaN(RMA) == true, 0, RMA) * 3.7; calc_macd = macd(fastLength,slowLength); calc_BBUpper = BollBandUp(channelLength,mult); calc_BBLower = BollBandDown(channelLength,mult); t1 = (calc_macd - calc_macd[1])*sensitivity; e1 = (calc_BBUpper - calc_BBLower); trendUp = IFf(t1 >= 0 , t1 , 0); trendDown = IFf(t1 < 0 , (-1*t1) , 0); plot1(trendUp,"UpTrend",IFf(trendUp<trendUp[1],lime,green)); plot2(trendDown,"DownTrend",IFf(trendDown<trendDown[1],orange,red)); plot3(e1,"ExplosionLine"); plot4(DEAD_ZONE,"DeadZoneLine",blue); 즐거운 하루되세요 > 로즈버드 님이 쓴 글입니다. > 제목 : 안녕하세요 > 무더운 날씨에 노고가 많으십니다 혹시 예스랭귀지로 변환이 가능할지하여 문의드립니다. 항상 도움주셔서 감사드립니다 좋은 하루되세요! study("SHK") sensitivity = input(150, 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") DEAD_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 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="UpTrend") plot(trendDown, style=columns, linewidth=1, color=(trendDown<trendDown[1])?orange:red, transp=45, title="DownTrend") plot(e1, style=line, linewidth=2, color=#A0522D, title="ExplosionLine") plot(DEAD_ZONE, color=blue, linewidth=1, style=cross, title="DeadZoneLine")