Why use return only to construct event from financial time series is a bad idea

Published: δΊ” 24 ε››ζœˆ 2020
By jlz

In financial.

It is a bad idea to construct events from financial time series by return. The following is an example:

# au

i = 30
delta = tmpdf.close.shift(-i) - tmpdf.close
delta = delta[market_open_and_close_time_range.not_include_these(delta.index)]
delta = delta[np.abs(delta)>0.2]
ts = pd.Series(list(delta.index))
x = group_ts_by_gap(ts, pd.to_timedelta('10 seconds'))
x.index = delta.index
for i,g in delta.groupby(x):
    print(i)
    print(g)

_df = get_df_near_timestamp(tmpdf, pd.to_datetime('2020-03-09 10:57:17'))
price_volume_plot(_df)
html_df(_df)

Sometimes, it is just ONE order that drive up or down price, it is impossible to predict such events(at least by my current knowledge). So constructing such events makes no sense since no model could predict these events.

It may be better to construct events from trending scan results. Filter out those trend with long enough time(like more than 30 seconds), and construct events at the beginning period.

Hope I can build a model successfully someday. I don't have much time to waste now.

links

social