agent0.hyperfuzz.unit_fuzz.helpers.execute_random_trades ======================================================== .. py:module:: agent0.hyperfuzz.unit_fuzz.helpers.execute_random_trades .. autoapi-nested-parse:: Return a list of results from opening a random longs and shorts. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: agent0.hyperfuzz.unit_fuzz.helpers.execute_random_trades.execute_random_trades Module Contents --------------- .. py:function:: execute_random_trades(num_trades: int, chain: agent0.core.hyperdrive.interactive.LocalChain, rng: numpy.random.Generator, interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, advance_time: bool = False) -> list[tuple[agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, hyperdrivetypes.OpenLongEventFP | hyperdrivetypes.OpenShortEventFP]] Conduct some trades specified by the trade list. If advance time is true, the sum of all time passed between all trades will be between 0 and the position duration. :param num_trades: The number of trades to execute. :type num_trades: int :param chain: An instantiated LocalChain. :type chain: LocalChain :param rng: The numpy Generator provides access to a wide range of distributions, and stores the random state. :type rng: `Generator `_ :param interactive_hyperdrive: An instantiated InteractiveHyperdrive object. :type interactive_hyperdrive: InteractiveHyperdrive :param advance_time: If True, advance time a random amount between 0 and the position duration after each trade. Defaults to False, which follows the anvil settings. Typically this advances one block and 12 seconds between each trade. :type advance_time: bool, optional :returns: A list with an entry per trade, containing a tuple with: - the agent executing the trade - either the OpenLong or OpenShort trade event :rtype: list[tuple[InteractiveHyperdriveAgent, OpenLong | OpenShort]] .. !! processed by numpydoc !!