Description
- can be set to plot from current bar with displacement or to infinite (as default)
- custom line style
- custom thickness
- custom color
Make a Donation
- If you like my work and effort then please consider to make a kind donation thru PayPal or any Credit Card at the top right corner.
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 BidAsk : Indicator
{
[Parameter("To Infinite", DefaultValue = true)]
public bool ToInfinite { get; set; }
[Parameter(DefaultValue = 0)]
public int Displacement { get; set; }
[Output("Ask", Color = Colors.DodgerBlue, PlotType = PlotType.DiscontinuousLine)]
public IndicatorDataSeries Ask { get; set; }
[Output("Bid", Color = Colors.Red, PlotType = PlotType.DiscontinuousLine)]
public IndicatorDataSeries Bid { get; set; }
protected override void Initialize()
{
// Initialize and create nested indicators
}
public override void Calculate(int index)
{
if (!IsLastBar)
return;
Bid[index + Displacement - 1] = double.NaN;
Ask[index + Displacement - 1] = double.NaN;
for (int i = ToInfinite ? -MarketSeries.Close.Count : Displacement; i < 200; i++)
{
Ask[index + i] = Symbol.Ask;
Bid[index + i] = Symbol.Bid;
}
}
}
}
whis.gg
Joined on 31.08.2015
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: BidAsk.algo
- Rating: 4
- Installs: 2565
- Modified: 13/10/2021 09:55
Comments
is this no longer available? It wont let me click on the box to download ?? just trying to get my 2nd pc up and running with same goods as on my main pc, my cTrader is equipped with this beautiful tool already, but seems i cant download it on my 2nd pc for some reason... Any idea as to why this might be? Thanks
Ok, I got it. Very good indicator! It cleans the chart.
Actually, several weeks ago, I requested exactly this feature through the Feedback window in cAlgo. I never understood, why they made the Bid and Ask price lines stretching to infinity...
After installing,
Right click on the chart. Under viewing options: disable the default Bid Price Line & Ask Price Line. Then you can see the custom Bid and Ask Lines...
What you mean by nothing happened? Did you put it on your chart as any other custom indicator?
I installed this indicator, but nothing happened.
Is this no longer available? Also I just updated my ctrader and the copy I had of this indicator is no longer working.. Any suggestions?