Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -183,9 +183,7 @@ def weighted_moving_average(data, periods):
|
|
| 183 |
def hull_moving_average(data, periods):
|
| 184 |
wma_half_period = weighted_moving_average(data, int(periods / 2))
|
| 185 |
wma_full_period = weighted_moving_average(data, periods)
|
| 186 |
-
hma = weighted_moving_average(2 *
|
| 187 |
-
|
| 188 |
-
ma_half_period - wma_full_period, int(np.sqrt(periods)))
|
| 189 |
return hma
|
| 190 |
|
| 191 |
# Function to calculate Harmonic Moving Average (HMA) to avoid conflict with Hull
|
|
|
|
| 183 |
def hull_moving_average(data, periods):
|
| 184 |
wma_half_period = weighted_moving_average(data, int(periods / 2))
|
| 185 |
wma_full_period = weighted_moving_average(data, periods)
|
| 186 |
+
hma = weighted_moving_average(2 * wma_half_period - wma_full_period, int(np.sqrt(periods)))
|
|
|
|
|
|
|
| 187 |
return hma
|
| 188 |
|
| 189 |
# Function to calculate Harmonic Moving Average (HMA) to avoid conflict with Hull
|