Help the novice, ask a question about extracting indicators.

Created at 08 Feb 2015, 15:29
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!
YE

yesok2015

Joined 08.02.2015

Help the novice, ask a question about extracting indicators.
08 Feb 2015, 15:29


There is an indicators, how to get the "Result [index]]" value.
I want to use it in the cBots, how to pass?
Broken English, sorry.

Expect to get help!Thanks!

using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
    [Indicator(AccessRights = AccessRights.None)]
    public class EFBullPower : Indicator
    {
        private ExponentialMovingAverage _ema;
        [Parameter()]
        public DataSeries Source { get; set; }
        [Parameter("Period", DefaultValue = 13)]
        public int Period { get; set; }

        [Output("Bull Power", PlotType = PlotType.Histogram)]
        public IndicatorDataSeries Result { get; set; }
        protected override void Initialize()
        {
            _ema = Indicators.ExponentialMovingAverage(Source, Period);
        }
        public override void Calculate(int index)
        {
            Result[index] = MarketSeries.High[index] - _ema.Result[index];
        }
    }
}

 


@yesok2015
Replies

Spotware
16 Feb 2015, 10:37

Dear Trader,

Please read the following section in Custom Indicators Guide:

/api/guides/indicators#el8.

Hope this helps.


@Spotware