Description
You know the importance of the full prices as strong supports and/or resistences, i.e. 123.40000 or 123.000 and so on
Unfortunately I always forget to check them, so sometime I find my orders blocked between a full price
So I wrote this very simple but useful indicator that draws the full prices on my graphs... and I surely remember of them!
I report also here my below comment:
[SOLVED THANKS TO [tmc.] AND I ALREADY UPLOADED THE CORRECT VERSION]
A note: the indicator interferes with the chart zoom, that wants to keep the full price line within the visible graph
But this is a "static" indicator
I mean: I put it in all my templates, so It immediately remembers me where the full prices are
Then if the full prices are within my "trading range" I keep the indicator active as a constant warning, otherwise if the full prices are long away, I remove the indicator because it becomes useless
A further note: as surely you already know, the removal of the indicator is very simple:
- right click on the chart
- select "Object List"
- press the X next to FullPrice Indy
// -------------------------------------------------------------------------------------------------
// FullPrice Indy
// powered by http://stealthForex.eu - stealthForex.it
//
// -------------------------------------------------------------------------------------------------
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = true, AutoRescale = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class FullPrice : Indicator
{
[Output("Full Price", Color = Colors.Yellow, Thickness = 1, LineStyle = LineStyle.Dots)]
public IndicatorDataSeries fullPrice { get; set; }
private int round = 0;
private double price00 = 0.0;
protected override void Initialize()
{
ChartObjects.DrawText("www", "Powered by http://stealthForex.eu - http://stealthForex.it", StaticPosition.BottomCenter);
switch (Symbol.Digits)
{
case 1:
round = 0;
break;
case 2:
round = 0;
break;
case 3:
round = 0;
break;
case 4:
round = 2;
break;
case 5:
round = 2;
break;
}
price00 = Math.Round(Symbol.Bid, round, MidpointRounding.ToEven);
}
public override void Calculate(int index)
{
fullPrice[index] = price00;
if (IsRealTime)
{
ChartObjects.DrawText("Price00", "Full price " + price00.ToString("0.00000"), index - 25, price00, (Symbol.Bid > price00 ? VerticalAlignment.Bottom : VerticalAlignment.Top));
ChartObjects.DrawText("Spread", "Spread " + (Math.Round(Symbol.Spread / Symbol.PipSize * 10) / 10).ToString("0.0"), StaticPosition.BottomRight);
}
}
}
}
gainer
Joined on 24.01.2016
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: FullPrice Indy V02.algo
- Rating: 0
- Installs: 3247
- Modified: 13/10/2021 09:54
Comments
Thanks! Very useful!
Then change the line so:
[Indicator(IsOverlay = true, AutoRescale = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
There is Indicator Attribute called AutoRescale which indicates whether the instance automatically rescales the chart or not. It's set to true by default but you can turn it off.
[Indicator(AutoRescale = false)]
A note: the indicator interferes with the chart zoom, that wants to keep the full price line within the visible graph
But this is a "static" indicator
I mean: I put it in all my templates, so It immediately remember me where the full prices are
Then if the full prices are within my "trading range" I keep the indicator active as a constant warning, otherwise if the full prices are long away, I remove the indicator because it becomes unuseful
Again GREAT thanks to tmc. and I have just uploaded the corrected version