joshuaulrich / TTR

Technical analysis and other functions to construct technical trading rules with R
GNU General Public License v2.0
330 stars 103 forks source link

Standardize leading NA checks in C code #116

Open joshuaulrich opened 3 years ago

joshuaulrich commented 3 years ago

runPercentRank() would segfault when n was larger than the number of non-NA values (fixed in #112). This bug exists in other C functions (e.g. wilderSum()), but the input is checked before calling C. These checks should be done in the C code so the functions can be called directly from C.