Warning! This section will be deprecated on February 1st 2025. Please move all your Indicators to the cTrader Store catalogue.
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: 1685
- Modified: 13/10/2021 09:54
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.