(self, future_data)
| 178 | return volatility_five_bars, volatility_twenty_bars, volatility_all |
| 179 | |
| 180 | def calculate_future_performance(self, future_data): |
| 181 | CLOSE_PRICE_INDEX = 4 |
| 182 | price_at_alert = future_data[0][CLOSE_PRICE_INDEX] |
| 183 | prices_in_future = [item[CLOSE_PRICE_INDEX] for item in future_data[1:]] |
| 184 | prices_in_future = [item for item in prices_in_future if item != 0] |
| 185 | total_sum_percentage_change = abs(sum([self.calculate_percentage_change(price_at_alert, next_price) for next_price in prices_in_future])) |
| 186 | future_volatility = np.std(prices_in_future) |
| 187 | return total_sum_percentage_change, future_volatility |
| 188 | |
| 189 | def find_anomalies(self): |
| 190 | """ |
no test coverage detected