I developed a strategy (intraday bars), and I simply need to add a filter based on the SMA(ATR) on a DAILY basis.
I thought it was easy

In Initialize() I added:
Add(PeriodType.Day, 1);
ATRDaily = new DataSeries(this);
SMAATRDaily = new DataSeries(this);
In OnBarUpdate():
ATRDaily.Set(ATR(BarsArray[1], 14)[0]);
SMAATRDaily.Set(SMA(ATRDaily, 200)[0]);
Then, in my trading conditions:
if(my conditions
&& ATRDaily[0] > SMAATRDaily[0])
EnterLong
The system doesn't trade at all! Without my DailyATR condition it traded daily, and I can see many occasions when also my last condition was verified.
I guess something is wrong in the code, but what?
Thank you
Stefy

Comment