(MA Visual) vivaGlimpse by vivapeiro free

by Fron in category Trend at 19/01/2021
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

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, 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);
            }
        }
    }
}
Comments
5