How to use The Custom Indicator in multiple timeframes

Created at 15 Apr 2018, 20:18
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!
Bits's avatar

Bits

Joined 14.03.2018

How to use The Custom Indicator in multiple timeframes
15 Apr 2018, 20:18


Dear:

     if i have a Custom Indicators CS. So How to  use The CS of Custom  Indicato  in   multiple timeframes.

eg:

 public IndicatorDataSeries Result { get; set; }

        private MarketSeries series5;
        protected override void Initialize()
        {
            // Initialize and create nested indicators
            series5 = MarketData.GetSeries(TimeFrame.Minute5);
        }

        public override void Calculate(int index)
        {

            Result = Indicators.CS(series5, 0);                        ****line 9

            // Calculate value at specified index
            // Result[index] = ...
        }

the *********line 9 is wrong in builder。  

   Error CS1061: “cAlgo.API.Internals.IIndicatorsAccessor” donot contain“CS”..................

how to add the CS to “cAlgo.API.Internals.IIndicatorsAccessor" or else  Solution??

waiting for your response,thanks !

 


@Bits
Replies

PanagiotisCharalampous
16 Apr 2018, 11:38

Hi yearn2012,

The correct syntax is the following

Result = Indicators.GetIndicator<CS>(series5,0);

Best Regards,

Panagiotis


@PanagiotisCharalampous