커뮤니티

변환부탁드립니다.

프로필 이미지
bw
2024-09-29 21:13:02
742
글번호 183829
답변완료
트레이딩뷰의 Hull지표인데 변환부탁드립니다. src = input(close, title="Source") modeSwitch = input("Hma", title="Hull Variation", options=["Hma", "Thma", "Ehma"]) length = input(55, title="Length(180-200 for floating S/R , 55 for swing entry)") lengthMult = input(1.0, title="Length multiplier (Used to view higher timeframes with straight band)") useHtf = input(false, title="Show Hull MA from X timeframe? (good for scalping)") htf = input("240", title="Higher timeframe", type=input.resolution) //FUNCTIONS //HMA HMA(_src, _length) => wma(2 * wma(_src, _length / 2) - wma(_src, _length), round(sqrt(_length))) //EHMA EHMA(_src, _length) => ema(2 * ema(_src, _length / 2) - ema(_src, _length), round(sqrt(_length))) //THMA THMA(_src, _length) => wma(wma(_src,_length / 3) * 3 - wma(_src, _length / 2) - wma(_src, _length), _length) //SWITCH Mode(modeSwitch, src, len) => modeSwitch == "Hma" ? HMA(src, len) : modeSwitch == "Ehma" ? EHMA(src, len) : modeSwitch == "Thma" ? THMA(src, len/2) : na //OUT _hull = Mode(modeSwitch, src, int(length * lengthMult)) HULL = useHtf ? security(syminfo.ticker, htf, _hull) : _hull MHULL = HULL[0] SHULL = HULL[2] plot(MHULL, title="MHULL", color=hullColor, linewidth=thicknesSwitch, transp=50) plot(visualSwitch ? SHULL : na, title="SHULL", color=hullColor, linewidth=thicknesSwitch, transp=50) 수고하세요
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-09-30 13:26:20

안녕하세요 예스스탁입니다. security(syminfo.ticker, htf, _hull) 위 내용은 변환해 드리기 어렵습니다. 기본차트 종목기준으로만 표시되게 작성해 드립니다. input : modeSwitch("Hma"); #"Hma", "THma", "EHma" input : length(55); input : lengthMult(1.0); input : htf("240"); var : src(0),value(0); src = close; //FUNCTIONS if modeSwitch == "Hma" Then value = wma(2 * wma(src, length / 2) - wma(src,length), round(sqrt(length),0)); if modeSwitch == "THma" Then value = ema(2 * ema(src, length / 2) - ema(src, length), round(sqrt(length),0)); if modeSwitch == "EHma" Then value = wma(wma(src,length / 3) * 3 - wma(src, length / 2) - wma(src, length), length); plot1(value, "MHULL"); plot2(value[2],"SHLL"); 즐거운 하루되세요 > bw 님이 쓴 글입니다. > 제목 : 변환부탁드립니다. > 트레이딩뷰의 Hull지표인데 변환부탁드립니다. src = input(close, title="Source") modeSwitch = input("Hma", title="Hull Variation", options=["Hma", "Thma", "Ehma"]) length = input(55, title="Length(180-200 for floating S/R , 55 for swing entry)") lengthMult = input(1.0, title="Length multiplier (Used to view higher timeframes with straight band)") useHtf = input(false, title="Show Hull MA from X timeframe? (good for scalping)") htf = input("240", title="Higher timeframe", type=input.resolution) //FUNCTIONS //HMA HMA(_src, _length) => wma(2 * wma(_src, _length / 2) - wma(_src, _length), round(sqrt(_length))) //EHMA EHMA(_src, _length) => ema(2 * ema(_src, _length / 2) - ema(_src, _length), round(sqrt(_length))) //THMA THMA(_src, _length) => wma(wma(_src,_length / 3) * 3 - wma(_src, _length / 2) - wma(_src, _length), _length) //SWITCH Mode(modeSwitch, src, len) => modeSwitch == "Hma" ? HMA(src, len) : modeSwitch == "Ehma" ? EHMA(src, len) : modeSwitch == "Thma" ? THMA(src, len/2) : na //OUT _hull = Mode(modeSwitch, src, int(length * lengthMult)) HULL = useHtf ? security(syminfo.ticker, htf, _hull) : _hull MHULL = HULL[0] SHULL = HULL[2] plot(MHULL, title="MHULL", color=hullColor, linewidth=thicknesSwitch, transp=50) plot(visualSwitch ? SHULL : na, title="SHULL", color=hullColor, linewidth=thicknesSwitch, transp=50) 수고하세요