In TS8.1, your two version of indicators exactly the same chart and value. But gives the wrong Average.
But if I do the following:
vars: value1 (0,data2);
value1 = cci(20) of data2;
Plot1(value1,"CCI",red);
Plot2(average(value1,10),"CCIAvg",green);
Then the Average become correct. If...