MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / calculate_log_returns

Function calculate_log_returns

loggers/analysis.py:24–25  ·  view source on GitHub ↗
(series, step=50)

Source from the content-addressed store, hash-verified

22 return [s for s in string_list if s in main_string]
23
24def calculate_log_returns(series, step=50):
25 return np.log(series / series.shift(step)).dropna().reset_index(drop=True)
26
27def optimized_rolling_diff(series, window_size):
28 return series.rolling(window=window_size).apply(lambda x: x.iloc[-1] - x.iloc[0], raw=False).shift(-(window_size - 1))

Callers 1

process_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected