Exemplo n.º 1
0
        /// <summary>
        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
        /// </summary>
        /// <seealso cref="QCAlgorithm.SetStartDate(System.DateTime)"/>
        /// <seealso cref="QCAlgorithm.SetEndDate(System.DateTime)"/>
        /// <seealso cref="QCAlgorithm.SetCash(decimal)"/>
        public override void Initialize()
        {
            //mylog.Debug(transheader);
            mylog.Debug(ondataheader);

            //Initialize dates
            SetStartDate(_startDate);
            SetEndDate(_endDate);
            SetCash(22000);

            //Add as many securities as you like. All the data will be passed into the event handler:
            AddSecurity(SecurityType.Equity, symbol, Resolution.Minute);
            Price                = new RollingWindow <IndicatorDataPoint>(14);
            cycleSignal          = new RollingWindow <IndicatorDataPoint>(14);
            cycle                = new CyberCycle(7);
            Price                = new RollingWindow <IndicatorDataPoint>(14);
            diff                 = new RollingWindow <IndicatorDataPoint>(20);
            standardDeviation    = new StandardDeviation(30);
            fish                 = new InverseFisherTransform(10);
            fishHistory          = new RollingWindow <IndicatorDataPoint>(7);
            fishDirectionHistory = new RollingWindow <IndicatorDataPoint>(7);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
        /// </summary>
        /// <seealso cref="QCAlgorithm.SetStartDate(System.DateTime)"/>
        /// <seealso cref="QCAlgorithm.SetEndDate(System.DateTime)"/>
        /// <seealso cref="QCAlgorithm.SetCash(decimal)"/>
        public override void Initialize()
        {
            //mylog.Debug(transheader);
            mylog.Debug(ondataheader);

            //Initialize dates
            SetStartDate(_startDate);
            SetEndDate(_endDate);
            SetCash(22000);

            //Add as many securities as you like. All the data will be passed into the event handler:
            AddSecurity(SecurityType.Equity, symbol, Resolution.Minute);
            Price = new RollingWindow<IndicatorDataPoint>(14);
            cycleSignal = new RollingWindow<IndicatorDataPoint>(14);
            cycle = new CyberCycle(7);
            Price = new RollingWindow<IndicatorDataPoint>(14);
            diff = new RollingWindow<IndicatorDataPoint>(20);
            standardDeviation = new StandardDeviation(30);
            fish = new InverseFisherTransform(10);
            fishHistory = new RollingWindow<IndicatorDataPoint>(7);
            fishDirectionHistory = new RollingWindow<IndicatorDataPoint>(7);
        }