VAMA with Hull Moving Average

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #110346 quote
    VonasiVonasi
    Moderator
    Master

    I have adapted my VAMA (Volatility Adaptive Moving Average) to include the Hull type of average following a request by JMat45 on the library post of the VAMA indicator that can be found here:

    VAMA – Volatility Adaptive Moving Average

    ITF file:

    [attachment file=”110347″]

    Hull moving average is average type 7.

    //VAMA - Volatility Adaptive Moving Average v2
    //(Now includes Hull moving average type)
    //By Vonasi
    //20191016
    
    defparam calculateonlastbars = 1000
    
    //percentage = 15 // percentage price move to calculate p on.
    //type = 1 //average type
    
    type = max(0,min(type,7))
    
    if barindex >= 1 then
    hh = close
    ll = close
    p = 0
    for a = 0 to barindex
    hh = max(hh,high[a])
    ll = min(ll,low[a])
    if (hh - ll)/close >= (percentage/100) then
    p = a+1
    break
    endif
    next
    
    if p > 0 then
    if type = 7 then
    inner = 2*weightedaverage[round(p/2)](customclose)-weightedaverage[p](customclose)
    vama = weightedaverage[round(sqrt(p))](inner)
    else
    vama = average[p,type](customclose)
    endif
    endif
    endif
    
    if pDisplayed then
    if p <> p[1] then
    drawtext("#p#", barindex, vama ,SansSerif,Bold,10) COLOURED(0,0,0)
    endif
    endif
    
    return vama
    Nicolas and JMat45 thanked this post
    VAMA-v2.itf
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

VAMA with Hull Moving Average


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Vonasi @vonasi Moderator
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/16/2019
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...