I have a pretty straightforward strategy...  If the Close of the stock is above its KAMA and the Nasdaq (.IXIC) is above its KAMA, then buy at a limit and sell at the open the next day.
When I look back on the trades during backtesting, I am seeing trades execute on days when the .IXIC is below its KAMA.
And yet...  If I comment out both KAMA filters, I get 3,472 trades over the last year.  If I add the filter for the Close of the stock being above its KAMA value, trades drop down to 3,104.  And if I include the IXIC KAMA filter, it drops down to 2,976 trades.  
So the IXIC filter is doing *something*, but it isn't actually preventing the system from trading on days when IXIC is below its KAMA.
What am I doing wrong here?
CODE:
Please log in to see this code.