커뮤니티

문의 드립니다.

프로필 이미지
신대륙발견
2023-10-24 22:02:55
960
글번호 173372
답변완료
// create base on http://www.dailyfx.com/forex_forum/coding-strategy-advisors-indicators-functions/237563-ttm-squeeze-indicator.html study("TTM Squeeze") length = input(title="Length", type=integer, defval=20, minval=0) bband(length, mult) => sma(close, length) + mult * stdev(close, length) keltner(length, mult) => ema(close, length) + mult * ema(tr, length) e1 = (highest(high, length) + lowest(low, length)) / 2 + sma(close, length) osc = linreg(close - e1 / 2, length, 0) diff = bband(length, 2) - keltner(length, 1) osc_color = osc[1] < osc[0] ? osc[0] >= 0 ? #00ffff : #cc00cc : osc[0] >= 0 ? #009b9b : #ff9bff mid_color = diff >= 0 ? green : red plot(osc, color=osc_color, style=histogram, linewidth=2) plot(0, color=mid_color, style=circles, linewidth=3) 트레이딩뷰 지표인데 예스로 좀 변환해주세요.
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-10-25 13:30:55

안녕하세요 예스스탁입니다. input : length(20),mult(0); var : e1(0),osc(0),diff(0),osc_color(0),mid_color(0); var1 = ma(close, length) + mult * std(close, length); var2 = ema(close, length) + mult * ema(TrueRange, length); e1 = (highest(high, length) + lowest(low, length)) / 2 + ma(close, length); osc = LRL(close - e1 / 2, length); diff = var1-Var2; osc_color = iff(osc[1] < osc[0] , iff(osc[0] >= 0, Red , Magenta),IFf(osc[0] >= 0, Cyan,Blue)); mid_color = iff(diff >= 0 , green , red); plot1(osc,"osc",osc_color); plot2(0,"0",mid_color); 즐거운 하루되세요 > 신대륙발견 님이 쓴 글입니다. > 제목 : 문의 드립니다. > // create base on http://www.dailyfx.com/forex_forum/coding-strategy-advisors-indicators-functions/237563-ttm-squeeze-indicator.html study("TTM Squeeze") length = input(title="Length", type=integer, defval=20, minval=0) bband(length, mult) => sma(close, length) + mult * stdev(close, length) keltner(length, mult) => ema(close, length) + mult * ema(tr, length) e1 = (highest(high, length) + lowest(low, length)) / 2 + sma(close, length) osc = linreg(close - e1 / 2, length, 0) diff = bband(length, 2) - keltner(length, 1) osc_color = osc[1] < osc[0] ? osc[0] >= 0 ? #00ffff : #cc00cc : osc[0] >= 0 ? #009b9b : #ff9bff mid_color = diff >= 0 ? green : red plot(osc, color=osc_color, style=histogram, linewidth=2) plot(0, color=mid_color, style=circles, linewidth=3) 트레이딩뷰 지표인데 예스로 좀 변환해주세요.