I'm trying to make a strategy able to access a delta variable in my indicator.
I added a new private variable BarDelta for it and added the following to make it accessible
public double barDelta
{
// We need to call the Update() method to ensure our exposed variable is in up-to-date.
get { Update(); return BarDelta; }
}
#endregion
This works. The variable is exposed and I tried to reference it in the strategy as follows
if (State == State.Configure)
{
VC = pjsVolumeCluster(1,10,200,true,0,0,20,70,false,fal se,true,3,1.4,100,false);
}
in onbar update
d = VC.barDelta;
Problem is, 'd' is always zero. I get no errors.
I have checked the with indicator running and the variable is certainly being set.
Does the inclusion of the code per above actually make the indicator instance run on the selected instrument, or do I have to do something else also? Adding it as an indicator to the chart proved the variable worked, but the strategy only see's zero as the value.
Hope this makes sense.
Thanks.
Comment