Display Symbol TF free

by yomm0401 in category Other at 17/09/2020
Description
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
´╗┐using System;
using System.Text;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = true, AccessRights = AccessRights.None)]
    public class DisplaySymbolTF : Indicator
    {
        [Parameter("Color", DefaultValue = "Black")]
        public string tColor { get; set; }

        [Parameter("Transparency", DefaultValue = 200, MinValue = 0, MaxValue = 255)]
        public int l_Transparency { get; set; }

        [Parameter("VerticalAlignment", DefaultValue = VerticalAlignment.Top)]
        public VerticalAlignment VerticalAlignment { get; set; }

        [Parameter("HorizontalAlignment", DefaultValue = HorizontalAlignment.Center)]
        public HorizontalAlignment HorizontalAlignment { get; set; }

        protected override void Initialize()
        {
            Color _upColor = Color.FromName(tColor);
            byte u_g = _upColor.G;
            byte u_b = _upColor.B;
            byte u_r = _upColor.R;
            string timeframe = Chart.TimeFrame.ToString();
            string symbolname = Chart.SymbolName;
            Chart.DrawStaticText("symboltimeframe", symbolname + " " + timeframe, VerticalAlignment, HorizontalAlignment, Color.FromArgb(l_Transparency, u_r, u_g, u_b));

        }
        public override void Calculate(int index)
        {
        }
    }
}
Comments
0