HMA-Kahlman with Trend Indicator – Code Conversion Request
Forums › ProRealTime English forum › ProBuilder support › HMA-Kahlman with Trend Indicator – Code Conversion Request
- This topic has 6 replies, 4 voices, and was last updated 1 year ago by robertogozzi.
-
-
06/04/2020 at 2:41 PM #134565
Hello,
Could you help me with a code conversion from Pinescript to ProRealtime please? “HMA Kahlman with Trend” is a custom indicator that appears in TradingView and uses a version of the Hull Moving Average to generate buy and sell signals.
Please see attached the Pinescript code and a screen shot of the indicator applied to US30 on the H4 timeframe.
If you could help me to get this indicator working in PRT that would be much appreciated. If that can be done then stage 2 would be to create a strategy that generates buys and sell orders in accordance with the signals.
Any questions please get in touch.
Best Regards,
Majellan.
06/04/2020 at 3:41 PM #13457106/04/2020 at 4:50 PM #134579Source Code – Hull Trend with Kahlman – from TradingView
1234567891011121314151617181920212223242526272829303132333435//@version=4study("Hull Trend with Kahlman", shorttitle="HMA-Kahlman Trend", overlay=true)src = input(hl2, "Price Data")length = input(24, "Lookback")showcross = input(true, "Show cross over/under")gain = input(10000, "Gain")k = input(true, "Use Kahlman")hma(_src, _length) =>wma((2 * wma(_src, _length / 2)) - wma(_src, _length), round(sqrt(_length)))hma3(_src, _length) =>p = length/2wma(wma(close,p/3)*3 - wma(close,p/2) - wma(close,p),p)kahlman(x, g) =>kf = 0.0dk = x - nz(kf[1], x)smooth = nz(kf[1],x)+dk*sqrt((g/10000)*2)velo = 0.0velo := nz(velo[1],0) + ((g/10000)*dk)kf := smooth+veloa = k ? kahlman(hma(src, length), gain) : hma(src, length)b = k ? kahlman(hma3(src, length), gain) : hma3(src, length)c = b > a ? color.lime : color.redcrossdn = a > b and a[1] < b[1] crossup = b > a and b[1] < a[1]p1 = plot(a,color=c,linewidth=1,transp=75)p2 = plot(b,color=c,linewidth=1,transp=75)fill(p1,p2,color=c,transp=55)plotshape(showcross and crossdn ? a : na, location=location.absolute, style=shape.labeldown, color=color.red, size=size.tiny, text="S", textcolor=color.white, transp=0, offset=-1)plotshape(showcross and crossup ? a : na, location=location.absolute, style=shape.labelup, color=color.green, size=size.tiny, text="B", textcolor=color.white, transp=0, offset=-1)03/18/2022 at 11:30 PM #19016811/04/2023 at 2:51 PM #22320611/08/2023 at 6:13 PM #223383Good morning,
there seems to be a problem downloading it for inclusion in the library…
so here is this conversion in attached files
1 user thanked author for this post.
11/09/2023 at 3:47 PM #223437Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums
Thanks 🙂
-
AuthorPosts