Category Other  Published on 18/05/2023

Tick Volume with Moving Averages

Description

This is a Simple Tick Volume with Already Implemented Moving Average of Your Choice.

You can choose between as many Moving Averages Algos as you want. Like Exponential, Simple, Weighted and etc.

Para os que querem participar de um Grupo dedicado ao CTrader no Telegram para falar sobre estratégias, desenvolvimento de indicadores na Plataforma e muito mais. Aqui segue o link

You can find me by joyining this Telegram Group http://t.me/cTraderCoders

Grupo de Telegram Para Brasileiros, Portugueses e todos aqueles que falam portugues:http://t.me/ComunidadeCtrader

Grupo CTrader en Español para Latinos:  http://t.me/ComunidadCtrader

 

 

 


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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TickVolumeMA : Indicator
    {
        [Parameter(DefaultValue = 40)]
        public int Parameter { get; set; }

        [Parameter(DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType Matype { get; set; }

        [Output("MA Volume", LineColor = "Gold")]
        public IndicatorDataSeries MaVol { get; set; }

        [Output("UpVolume", LineColor = "E000FCFF", PlotType = PlotType.Histogram, Thickness = 5)]
        public IndicatorDataSeries UpVolume { get; set; }

        [Output("DownVolume", LineColor = "D4FE0000", PlotType = PlotType.Histogram, Thickness = 5)]
        public IndicatorDataSeries DownVolume { get; set; }

        private MovingAverage ma;

        protected override void Initialize()
        {
            ma = Indicators.MovingAverage(Bars.TickVolumes, Parameter, Matype);
        }

        public override void Calculate(int index)
        {
            if (Bars.OpenPrices[index] <= Bars.ClosePrices[index])
            {
                UpVolume[index] = Bars.TickVolumes[index];
                DownVolume[index] = 0.0;
            }
            else
            {
                DownVolume[index] = Bars.TickVolumes[index];
                UpVolume[index] = 0.0;
            }
            MaVol[index] = ma.Result[index];
        }
    }
}


TraderExperto's avatar
TraderExperto

Joined on 07.06.2019

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Tick Volume MA.algo
  • Rating: 5
  • Installs: 3890
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
WU
wuyigui323 · 7 months ago

thank you!

MI
Misha007 · 3 years ago

hey, i did download indicator but it doesn't appear as downloaded....stays on the list of indicators from ctrader.com

SE
sejdinimarkelian · 4 years ago

thanks alot man , very clean and simple super useful , good job