VWAP continual free

by mfejza in category Trend at 08/09/2022
Description

In this version VWAP (Volume Weighted Average Price) is calculated based on comulative look back periods

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
´╗┐using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class mVWAPcontinual : Indicator
    {
        [Parameter("Periods (10)", DefaultValue = 10)]
        public int inpPeriods { get; set; }

        [Output("VWAP Continual")]
        public IndicatorDataSeries outVWAPc { get; set; }

        private IndicatorDataSeries _vwap;

        protected override void Initialize()
        {
            _vwap = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _vwap[i] = ((Bars.TypicalPrices.Sum(inpPeriods) * Bars.TickVolumes.Sum(inpPeriods)) / Bars.TickVolumes.Sum(inpPeriods)) / inpPeriods;

            outVWAPc[i] = _vwap[i];
        }
    }
}
Comments

alexsanramon - September 16, 2022 @ 01:55

This indicator works the same as simple moving average. Please check. THanks,

mfejza - March 14, 2023 @ 23:32

Dear alexsanramon & nicolejohnston668

To show the difference between Continual VWAP and SMA you have the indicator as in link 
Hope this costum indicator complete your suspicion

https://ctrader.com/algos/indicators/show/3315

0