laff / technical-indicators

Technical Indicators - Plugin for Highcharts
MIT License
37 stars 19 forks source link

Update arrayAvg to account for null values #17

Open AOjen opened 8 years ago

AOjen commented 8 years ago

arrayAvg used to not account for null values when calculating the average of the arrays values. A simple example would be [null, null, 100, 50, null] . arrayAvg used to return 30. Now it returns 75.

Also, will return null if given an empty array or all value of the array are null