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 • 173 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 • 173 days ago #

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

  3. larouedegann • 159 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 • 159 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 • 144 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
ottimo Thank you Nicolas, great indicator, N. 1
tikigai Merci Nicolas! First Happy new Year 2020. Very good indicator BUT (yes the french "oui, m...
Nicolas Whats prorealtime version? Did you try in version prior to v11? indicator's call and loop ca...
Nicolas Yes, that's how it goes when using loops..
JosephFelix Hi, Could I please have help with adding these indicators 'on price'? Every indicator that I...
Nicolas Just add it on price by clicking the wrench on the left upper side of the price chart.
Marcos Alvarez Dominguez Hello Nicolas, is it possible to stablish a bullish screener for this indicator when the cen...
Nicolas Please open a topic in the screener section to ask for this specific query.
zaher123 Hello, the indicator doesn't show up anything on the screen, any suggestions please?
Nicolas Apply it on the price chart. The indicator plot just one single line. There are two in the...
jamesoc Hi Nicolas, do you happen to know if there is an indicator that can be applied to charts, to...
gustavobp Buenos dias Nicolas, al agregar tu indicador no me reconoce la variable Price ni en la linea...
tradingpro salve io faccio spread trading e volevo sapere come impostare un profitto da chiudere in a...
Nicolas Per favore non fare domande generali, non correlate al post. Usa invece il forum.
Bard Incredible, that is the clearest depiction of the trend I've ever seen Nicolas. (I just chan...
Appsoluxions Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Nicolas Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Appsoluxions Cool. Thanks for the response.
rama I want to use this indicator in trading system, it says zig zag is obsolete and not supported
Nicolas Right, due to its repainting behavior, the zigzag is not allowed in automated trading with r...
rama I noticed it changes as time progress, I am 7 as the average, how many period it wont chang...
Gordon101 Hi when I added your Guppy indicator to my chart it went below the chart beside the oscilla...
Nicolas Add it on the price by using the wrench located on the left upper side of your price chart.
Gordon101 Thanks Nicolas, worked a treat.
Rafa And the PriceMAPeriod? aren´t the same?
Nicolas The PriceMAPeriod is the period to make the average of all the last X medianprice found.
Rafa Thanks a lot Nicolás. Have a nice day
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
swapping merci gabri, on va le mettre à l'essai ;)
Leo Hi all, I posted a new version of this indicator ( I just add arrows to spot the local maxi...
Trading_En_El_Ibex35 Muchas Gracias por compartir este interesante indicador. Un saludo
xavieralava hola gracias leo
Khaled Thanks, but if I may ask what's EMA Period? The price which reverses the EMA[20] is not the ...
Francesco78 EMA is not a moving average, it is just the name we called the quantity defined above
Khaled My bad. Thank you so much!
rejo007 hello david, i'll try it could you tell me wich strategy do you use in real? thanks
David Somogyi Hello, I have a couple of DAX strategies of breakout and mean reversion. I'll try to post...
Roberto Blázquez Hi David, I just saw your strategy and it's good!!! I'm going to try it from today in real a...
Thomas007 Is there any way to build something similar for FX? I wonder what would be the replacement f...
Kris75 Hi Bolsatrilera, I love this indicator! Thanks; => did you develop a strategy around...
KarlBenjamin This "indicator" alone has completely changed my algorithms for the better! Id even go as fa...
ashee CAN YOU SHARE MT4 FILE
coyP Big thanks ! Can you explain me how can I put this ON my graph and not under the graph please ?

Top