protected override void Initialize() {
BarsRequired = 90;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
Add(PeriodType.Day, 1);
CalculateOnBarClose = false;
}
protected override void OnBarUpdate() {
if (BarsInProgress == 1) { return; }
if (CurrentBars[0] < 1 || CurrentBars[1] < BarsRequired) {
Print("No chart bars (" + CurrentBars[0] + ") or not enough daily bars (" + CurrentBars[1] + ")");
} else {
double ATRVal = .5 * ATR(BarsArray[1], 90)[0];
Print("50% of 90-day ATR (currentbars -> " + CurrentBars[1] + "): " + ATRVal);
}
}
What am I missing?!

Comment