Double VAMA Ribbon Indicator

stable
By ajd1107 in Trend Published July 2022 👁 1,070 views 💬 0 comments

Description

While the Hull Ribbon is great, and 2 Ribbons are better, at the end of the day it's still a moving average with no consideration for Volume. Here is a Double Ribbon Indicator using Volume Adjusted Moving Averages (VAMA) that returns a continuous signal when both ribbons agree. May it serve you well! Requires Pshai's VAMA Command: https://www.haasscripts.com/t/pshaicmd-volume-adjusted-moving-average-vama/
HaasScript
-- Author: Fogg
-- Trend Ribbon using Pshai's VAMA indicator
-- Tips:
-- BTC: 33KNgqyxQzVqVbcTKcNBYtgdKo4dmxAXDs
-- USDT (ERC20): 0xCDB382b37C19f7241340A1A2eCF694588327aB0E

-- INPUTS
DefineCommand('DUAL_VAMA_RIBBON', 'DVAMA Ribbon')

InputGroupHeader('Fast VAMA')
local length1 = Input('VAMA Length', 50, 'Fast VAMA Length')
local increment1 = Input('VAMA Increment', 0.67, 'VAMA Increment, <1 for faster reactions')
local fvtf = InputInterval('VAMA Timeframe', 1, 'Timeframe for Fast VAMA Plot')

InputGroupHeader('Slow VAMA')
local length2 = Input('VAMA Length', 50, 'VAMA Length - 10-50 for fast VAMA, 100-200 for longer swings')
local increment2 = Input('VAMA Increment', 0.67, 'VAMA Increment, <1 for faster reactions')
local svtf = InputInterval('VAMA Timeframe', 1, 'Timeframe for Slow VAMA Plot')

-- Price and Volume Data
local fc = ClosePrices(fvtf)
local fv = GetVolume(fvtf)
local sc = ClosePrices(svtf)
local sv = GetVolume(svtf)

-- VAMA
local VAMA1 =  CC_VAMA(fc, fv, length1, increment1, false)
local VAMA2 =  CC_VAMA(sc, sv, length2, increment2, false)

-- Fast VAMA Plot
local FVAMA1 = VAMA1[1]
local SVAMA1 = VAMA1[4]
local v1 = Plot(0, 'FVAMA1', FVAMA1, Green)
local v2 = Plot(0, 'SVAMA1', SVAMA1, Red)
PlotCloud(v1, v2, 50)

-- Slow VAMA Plot
local FVAMA2 = VAMA2[1]
local SVAMA2 = VAMA2[4]
local v3 = Plot(0, 'FVAMA2', FVAMA2, Cyan)
local v4 = Plot(0, 'SVAMA2', SVAMA2, Orange)
PlotCloud(v3, v4, 50)

-- Signal Conditions
local signal = IndicatorContainer(GetAboveBelowSignal(FVAMA1, SVAMA1), GetAboveBelowSignal(FVAMA2, SVAMA2))
signal = IfElseIf(signal[1]!=SignalNone, signal[2]!=SignalNone, signal[1], signal[2], SignalNone)
--PlotSignalEnum(-2, signal)
DefineOutput(EnumType, signal, 'DVAMA Signal')

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!