The script that we previously added to the “My Scripts” area was as follow:
RAW:= V * (C - REF(C,1));
FI: EMA(RAW, N);
0;
Here's how this script breaks down:
o The RAW calculation line
"RAW:=" This line calculates the Force index which is conceptually known as:
Raw = (Close [current bar] - Close [previous bar]) * Volume
A name prior to the “:=”means that the script line should be given this name but should not be plotted.
"C" is short for CLOSE
"REF" is a function that retrieves a previous value - the parameters to REF are the formula data, and an index indicating how many bars back to get the data value for. In this example REF(C, 1) means get the close price from 1 bar ago.
"V" is short for VOLUME
o The FI calculation line
“FI:” This line calculates and plots the exponential moving average over N bars of the RAW force index. (Remember that the parameter ‘N’ was previously added to the parameters tab.
A name prior to the “:” means that the script line should be given this name and plotted.
o The ‘0’ line
A number without any label before it means just plot the constant value on the chart. In this case a horizontal line will be plotted at the 0 level.