Category Trend  Published on 20/01/2021

(MA Visual) vivaGlimpse by vivapeiro

Description
  1. This is to improve the Visual of the Exponential Moving Average
  2. instead of using the Line it actually changes the Bar Color when it crosses above or Below MA Type
  3. NOTE: THE MA LINE IS JUST AN EXAMPLE WHEN DOWNLOADED IT WILL ONLY SHOW THE BAR COLOR CHANGE 
  4. PARAMETERS WILL BE PRICE (OHLC)... BY DEFAULT IT WILL ONLY USE Exponential Moving Average

 

vivapeiropic


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

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

        [Parameter("Periods", DefaultValue = 9)]
        public int perid { get; set; }

        [Parameter("Source Price")]
        public DataSeries Source { get; set; }


        protected override void Initialize()
        {

        }

        public override void Calculate(int index)
        {
            var vma = Indicators.ExponentialMovingAverage(Source, perid);

            for (var i = 0; i < Bars.Count; i++)
            {
                var Price = Source[i];
                var Value = vma.Result[i];
                var barColor = Price > Value ? Color.FromHex("#00868A") : Color.FromHex("#D19292");
                Chart.SetBarColor(i, barColor);
            }
        }
    }
}


Fron's avatar
Fron

Joined on 08.01.2020

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