Nested custom indicators

Created at 06 May 2018, 19:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CE

ceakuk

Joined 19.03.2018

Nested custom indicators
06 May 2018, 19:26


Is there a way to use one of the outputs of IndicatorOne as the input of IndicatorTwo. Then use the output of IndicatorTwo inside indicatorOne

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class IndicatorOne : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("One")]
        public IndicatorDataSeries One { get; set; }
        
        [Output("Two")]
        public IndicatorDataSeries Two { get; set; }


        protected override void Initialize()
        {
        }
        public override void Calculate(int index)
        {
        }
    }
}

 

h

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class IndicatorTwo : Indicator
    {
       //From Indicator1
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Two")]
        public IndicatorDataSeries Two { get; set; }


        protected override void Initialize()
        {
        }
        public override void Calculate(int index)
        {
        }
    }
}

 


@ceakuk
Replies

PanagiotisCharalampous
09 May 2018, 12:54

Hi ceakuk,

Could please give some more information on what you are trying to do? What you mention is possible but probably not a correct way to do it. With more details maybe we can advise how to correctly implement your indicator.

Best Regards,

Panagiotis


@PanagiotisCharalampous