agent0.core.test_utils.cycle_trade_policy
Pytest fixture that creates an in memory db session and creates dummy db schemas
Classes
A agent that simply cycles through all trades. |
Functions
|
Test fixture to build a policy that cycles through all trades. |
Module Contents
- class agent0.core.test_utils.cycle_trade_policy.CycleTradesPolicy(policy_config: Config)
Bases:
agent0.core.hyperdrive.policies.HyperdriveBasePolicyA agent that simply cycles through all trades.
- class Config
Bases:
agent0.core.hyperdrive.policies.HyperdriveBasePolicy.ConfigCustom config arguments for this policy.
- max_trades: int | None = None
The maximum amount of trades to make before this policy is done trading.
- counter = 0
- max_trades
- action(interface: agent0.ethpy.hyperdrive.HyperdriveReadInterface, wallet: agent0.core.hyperdrive.HyperdriveWallet) tuple[list[agent0.core.base.Trade[agent0.core.hyperdrive.HyperdriveMarketAction]], bool]
This agent simply opens all trades for a fixed amount and closes them after, one at a time
- Parameters:
interface (HyperdriveReadInterface) – The trading market.
wallet (HyperdriveWallet) – agent’s wallet
- Returns:
A tuple where the first element is a list of actions, and the second element defines if the agent is done trading
- Return type:
tuple[list[MarketAction], bool]
- agent0.core.test_utils.cycle_trade_policy.cycle_trade_policy() Type[CycleTradesPolicy]
Test fixture to build a policy that cycles through all trades.
- Returns:
A policy that cycles through all trades.
- Return type: