Daily Price Lines free

by summer in category Other at 28/01/2021
Description

前日日足の高値・安値・始値・終値のラインを表示します。

Draw the previous day's daily high, low, opening, and closing price lines.

 

 

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 DailyPriceLines : Indicator
    {
        [Parameter("High", DefaultValue = true)]
        public bool High { get; set; }

        [Parameter("Low", DefaultValue = true)]
        public bool Low { get; set; }

        [Parameter("Open", DefaultValue = true)]
        public bool Open { get; set; }

        [Parameter("Close", DefaultValue = true)]
        public bool Close { get; set; }

        [Parameter("High Color", DefaultValue = "Red")]
        public string HighColor { get; set; }

        [Parameter("Low Color", DefaultValue = "Blue")]
        public string LowColor { get; set; }

        [Parameter("Open Color", DefaultValue = "DeepPink")]
        public string OpenColor { get; set; }

        [Parameter("Close Color", DefaultValue = "Green")]
        public string CloseColor { get; set; }



        protected override void Initialize()
        {

        }

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

            if (High)
                Chart.DrawHorizontalLine("Daily Heigh", bars.HighPrices.Last(1), HighColor, 1, LineStyle.Dots);

            if (Low)
                Chart.DrawHorizontalLine("Daily Low", bars.LowPrices.Last(1), LowColor, 1, LineStyle.Dots);

            if (Open)
                Chart.DrawHorizontalLine("Daily Open", bars.OpenPrices.Last(1), OpenColor, 1, LineStyle.Dots);

            if (Close)
                Chart.DrawHorizontalLine("Daily Close", bars.ClosePrices.Last(1), CloseColor, 1, LineStyle.Dots);
        }
    }
}
Comments

dokinya - February 03, 2021 @ 11:56

this indicator is awesome is possible to add color to 

high

low

open

close

?

lazarevic.miroslav - February 03, 2021 @ 21:13

You can customize that easily for yourself. Just replace Color with Color.Blue or whatever name you want and rebuild the indicator.

summer - March 12, 2021 @ 13:54

Hey Guys!

Then I updated it.

Try it!

hamsider - September 16, 2021 @ 22:18

Hello Summer, Thank you for the simple but really useful code. I'm wandering if you know how one can highlight the actual price of the lines on the price axes ! 


see this poshtrader.com/items/ctrader/4856/ 

5