ALMA VHF Filter (MA & Signal Band)

ALMA VHF Filter (MA & Signal Band)

2 indicators in this post, the ALMA moving average with its offset  automatically adjusted with a VHF (Vertical Horizontal Filter). The second one is a signals band made of 2 moving average calculated separately with Highs and Lows of the last X periods (Window setting).

I made it first as a rough idea and found it interesting for scalping trading as it reacts quickly enough to find good entries of potential new movement (and quickly revert on false signals), and automatically adapt the band due to volatility while in good trend, resulting of a “keep on trading” technique.

The VHFp controls the period of the VHF filter.

Hi/Lo bands made of this moving average:


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?

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

  1. soulintact • 11/11/2018 #

    A very good combination Nicolas, thanks!

  2. Stenozar • 11/11/2018 #

    Hi Nicolas, I see two itf files; we should put both on them on the graph? thank you!

    • Nicolas • 11/11/2018 #

      Only the second one if you want to have the same indicator as the one presented in the picture.

  3. Stenozar • 11/11/2018 #

    Thanks Nicolas!

  4. carlvan • 11/11/2018 #

    Dear Nicolas, as usual big thank you for sharing those gems!
    I imported your code of Alma HiLo bands into PRT and it charts perfectly.
    However, when I tried to build a system and backtest it, it charts the result automatically but the entry/exit signals are mished mashed, at the wrong place – very strange.
    My opinion is that it might be due to the “CALL” routines you used in the code.
    I tried to fix this but unlucky so far.
    Do you think this can be fixed?
    Here is your code, with the trade signals (long and exit only for simplicity):

    defparam cumulateorders=false

    //PRC_ALMA VHF Filter Hi/Lo band | indicator
    //Nicolas @
    //Sharing ProRealTime knowledge
    Window = 7
    Sigma = 3
    VHFp = 21
    // — end of settings

    HH = CALL “PRC_ALMA VHF filter”[window, sigma, VHFp](high)
    LL = CALL “PRC_ALMA VHF filter”[window, sigma, VHFp](low)

    if hh<hh[1] and lowLL[1] and high>hh then

    if trend=1 then

    if not longonmarket and close[1] crosses over iline[1] and Close>High[1] then
    buy at market
    if longonmarket and close < iline then
    sell at market

    • Nicolas • 11/11/2018 #

      You should not use offset in this case. Delete all the [1] references in your code. BTW, trend of the indicator doesn’t change when price go through the line, so in order to launch orders according to the indicator, you should use the “trend” variable and its change between 2 candlesticks.

  5. carlvan • 11/11/2018 #

    That works now, thank you !

  6. atxeel • 11/11/2018 #

    Hello Nicolas, the Indi is really great. Unfortunately, I get an error message that takes a long time to calculate, up to 2 seconds. Have it tried with defparam calculateonlastbars unfortunately without success, Maybe you have another solution. Thank you.

    • Nicolas • 11/11/2018 #

      Yes, that’s how it goes when using loops..

  7. JosephFelix • 11/11/2018 #

    Hi, Could I please have help with adding these indicators ‘on price’? Every indicator that I add plots as a sub-graph. What am I doing wrong here?

    • Nicolas • 11/11/2018 #

      Just add it on price by clicking the wrench on the left upper side of the price chart.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
danistuta Hi, thank it works with prorealtime 10.3:-) I'd like test on EUR/USD...could you s...
Jan Just run the code for this pair, make sure you have the right spread filled. What you could...
oxy75 Hello. I understood that we were waiting to choose two values ​​between 0 and 69 for the two...
swedshare You got some potential here. A couple of things I think about: 1, The opening hours in this...
phoentzs Ich habe hier mit Spread 2 gerechnet, also etwa dem Mittelwert zwischen Tag und Nacht. Das G...
phoentzs Hab festgestellt, das US500 fast noch besser funktioniert als der Dax. Was aber auch daran l...
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
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:
JMat45 Thank you, Vonasi.
9 months ago
bertrandpinoy hello juanj, can you send the code repair by your good care to try scalping please?
rama what is the buy condition or sell condition for this can you suggest a code k1=1 buy and k1...
rama I would like to know at point 1 an alert or binary indicator so that I can place order
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?
Jan Wind Good evening Roberto, I do not understand Italian, so I could not read the background. ...
robertogozzi Results, while matching when it's SMA compared to TRSMA, are different in the case of WMA an...
Nicolas You can ask for private custom coding to our programming services: https://www.prorealcode.c...
darbes Nicolas Could you code in PRT from an MT4 code ? Best JC
darbes Nicolas How to convert this signal into a strategy pro ? Best JC
funkystuff Salut Balmora, Ton indicateur est plutôt intéressant :) Penses-tu qu'il soit possible de l'...
Tony87 can we have a update on this one please?
Nicolas Discussions with many other versions and improvements can be found here: https://www.proreal...
darbes Hi How does it go on live ? JC
Vonasi A modified version of this indicator can be found here:
arnaudat Bonjour, je suis tombé sur cet indicateur par des recherches sur les écarts types et il me...
Nicolas Il y a peut-être une erreur de calcul causée par un division par zéro, j'ai retrouvé une aut...
arnaudat Merci nicolas, j'ai déjà pris cette version et en plus je suis sur les futures. Par contre d...
Brisvegas Thats Awesome thank you
Vinks_o_7 Thanks Vonasi !
Nicolas In the indicator's settings window.
Tarkus1954 Hi. When I add this indicator it loads it in a separate window. How do I get the indicator...
Nicolas By adding it on the price chart. Use the wrench on the left upper side of the price chart.
Stenozar Thanks Leo!
Madrosat Hi Leo something is missing in the strategy above because it does not work at all as it is
Leo I don't know, I just copy paste the strategy. The optimisation of the values I wrote them in...