namespace NinjaTrader.NinjaScript.Strategies
{
public class TrendTrading : Strategy
{
private double _DailyHigh;
protected override void OnStateChange()
{
if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Minute, 60);
AddDataSeries(BarsPeriodType.Day, 1);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 2)
{
_DailyHigh = High[0];
}
Print("High: " + _DailyHigh);
}
}
}
When I run this code in market replay mode on the 15m chart, I am getting a value of 0 for the variable _DailyHigh (The high of the most recently closed bar on the daily time frame).
I can't seem to find where I am going wrong.
Comment