Replies

ctid225861
25 Jul 2016, 14:06

Forget what I just posted. I want to know how to get two series to have the dates and times in line. Here is a simpler version of the code I'm having difficulty with.

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 OtherSeriesstudy : Indicator
    {
        private MarketSeries series2;
        private Symbol symbol2;

        [Parameter(DefaultValue = "EURUSD")]
        public string Symbol2 { get; set; }

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

        protected override void Initialize()
        {
            symbol2 = MarketData.GetSymbol(Symbol2);
            series2 = MarketData.GetSeries(symbol2, TimeFrame);
        }

        public override void Calculate(int index)
        {
            diff = MarketSeries.Close.Count - series2.Close.Count;
            Result[index] = series2.Close[index - diff];
        }
    }
}

 


@ctid225861