Tow_MACD_In_One free
Description
Using this indicator, you can have two MACDs in one indicator area
Includes a normal MACD and a histogram MACD
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
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; namespace cAlgo { [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class Double_MACD : Indicator { [Parameter("Long Cycle", DefaultValue = 26)] public int LongCycle { get; set; } [Parameter("Short Cycle", DefaultValue = 12)] public int ShortCycle { get; set; } [Parameter("Signal Periods", DefaultValue = 9)] public int Periods { get; set; } [Parameter()] public DataSeries Source { get; set; } [Parameter("Long CycleH", DefaultValue = 117)] public int LongCycleH { get; set; } [Parameter("Short CycleH", DefaultValue = 54)] public int ShortCycleH { get; set; } [Parameter("Signal PeriodsH", DefaultValue = 41)] public int PeriodsH { get; set; } private MacdCrossOver _macdCrossOver; private MacdHistogram _macdHistogram; [Output("MACD", Color = Colors.Blue)] public IndicatorDataSeries Macd { get; set; } [Output("MACDH", PlotType = PlotType.Histogram, Color = Colors.Green)] public IndicatorDataSeries MacdH { get; set; } [Output("Signal", LineStyle = LineStyle.Lines, Color = Colors.Red)] public IndicatorDataSeries Signal { get; set; } [Output("SignalH", LineStyle = LineStyle.Lines, Color = Colors.Yellow)] public IndicatorDataSeries SignalH { get; set; } protected override void Initialize() { _macdCrossOver = Indicators.MacdCrossOver(LongCycle, ShortCycle, Periods); _macdHistogram = Indicators.MacdHistogram(Source, LongCycleH, ShortCycleH, PeriodsH); } public override void Calculate(int index) { Macd[index] = _macdCrossOver.MACD[index]; MacdH[index] = _macdHistogram.Histogram[index]; Signal[index] = _macdCrossOver.Signal[index]; SignalH[index] = _macdHistogram.Signal[index]; } } }
Comments

You have given very useful information. Keep it up and keep blogging. I look forward to reading your next post. io games

Thank you for your opinion

When divergence is observed in both indicators (in different proportions), there is a possibility of changing the trend