VAMA – Volatility Adaptive Moving Average

VAMA – Volatility Adaptive Moving Average

This VAMA indicator draws an average with a period of p. The value of p is changed depending upon recent market volatility.

You set a percentage and the indicator counts back how many bars are needed to find that the highest high minus the lowest low is greater or equal to the desired percentage of the current price. The value for p is the number of bars needed to find this range.

With this calculation when a market is not very volatile the value of p will be high and the average slower moving and  in a volatile market the value of p will be low and the average faster moving.

You can change the average type drawn by changing the value of ‘type’ from 0 to 6.

  • 0 = Simple
  • 1 = Exponential
  • 2 = Weighted
  • 3 = Wilder
  • 4 =Triangular
  • 5 = End Point
  • 6 = Time Series

Set ‘Percentage’ to whatever percentage of price you want to use to calculate the p value for the average.

You can turn on and off the display of the latest p value change.

Due to the loop the average can be quite slow to draw so I advise using the DEFPARAM CALCULATEONLASTBARS to reduce calculation time.

I advise downloading the ITF file and importing it to get full functionality.

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. JMat45 • 57 days ago #

    Thanks, Vonasi. Can this be adapted for a Hull moving average too? I’ve been looking for an ‘adaptive’ Hull for some time.

  2. Vonasi • 57 days ago #

    Sure that is possible. I will code it and make a post in the English ProBuilder forum and put a link here to that topic.

  3. Vonasi • 57 days ago #

    Vama v2 with Hull moving average included can be found here:

  4. JMat45 • 56 days ago #

    Thank you, Vonasi.

Register or


avatar avatar avatar avatar
Related users ' posts
Jean-Teddy DAMOUR Bonjour Nicolas, Je souhaite vous contacter pour une demande particulière. Pouvez-vous me ...
Nicolas Vous pouvez utiliser le formulaire de la page programmation:
efahmy I'm using V10.3 with IG and whenever I'm importing an indicator it doesnt overlay on the cha...
Sapo Thank you for your indicators. As always it's perfect, I thank you for your help it's preci...
Om Hello, thanks for sharing! Getting a message that Variable P is undefined?
3 months ago
Matriciel Well done Vonasi ! You have a lot of ideas. Personally, I work with Moving Averages only. ...
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
camporan You can use it 5M onwards, but the longer timeframe the more accurate it is. My preferred ar...
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!
Bard Hi Nicolas, thanks a lot for coding this interesting looking indicator. I read: https://...
Bard I've also just noticed that changing the "Bands Deviation" setting from 1.25 to eg 3 doesn't...
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...
funkystuff Salut Balmora, Ton indicateur est plutôt intéressant :) Penses-tu qu'il soit possible de l'...
rrenaud_ig Great work ! My only concern is about risk management. Your results are based on 10k. Max lo...
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...
10 months ago
juanj I have actually completely redesigned this indicator with loads of improvements, so will res...
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...
Bard Thanks for this great addition. How would you "finish the syntax" if you were to use an ALMA...
Bard Problems with Safari latest s/ware and this site and links and adding code. Let me add the...
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...
Nicolas Alpha transparency from 0 to 255.
ehtsham Hi, Sir can you tell me how to put this code in indicator plz
Jan Wind Ehtsham, all you need to do is change the code in line 18 and line 20 (see the code above...