agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades ====================================================== .. py:module:: agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades .. autoapi-nested-parse:: Close trades in a random order. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades.permute_trade_events agent0.hyperfuzz.unit_fuzz.helpers.close_random_trades.close_trades Module Contents --------------- .. py:function:: 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. :param trade_events: A list with an entry per trade, containing a tuple with: - the agent executing the trade - either the OpenLong or OpenShort trade event :type trade_events: list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]] :param rng: The numpy Generator provides access to a wide range of distributions, and stores the random state. :type rng: `Generator `_ :returns: The trade event list in random order :rtype: list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]] .. !! processed by numpydoc !! .. py:function:: close_trades(trade_events: list[tuple[agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, hyperdrivetypes.OpenLongEventFP | hyperdrivetypes.OpenShortEventFP]]) -> None Close trades provided. :param trade_events: A list with an entry per trade, containing a tuple with: - the agent executing the trade - either the OpenLong or OpenShort trade event :type trade_events: list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]] .. !! processed by numpydoc !!