30mingrids free

by summer in category Other at 07/10/2020
Description

 

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mingrids : Indicator
    {

        [Parameter("本数", DefaultValue = 30, MinValue = 1, MaxValue = 120)]
        public int count { get; set; }

        protected override void Initialize()
        {

        }

        public override void Calculate(int index)
        {
            var bars = MarketData.GetBars(TimeFrame.Minute30);

            for (int i = 0; i < count; i++)
            {
                Chart.DrawVerticalLine("grids" + i.ToString(), bars.OpenTimes.Last(i), "Gray", 1, 0);
            }
        }
    }
}
Comments
0