this
Description
The Comparative Strength Index (CSI) is a relative strength momentum indicator. It compares the percent change of prices versus percent change of an index over a lookback period. The indicator may be used to determine cycles relative to a market or to compare recent price action between issues. The percent change of the stock over the period is divided by the percent change in the indicator over the same period. CSI is plotted as a thick, purple line. The indicator has the option of plotting two SMA's of itself in red and blue (thin lines). This indicator uses cp1, cpref1 and mmddyyref as inputs. (see EAS Standard Variables)



The View title displays the the Current Ticker, Reference Ticker and the two periods defining the average. The Titlebar Chart Code for this indicator is csi. (see EAS Titlebar Chart Codes)

Inputs
The lookback periods define the period for over which the CSI is calculated, p0 and the two SMA periods, p1 and p2.

Output Data & Plotting
If returnflag is set to "data" a (b-a+1)-row by 1-column matrix of data will be returned. The output is only valid for data points beyond the lookback period, p0, in time. The output is the value of the CSI at any given point in time.

Keep in mind that this indicator may only be valid for the mmddyyref date matrix, since the data is normally filtered to match the Current & Reference Tickers matrices with each other when working with an RS style calculation. If the input data matrix for each ticker was an exact match in length and dates then no filtering was necessary and mmddyy could be used for scaling the date. To be safe, however, any chart date scaling should occur using mmddyyref as the input to datescale.

Background Reading
Further information regarding this indicator can be found in the following resources:
MarketGuide.com Relative Strength