not referencing

Created at 02 Mar 2015, 11:38
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!
CI

cicondo

Joined 18.12.2012

not referencing
02 Mar 2015, 11:38


Hi @all,

I have no more idea why the reference of an custom indikator will not be found.This is an excerpt of an Testindicator referencing an HeikinAshi, which is selected... Please look at both, source and dialog setting:

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TestIndi : Indicator
    {
        [Parameter(DefaultValue = 1)]
        public TimeFrame SeriesType { get; set; }

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

        private MarketSeries _series;
        private HeikinAshi _indi;

        protected override void Initialize()
        {
            _series = MarketData.GetSeries(SeriesType);
            _indi = Indicators.GetIndicator<HeikinAshi>();
        }

        public override void Calculate(int index)
        {
            if (_series.Open[index - 1] >= _series.Close[index - 1])
            {
                Result[index] = -1;
            }
            else
            {
                Result[index] = 1;
            }
        }
    }
}


@cicondo
Replies

Spotware
03 Mar 2015, 15:32

You need to pass HeikinAshi parameters to GetIndicator method


@Spotware