agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades
Close trades in a random order.
Functions
|
Given a list of trade events, returns the list in random order. |
|
Close trades provided. |
Module Contents
- agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades.permute_trade_events(trade_events: list[tuple[agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, hyperdrivetypes.OpenLongEventFP | hyperdrivetypes.OpenShortEventFP]], rng: numpy.random.Generator) list[tuple[agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, hyperdrivetypes.OpenLongEventFP | hyperdrivetypes.OpenShortEventFP]]
Given a list of trade events, returns the list in random order.
- Parameters:
trade_events (list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]]) –
- A list with an entry per trade, containing a tuple with:
the agent executing the trade
either the OpenLong or OpenShort trade event
rng (Generator) – The numpy Generator provides access to a wide range of distributions, and stores the random state.
- Returns:
The trade event list in random order
- Return type:
list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]]
- agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades.close_trades(trade_events: list[tuple[agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, hyperdrivetypes.OpenLongEventFP | hyperdrivetypes.OpenShortEventFP]]) None
Close trades provided.
- Parameters:
trade_events (list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]]) –
- A list with an entry per trade, containing a tuple with:
the agent executing the trade
either the OpenLong or OpenShort trade event