Category Other  Published on 25/03/2020

Time On Ask Line

Description

Very simple algo to display the current server time on the Ask line

 


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 TimeOnAsk : Indicator
    {
        [Parameter("Bar Offset", Group = "Location", DefaultValue = 1, MinValue = 1)]
        public int BarOffset { get; set; }

        [Parameter("Pip Offset", Group = "Location", DefaultValue = 0)]
        public int PipOffset { get; set; }

        [Parameter("Text Color", Group = "Appearance", DefaultValue = "White")]
        public string TextColor { get; set; }

        public override void Calculate(int index)
        {
            // may fail if you don't use a valid colour name
            if (IsLastBar)
                Chart.DrawText("time", Time.ToLongTimeString(), Chart.LastVisibleBarIndex + BarOffset, Symbol.Ask + (PipOffset * Symbol.PipSize), Color.FromName(TextColor));
        }
    }
}


SV
svenissimo

Joined on 14.02.2020

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Time On Ask.algo
  • Rating: 5
  • Installs: 1606
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
No comments found.