I think LinRegXY should work. You would use Close_D(21*CTR,[series]) for each series--your imported data series and your stock returns. See Regression functions and smoothed factors now available - #2 by WalterW and https://www.portfolio123.com/doc/doc_detail.jsp?factor=LinRegXY. I haven't tested this myself, so I can't swear that it'll work, but it seems like the most logical next step.