Time On Ask Line free

by svenissimo in category Other at 25/03/2020
Description

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

 

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 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));
        }
    }
}
Comments
5