ddql_optimal_execution.agent.TWAP

class ddql_optimal_execution.agent.TWAP(initial_budget: int, horizon: int = 100)[source]

The TWAP class inherits from the Agent class. It is an agent that calculates the action based on the budget and horizon. It is used to compare the performance of the DDQL agent with the performance of a simple agent that uniformly distributes its budget over the horizon.

Parameters
  • initial_budget (int) – The initial budget, by default 100

  • horizon (int) – The horizon, by default 100

budget

The budget of the agent.

Type

int

horizon

The horizon of the agent.

Type

int

__init__(initial_budget: int, horizon: int = 100)

Methods

__init__(initial_budget[, horizon])

get_action(state)

This function returns the action to take based on the budget and horizon values.

_abc_impl = <_abc_data object>
get_action(state: ddql_optimal_execution.state._state.State) int[source]

This function returns the action to take based on the budget and horizon values.

Parameters

state (State) – The “state” parameter is an instance of the “State” class, which represents the

current state of the environment in which the agent is operating. It contains information such as the current time step, the agent’s current position, and any other relevant information about the environment. The “__get_action”

Returns

an integer value which is the result of the division of the budget attribute of the object by

the horizon attribute of the object.