if (iCCI(NULL, PERIOD_D1,14,PRICE_OPEN,1) > 100)
Take a look at iBarShift()
The code you have posted will retrieve the value of iCCI from the previous D1 bar. Not the previous bar of the chart timeframe (unless that also happens to be on D1).
100 is 100, regardless of what timeframe.