Show Spread on the chart free

by Fx4U.net in category Trend at 04/01/2023
Description

This code simply displays the current spread on the chart.

You can change its position or color.

My current unit is Points (0.1 pips).

- Visit https://ctrader.com/users/profile/55833 to see my other robots.

- Visit http://fx4u.net/robot/ to download my other robots file.

 

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;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Spread : Indicator
    {   
        public override void Calculate(int index)
        {
            Chart.DrawStaticText(" ", Math.Round(Symbol.Spread/Symbol.TickSize).ToString(), VerticalAlignment.Bottom, HorizontalAlignment.Right, Color.DarkBlue);
        }
    }
}
Comments
0