Category Other  Published on 28/11/2014

Activity based Volume

Description

This indicator is an alternative view of volume.

It removes the width of the candle high-low in ticks from the volume.

It really emphasises the volume in a number of circumstances and can in some instances highlight areas of deep buying and selling over the standard volume indication. The difference is minor in most cases, but in lower time frames it really shines.

 

 

 


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TrueVolume : Indicator
    {

        [Output("Greater", PlotType = PlotType.Histogram)]
        public IndicatorDataSeries GreaterVolume { get; set; }

        [Output("Lesser", PlotType = PlotType.Histogram)]
        public IndicatorDataSeries LesserVolume { get; set; }

        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            double pVolume = MarketSeries.TickVolume[index - 1] - ((MarketSeries.High[index - 1] - MarketSeries.Low[index - 1]) / Symbol.TickSize);
            double cVolume = MarketSeries.TickVolume[index] - ((MarketSeries.High[index] - MarketSeries.Low[index]) / Symbol.TickSize);


            if (cVolume > pVolume)
            {
                GreaterVolume[index] = cVolume;
                LesserVolume[index] = 0;
            }
            if (cVolume < pVolume)
            {
                LesserVolume[index] = cVolume;
                GreaterVolume[index] = 0;
            }
            if (cVolume == pVolume)
            {
                if (LesserVolume[index - 1] == 0)
                    GreaterVolume[index] = cVolume;
                if (GreaterVolume[index - 1] == 0)
                    LesserVolume[index] = cVolume;
            }



        }
    }
}


EL
Elogos

Joined on 23.01.2014

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: True Volume.algo
  • Rating: 5
  • Installs: 5028
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
No comments found.