GetStockScore
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Worksheet user-defined function (UDF) that returns a stock score given three arrays of stock metric data. (See the comments in the source code for more information about the calculations performed.) The given arrays correspond to MACD, RSI, and ADX metrics respectively, and must be the same size.
LPXLOPER12 GetStockScore(FP12* pxmacd, FP12* pxrsi, FP12* pxadx);
LPXLOPER GetStockScoreOld(FP* pxmacd, FP* pxrsi, FP* pxadx);
Parameters
pxmacd
A pointer to an FP12 structure (GetStockScore) or an FP structure (GetStockScoreOld) with all the MACD scores.
pxrsi
A pointer to an FP12 structure (GetStockScore) or an FP structure (GetStockScoreOld) with all the RSI scores.
pxadx
A pointer to an FP12 structure (GetStockScore) or an FP structure (GetStockScoreOld) with all the ADX scores.
Property Value/Return Value
Returns the stock score as an integer between 1 and 10 inclusive (xltypeInt) or #NUM! if an error occurred.
Remarks
The XLL registers GetStockScore if loaded by Microsoft Office Excel 2007, and GetStockScoreOld if loaded in an earlier version. Both functions are exported to the worksheet as GetStockScore. Both functions call ComputeStockScore, which then calls the Stock Service proxy layer, which then accesses either the Web service or the internal data, depending on the configuration.
GetStockScore and GetStockScoreOld are registered as non-volatile. In Excel 2007, GetStockScore is registered as thread safe.
Example
See \SAMPLES\STOCK\STOCK.CPP for the code for these functions.