instructions and have the following inserted in my code, but the atr value keeps thowing out '0'.
private double atr;
State.SetDefaults
Calculate.OnBarClose;
State.Configure
AddDataSeries(BarsPeriodType.Day,1);
OnBarUpdate()
{
if(BarsInProgress == 0)
{
if(CurrentBars[1] >14)
atr = ATR(BarsArray[1],14)[0];
}
}
Its a 15 min strategy and I've tried putting BarRequiredToTrade to 5000 but still get the '0' for the atr variable.
Comment