Hull Trend with Kahlman

Hull Trend with Kahlman

Indicator designed to implement a trading indicator combining a Hull Moving Average (HMA) with a Kahlman filter, used to identify trends and potential buy/sell signals in a financial market. Let’s break it down into simpler terms:

Overview

  • Purpose: The script creates a custom trend-following indicator.
  • Key Components: It uses a Hull Moving Average (HMA), a variation of the moving average designed to reduce lag and improve smoothness, and a Kalman filter, which is used to estimate the state of a system from noisy data.

How it Works

  1. Setting Up Variables:
    • length, showcross, gain, k, nonrepainting are variables that can be adjusted to modify how the indicator behaves.
    • src represents the source data, typically the closing price of a trading instrument.
  2. Calculating the Hull Moving Average (HMA):
    • The script calculates the HMA and a modified version, referred to as hma3, based on the closing price (close). These calculations use weighted averages over different periods to reduce lag and increase responsiveness.
  3. Kalman Filter Implementation:
    • The script initializes variables for the Kalman filter: Pred, Velo, Smooth.
    • The Kalman filter is applied in a loop, modifying the values of these variables to estimate the “true” state of the market price (kf) from the noisy input data (src).
  4. Applying the Filter to the HMA:
    • The script calculates two versions of the indicator: one using the raw closing price (a and b without Kalman filter) and another using the Kalman-filtered price (a and b with Kalman filter).
  5. Cross Signals:
    • If showcross is true, the script looks for crossover points between a and b — these are points where the two lines cross each other.
    • When a crosses over b, it’s marked as a “sell” signal (S), and when a crosses under b, it’s marked as a “buy” signal (B).
    • The script can optionally mark these signals on the chart using text and points, with an additional option for “non-repainting” mode, which affects how and where these signals are displayed.
  6. Drawing on the Chart:
    • The script uses drawing functions (DRAWTEXT, DRAWPOINT) to visually represent buy and sell signals on the chart for easier interpretation.

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Violet • 162 days ago #

    There’s a typo in the title. It is not Kahlman but the Kalman filter. Drop the letter h in the name.

  2. Bateson • 162 days ago #

    Merci Jacques d’avoir répondu à une demande du forum 🙂

  3. larouedegann • 147 days ago #

    bonjour
    Petit soucis avec src , dans l’original src = hl/2 soit (high+low)/2
    Un idée ?
    /@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”)

  4. jacquesgermain • 147 days ago #

    Bonjour
    non pas de soucis car src=customclose donc dans le menu configuration/propriété menu déroulant choisir médian (h+b)/2 ou alors si vous voulez figer cette variable dans le probuilder remplacer src=customclose par src=Median Price

  5. geroniman • 133 days ago #

    Merci Jacques , indic tres utile. J’ai un indic à programmer avec du price action. es tu dispo pour m’aider à le faire?

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas Il faut l'ajouter sur le prix avec l'icône de la clé situé en haut à gauche du graphique du ...
jerome777 merci de ta réponse
jerome777 bonjour c est bon il fonctionne parfaitement merci beaucoup
Nicolas Check your custom trading hours and use the default market ones.
fj_pastor Hello Nicolas, Thanks again for all your support. Finally I debugged the problem. The sim...
kallistos Hi Nicolas, Thank you very much indeed for this indicator (and all the others you are provi...
frenqle Hi There.. It seems the TSL stop loss is not working.. it does not respond is that correct?
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...
FXmike hey my friends, thank you for this great code. my problem is he make no trade open. backtest...
FXmike Can i put a Action that my start contract is smaller than 1 ? 0.3 or 0.5 ? In wich Position...
phoentzs I wrote the code for M15 back then and also variants in H1 and M1. Everything works so far....
Morrissey38 Muchísimas gracias Nicolás , muy amable.
Bruno Carnazzi extrèmement pertinent
Bruno Carnazzi Is that beatable ?
Alps007 Hi Nicolas. Happy New Year. Can you please program me several MACD divergence screeners ...
Arlei Zanin Hello Nicolas, would it be possible to convert the Cloud to Pascal language? Thank you.
ashee i want it in MT4
Marie-Eve Vergoz Bonsoir - Voici l'erreur qui est signalée lorsque je souhaite utiliser cet indicateur : il...
Sapo Thank you for your indicators. As always it's perfect, I thank you for your help it's preci...
Vonasi Sure that is possible. I will code it and make a post in the English ProBuilder forum and pu...
Vonasi Vama v2 with Hull moving average included can be found here: https://www.prorealcode.com/top...
JMat45 Thank you, Vonasi.
Nicolas
5 years ago
LRMA
LRMA
0
Indicators
manchokcity can we have it in mql4 platform? or how or which platform do we use it?
camporan I don't use MetaTrader so I won't be able to do the translation myself. Sorry!
Alexander9 This can for amibroker ? . Thanks
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
TempusFugit Hi, this simple system for DOW and only shorts has worked quite well, maybe because of its q...
phoentzs Unfortunately, I never pursued this strategy further. Maybe I should take a look with what ...
robertogozzi It surely CHANGES even when currently outside time range, as the lookback periods change as ...
SkippyTrader Thanks Roberto, but shouldnt the values in the outside time range not be different? As it sh...
robertogozzi Actually it is a constant (I tested them on a 1-hour TF, 9am to 5pm) and outside that time r...
funkystuff Salut Balmora, Ton indicateur est plutôt intéressant :) Penses-tu qu'il soit possible de l'...
brian gilbert Hello, can you explain to me what are "pipsize" and "ATAN"? What functions do they have and ...
Bodaris Bonjour, Je suis débutant 1 mois :p pipsize ressemble à la fonction pointsize et ATAN...
darbes Hi How does it go on live ? JC
antonio73 Balmora74, io vedo che funziona anche su timeframe ad 1 minuto con piccole ottimizzazioni, t...
Juananantoniorodriguez hola buenas, a este sistema automático, Cómo se le podría poner un stoploss de beneficio sim...
Leo I don't know, I just copy paste the strategy. The optimisation of the values I wrote them in...
bertrandpinoy hello Leo I'm spending time on your strategy code. do you agree to try to include this code ...
bertrandpinoy //version a: ajout filtre MM defparam cumulateorders=false // --- paramètres taille =...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
DimKar Dear sir , thank you very much for sharing !!!! it is awesome ...!!! Please can you tell me...
Nicolas Change line 62 with: drawcandle(flup,fldn,flup,fldn) coloured(169,169,169,80) bordercolor(16...
DimKar Thank you very much from Greece sir , have a nice day ....!!!! Really i do not have words...
3agl3 voglio l indicatore

Top