The FC suffix after a function name normally implies a fast calculation algorithm is being used. However, in the case of LinearReg and LinearRegFC, both are using the same algorithm, which has not been optimized for execution speed.
LinearRegFC contains the following code:
It is possible to optimize this section, replacing the loop and summation code with a simple addition/subtraction forumula, as shown in the optimized code:
Fig. 2. Improved LinRegFast Function Code.
Initially posted version: 11/03/12
Latest Update: 11/03/12
*.ELD files are compiled for TS 9.0
All ELD and code text files packaged here:
Users of earlier versions fo TradeStation may compile the code
from the text files included in the above *.zip file.
The code may be visualized here: