Overlaying one indicator on top of another
Created at 04 Feb 2016, 20:47
Overlaying one indicator on top of another
04 Feb 2016, 20:47
I like to use RSI 14, RSI 5, and CCI 5. It would be nice to overlay all of them. This saves on screen space. I'm guessing the only way to do it is through calgo.
Here is the code for one RSI indicator, how can we add other indicators in there?
using cAlgo.API; using cAlgo.API.Indicators; namespace cAlgo.Indicators { [Indicator(IsOverlay = false, AutoRescale = true, TimeZone = TimeZones.UTC, ScalePrecision = 0)] public class SingleRSI : Indicator { private RelativeStrengthIndex rsi; [Parameter()] public DataSeries Source { get; set; } [Parameter(DefaultValue = 50)] public int Periods { get; set; } [Output("Rsi", Color = Colors.Green)] public IndicatorDataSeries Rsi { get; set; } protected override void Initialize() { // Initialize and create nested indicators rsi = Indicators.RelativeStrengthIndex(Source, Periods); } public override void Calculate(int index) { Rsi[index] = rsi.Result[index]; } } }
Dm2025
06 Feb 2016, 01:34
Good news. I have figured it out.
/api/guides/indicators near the bottom of the page I found something on combining two indicators. The following is how you can have multiple indicators in one indicator window.
So for the RSI I used this code:
And now we have mt4 functionality.
@Dm2025