I moved your question out of the Strategy Guide topic and into the Chart Studies topic because nothing in your question pertains to chart strategies.
When referencing higher time frames for the CCI there is only one way to get there:
input timeFrameOne = AggregationPeriod.DAY;
input length = 14;
def price = close(period = timeFrameOne) + low(period = timeFrameOne) + high(period = timeFrameOne);
def linDev = lindev(price, length);
plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
I am curious to know where you got the idea that it could be done using this method:
def CCI142 = CCI(CCIlength,(period = agg2));
That is completely invalid. Why should you know this? Because the CCI chart study takes a total of four input parameters and none of them are named "period". The input parameters used for referencing the CCI chart study are as follows:
CCI(length, over_sold, over_bought, showBreakoutSignals)
Those are the exact input parameters listed on the very top of the CCI chart study included with Thinkorswim. Notice there is nothing in there that says "period". And if you study the instructions provided by Thinkorswim you will find that secondary aggregation periods are only applied to fundamental data objects (such as open, high, low, close, etc...). They are not ever applied as an input parameter to ta built in chart study. Details here:
https://toslc.thinkorswim.com/center/reference/thinkScript/tutorials/Advanced/Chapter-11---Referencing-Secondary-Aggregation