I have a simple indicator that plots delta:
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
.
.
AddPlot(new Stroke(Brushes.LawnGreen, 3), PlotStyle.Bar, "BarDelta");
AddLine(new Stroke(Brushes.DimGray, DashStyleHelper.Dot, 1), 0, "ZeroLine");
}
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
}
else if (State == State.DataLoaded)
{
cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0);
}
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 10 ) return;
if (BarsInProgress == 0)
{
}
else if (BarsInProgress == 1)
{
BarDelta[0] = cumulativeDelta.DeltaClose[0] - cumulativeDelta.DeltaOpen[0];
}
}
#region Properties
[Browsable(false)]
[XmlIgnore]
public Series<double> BarDelta
{
get { return Values[0]; }
}
#endregion
I am trying to read the exposed BarDelta value from another indicator:
private double ReadValue;
protected override void OnStateChange()
{
.
.
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
}
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 10 ) return;
if (IsFirstTickOfBar)
{
if (BarsInProgress == 0)
{
ReadValue = BarDeltaV1()[0];
Print ("Current Bar Index: " + CurrentBar.ToString() + " BarDelta[0]: " + ReadValue.ToString() );
}
else if (BarsInProgress == 1)
{
}
}
}
Thanks so much!

Comment