Is it possible to use AddToComposite variable and show in current indicator with TF < daily?

I'm a newbies and gonna create program by addtocomposite with current indicators.

I create addtocomposite for finding number gainer | loser | unchanges and show those in current chart by GfxTextOut().

I gonna work when I do in Timeframe >= day but it declare error whenever I set to timeframe < daily.

Is it possible for me to inserts those value to current chart and used in any time frame.

Could recommend me please!

Filter = 1;

global pcGainer; 
global pcUnchange; 

AddToComposite(ROC(C,1) >  0, "~UpBars","X");
AddToComposite(ROC(C,1) <  0, "~DnBars","X");
AddToComposite(ROC(C,1) == 0, "~NcBars","X");

gainer 		= LastValue(Foreign("~UpBars","C"));
unchanges	= LastValue(Foreign("~DnBars","C"));
loser		= LastValue(Foreign("~NcBars","C"));


if (gainer != 0 OR unchanges != 0 OR loser != 0) {
		mktPlayer 	= gainer + unchanges + loser;
	} else {
		mktPlayer 	= 1;
	}
	
GfxSetOverlayMode(1); 

pcGainer 	    = gainer/mktPlayer*100; 
pcUnchange 		= unchanges/mktPlayer*100;