I want a ruby library (gem) that will take an array or hash of time-series stock data and will compute some financial indicators. These are money flow, williams r%, DMI/ADX, RSI, Bollinger Bands. These formulas are freely available. Each routine should be able to compute for any given day the value of the indicator for that day based on the historical number of days passed to each function. If 14 days are passed in the Array then 14 days should be used as the timeframe for the computation. Investopedia is one website with these formulas. The DMI routines, need to include ADX, DI+ and DI - So they could be graphed like they are on Etrade.
Calculation: The William's %R indicator is calculated on the following way:
%R = (( HH - Today's Close ) / ( HH - LL )) * -100
LL = Lowest Low price in Period
HH = Highest High price in Period
The typical number of periods is 14
RSI - [url removed, login to view]
ADX - [url removed, login to view]
MoneyFlow(MFI) - [url removed, login to view]
Bollinger Band should include the middle, upper and lower. [url removed, login to view]
Other areas online exist with these formulas.
If required, an Array of stock objects, this can be a hash of name value pairs.
We will make this code open source when completed.