Description
Help to visualize the rising, falling.
Green: rising or unchanged from green.
Red: falling or unchanged from red.
Can apply on any source.
The RedGreen applied on an Instantaneous Trendline:
The RedGreen applied on the MACD crossover histogram:
here they are:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using LittleTrader;
using LittleTrader.Ehlers;
using LittleTrader.Extensions;
namespace cAlgo
{
[Levels(0)]
[Indicator(AccessRights = AccessRights.None)]
public class LT_Ind_RedGreen : Indicator
{
[Parameter("SourceType", DefaultValue = SourceTypes.Custom)]
public SourceTypes SourceType { get; set; }
[Parameter("CustomSource")]
public DataSeries CustomSource { get; set; }
[Output("Up", LineColor = "Green", IsHistogram = true)]
public IndicatorDataSeries Up { get; set; }
[Output("Dn", LineColor = "Red", IsHistogram = true)]
public IndicatorDataSeries Dn { get; set; }
DataSeries _s;
protected override void Initialize()
{
var u = new IndUtils() { Bars = Bars, SourceType = SourceType, CustomSource = CustomSource };
_s = u.GetSource();
}
public override void Calculate(int index)
{
Up[index] = _s.IsGreen(index) ? _s[index] : double.NaN;
Dn[index] = _s.IsRed(index) ? _s[index] : double.NaN;
}
}
}
dhnhuy
Joined on 03.04.2023
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: LT_Ind_RedGreen.algo
- Rating: 0
- Installs: 592
- Modified: 06/04/2023 04:12
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.