Calculate slope, p value, and r^2 value given some data
(self, data)
| 25 | self.HISTORY_TO_USE = history_to_use |
| 26 | |
| 27 | def calculate_slope(self, data): |
| 28 | """ |
| 29 | Calculate slope, p value, and r^2 value given some data |
| 30 | """ |
| 31 | x_axis = np.arange(len(data)) |
| 32 | regression_model = linregress(x_axis, data) |
| 33 | slope, r_value, p_value = round(regression_model.slope, 3), round(abs(regression_model.rvalue), 3), round(regression_model.pvalue, 4) |
| 34 | return slope, r_value, p_value |
| 35 | |
| 36 | def get_technical_indicators(self, price_data): |
| 37 | """ |
no outgoing calls
no test coverage detected