Skip to content

Commit

Permalink
adding john's flash crash process as 'rpp' #267
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Feb 7, 2024
1 parent a1936a0 commit 2e8afc8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sharkfin/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,18 @@ def class_stat_column_to_dict(clabel):

sim_stats["ranges_zs_max"] = ranges_zscore.max()

absolute_price_change = np.absolute(
np.array(self.market.prices[1:]) - np.array(self.market.prices[:-1]))

rp_process = np.log1p(self.market.ranges) - np.log1p(absolute_price_change)

sim_stats["rpp_mean"] = mean(rp_process)
sim_stats["rpp_stdev"] = stdev(rp_process)
sim_stats["rpp_min"] = min(rp_process)
sim_stats["rpp_max"] = max(rp_process)

import pdb; pdb.set_trace()

return sim_stats


Expand Down

0 comments on commit 2e8afc8

Please sign in to comment.