Category Other  Published on 01/06/2015

Draw Min/Max Spread

Description

FX brokers make a lot of claims about minimum and maxim spread of an instrument. But is it really reliable?

Use this indicator to display real minimum and maxim spread from moment the indicator is initialized.

I used Draw Spread by gorin (/algos/indicators/show/331) as a basis.

Note: after adding the indicator, initial spread values as set temporary (for calculation convenience) and those should be update almost immediately, so don't get scared with 1000 minimum spread value.

Please give some feedback how useful this indicator is for you.

Thank a lot...


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class DrawMinMaxSpread : Indicator
    {
        private double maxSpread = 0;
        private double minSpread = 1000;

        public override void Calculate(int index)
        {
            if (IsLastBar)
                DisplaySpreadOnChart();
        }

        private void DisplaySpreadOnChart()
        {
            var spread = Math.Round(Symbol.Spread / Symbol.PipSize, 2);
            if (spread > maxSpread)
                maxSpread = spread;
            else if (spread < minSpread)
                minSpread = spread;
            string minText = string.Format("{0}", minSpread);
            string maxText = string.Format("{0}", maxSpread);
            ChartObjects.DrawText("minmaxSpread", "\t" + "Min/Max Spread: " + minSpread + "/" + maxSpread, StaticPosition.TopCenter, Colors.LightSalmon);
        }
    }
}


CO
colga645

Joined on 01.06.2015 Blocked

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Draw MinMax Spread.algo
  • Rating: 5
  • Installs: 4097
Comments
Log in to add a comment.
96
9600302 · 9 years ago

Thanks!

Very useful indicator.

Pepperstone has a spread of  0.1/0.4  now btw.