Description
- This is to improve the Visual of the Exponential Moving Average
- instead of using the Line it actually changes the Bar Color when it crosses above or Below MA Type
- NOTE: THE MA LINE IS JUST AN EXAMPLE WHEN DOWNLOADED IT WILL ONLY SHOW THE BAR COLOR CHANGE
- PARAMETERS WILL BE PRICE (OHLC)... BY DEFAULT IT WILL ONLY USE Exponential Moving Average
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
Joined on 08.01.2020
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: vivaGlimpse.algo
- Rating: 5
- Installs: 1516
- Modified: 13/10/2021 09:55
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.