Instrument EURUSD, 3 minutes: having an issue with an indicator called inside a strategy OnBarUpdate.
public class StratDebug : Strategy
{
protected override void Initialize()
{
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
DebugThis();
}
#region Misc
private void DebugThis()
{
int lowEndBarsAgo = ZigZag(DeviationType.Points,0.0013,true).LowBar(0,1,CurrentBar);
if (Time[0].Hour == 21 && Time[0].Minute == 3)
Print(Time[0].Date + " " + Time[0].Hour + ":" + Time[0].Minute.ToString("00") + " Print at the end of the strategy OnBarUpdate " + lowEndBarsAgo + " " + Low[lowEndBarsAgo]);
}
#endregion
}
}
where the following code has been added at the end of the ZIGZAG OnbarUpdate:
int lo = LowBar(0,1,CurrentBar);
if (Time[0].Hour == 21 && Time[0].Minute == 3)
Print(Time[0].Date + " " + Time[0].Hour + ":" + Time[0].Minute.ToString("00") + " Print at the end of the indicator OnbarUpdate " + lo + " " + Low[lo]);
8/24/2009 12:00:00 AM 21:03 Print at the end of the indicator OnbarUpdate 1 1.4286

Comment