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 • 11/28/2023 #

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

  2. Bateson • 11/28/2023 #

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

  3. larouedegann • 11/28/2023 #

    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 • 11/28/2023 #

    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 • 357 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
okeus Ivan, riesci a creare un indicatore per le "evolventi paraboliche" ? grazie
groelandes Impagable tu trabajo cada semana. ¡Gracias!
Iván de nada! :)
P. Marlowe Muy bueno. ¿Podría hacerse para señalar extremos por el lado bajista? Lo mismo a la inversa....
Miro Esta es una versión del indicador, para ambos extremos. //-------------------------------...
P. Marlowe Muchas gracias ¡¡
jordan //---settings MAmode=0 Period=150 NumberOfMA=100 //---end of settings MA2=undefined ...
jordan dites moi si cela correspond à ce que vous cherchez
kats bonjour merci de ta reponse mais non ca fonctionne pas sympa quand même d'avoir essayé cdlt
Stenozar Ciao IVAN , mi da errore per la riga 49 "print tema low"; puoi suggerirmi la modifica da met...
Iván Avete provato a scaricare il file .itf?
AndyB72 Caricato ora sulla V12, nessun errore.
finplus Bonjour, une petite demande concernant cet indicateur : comment faire pour que lorsque la bo...
LucasBest Bonjour, la coloration des bandes se fait ligne 111 et 112 à l'aide des instructions colorbe...
Nicolas
2 years ago
FXtonio Bonjour Nicolas, merci pour cette merveille, je l'utilise en compl2ment du "magical buy sell...
xpe74 Bonjour Nicolas, quelle est la valeur de MA que l'on doit prendre en compte pour intégration...
Nicolas Il faut faire un CALL de l'indicateur et y placé en paramètre les valeurs des périodes souha...
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
xpe74 Utilitaire vraiment top, d'autant qu'ajouter des filtres de seuil peux aider a limiter le no...
supertiti Bel outil si on ne se tape pas sur les doigts avec ! Comment ajoute-on une image avec le co...
magnus59 Hi Nicolas, thaks for your great work here, I need a scanner for the swedish OMX when ma...
Nicolas Yes, sure please open a new topic in the ProScreener forum section, thank you.
paullyons Hello! Thanks for post your indicators. I'd like you to let me know how to draw lines for ...
thomas2004ch Hi, Is this startegy suitable for daily SPY? Regards
ebous64 Je cherche à traiter des effets de bords avec un encadrement ajustable des variables. Vous a...
thomas2004ch What are the values for nbx, nby, pbx, pby, ptsup, stplos, stptg, tp, vsmax, vsmin?
Rafa Hi Nicolas! I can´t install this indicator. it installs in a separate window not as an av...
Nicolas Add it on the price, see how: https://www.prorealcode.com/blog/video-tutorials/how-to-add-an...
Frankyslo1 No consigo instalarlo en el precio en PRL-version 10
Jiacky
2 years ago
Kalman Filter
Kalman Filter
0
Indicators
Sever
3 years ago
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
Roland57800 Bonjour Noobywan, si je comprends bien l'utilisation de ce code que je trouve particulièr...
Noobywan Bonjour, quand la question a été posée dans le forum à celui qui avait fait la requête en am...
Fabian This Code draws only a retangle if the condition has been confirmed and NOT before (in that ...

Top