HMA-Kahlman with Trend Indicator – Code Conversion Request

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #134565 quote
    MajellanMajellan
    Participant
    Average

    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.

    Source-Code-Hull-Trend-with-Kahlman.docx Hull-Trend-with-Kahlman-1.png Hull-Trend-with-Kahlman-1.png
    #134571 quote
    NicolasNicolas
    Keymaster
    Legend

    Please post all the necessary content into your post (code and picture attached), not as a Word document.

    #134579 quote
    MajellanMajellan
    Participant
    Average

    Source Code – Hull Trend with Kahlman – from TradingView

    //@version=4
    study("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/2
    wma(wma(close,p/3)*3 - wma(close,p/2) - wma(close,p),p)
    
    kahlman(x, g) =>
    kf = 0.0
    dk = x - nz(kf[1], x)
    smooth = nz(kf[1],x)+dk*sqrt((g/10000)*2)
    velo = 0.0
    velo := nz(velo[1],0) + ((g/10000)*dk)
    kf := smooth+velo
    
    a = 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.red
    crossdn = 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)
    Hull-Trend-with-Kahlman.png Hull-Trend-with-Kahlman.png
    #190168 quote
    zmokhtarizmokhtari
    Participant
    New

    Hello, i’m struggling with the conversion of this script also, have you succeded in converting it ?

    #223206 quote
    BatesonBateson
    Participant
    Junior

    Bonjour

    je suis également intéressé par la conversion de cet indicateur.

    Merci par avance

    Hello I am also interested in converting this indicator. thanks in advance

    #223383 quote
    jacquesgermainjacquesgermain
    Participant
    Veteran

    Good morning,

    there seems to be a problem downloading it for inclusion in the library…

    so here is this conversion in attached files

    Msport71 thanked this post
    hull-trend-with-Kahlman.png hull-trend-with-Kahlman.png Hull-Trend-with-Kahlman.itf
    #223437 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    @Bateson

    Only 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 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

HMA-Kahlman with Trend Indicator – Code Conversion Request


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Majellan @pbateson9 Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by robertogozzirobertogozzi
2 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/04/2020
Status: Active
Attachments: 5 files
ProRealCode ProRealCode
Loading...