More Information about:
Link: 1) http://stockcharts.com/help/doku.php?id=chart_school:technical_indicators:force_index




Calculation:

The force of every market movement is characterized by its direction, scale and volume. If the closing price of the current bar is higher than the preceding bar, the force is positive. If the current closing price if lower than the preceding one, the force is negative. The greater the difference in prices is, the greater the force is. The greater the transaction volume is, the greater the force is.

FORCE INDEX (i) = VOLUME (i) * ((MA (ApPRICE, N, i) - MA (ApPRICE, N, i-1))

Where:

FORCE INDEX (i) - Force Index of the current bar;
VOLUME (i) - volume of the current bar;
MA (ApPRICE, N, i) - any Moving Average of the current bar for N period: Simple, Exponential, Weighted or Smoothed;
ApPRICE - applied price;
N - period of the smoothing;
MA (ApPRICE, N, i-1) - any Moving Average of the previous bar.


Source Code "FRC Force Index":

function init()
{
   FRC.createParameter("Period", 13);

   FRC.createBuffer("FRC");
   FRC.setBufferColor("FRC", "lime");
   FRC.setBufferDrawStyle("FRC", DrawStyle.LINE);

   FRC.setAutoChangeMaxMin("FRC");
   FRC.addLevel(0, "red");
}

function start()
{
   var period = FRC.parameter("Period");

   FRC.label = "FRC(" + period + ")";

   var num = Shared.numberOfQuotes();

   var bufClose = Shared.close();
   var bufMAClose = Shared.sma(period, bufClose);

   var bufFRC = new Array(num);
   for (var j = 0; j < period + 1; ++j) {
     bufFRC[j] = 0;
   }

   for (var i = period + 1; i < num; ++i) {
     var fValue =
        (bufMAClose[i] - bufMAClose[i - 1]) * Shared.volume(i);
     bufFRC[i] = fValue;
   }

   FRC.setBufferData("FRC", bufFRC);
}