feat(Data): added script to download data from binance (#224)

* feat(Data): added script to download data from binance

* feat(Data): saving unified parquet file/loading

* fix(Config): tweak the cusum filter's threshold

* fix(Dependencies): added binance_historical_data
This commit is contained in:
Mark Aron Szulyovszky
2022-02-20 12:30:53 +01:00
committed by GitHub
parent 7a443d93e4
commit c9f8ed1304
11 changed files with 85 additions and 101 deletions
-16
View File
@@ -8,19 +8,3 @@ def get_close_low_high(df: pd.DataFrame) -> tuple[pd.Series, pd.Series, pd.Serie
low = df["low"]
high = df["high"]
return close, low, high
def apply_log_if_necessary_series(series: pd.Series, name: str) -> pd.Series:
values = series.to_numpy()
no_of_unique_values = np.unique(values)
if len(no_of_unique_values) < 4:
return series
is_normal = shapiro(values).pvalue > 0.05
if not is_normal:
# print("Applying log to column: " + column)
min_value = np.min(series)
series = (series + min_value).apply(lambda x: np.log(x))
is_normal_after_log = shapiro(series).pvalue > 0.05
if not is_normal_after_log:
print("Failed to normalize column: ", name)
return series