tensortrade.actions.action_scheme module

class tensortrade.actions.action_scheme.ActionScheme[source]

Bases: tensortrade.base.component.Component

A discrete action scheme for determining the action to take at each timestep within a trading environments.

__len__()[source]

The discrete action space produced by the action scheme.

Return type:int
actions
get_order(action, portfolio)[source]

Get the order to be executed on the exchange based on the action provided.

Parameters:
  • action (int) – The action to be converted into an order.
  • exchange – The exchange the action will be executed on.
  • portfolio (Portfolio) – The portfolio of wallets used to execute the action.
Return type:

Order

Returns:

The order to be executed on the exchange this time step.

registered_name = 'actions'
reset()[source]

An optional reset method, which will be called each time the environment is reset.

set_pairs(exchange_pairs)[source]
class tensortrade.actions.action_scheme.AddActions(left, right)[source]

Bases: tensortrade.actions.action_scheme.ActionScheme

get_order(action, portfolio)[source]

Get the order to be executed on the exchange based on the action provided.

Parameters:
  • action – The action to be converted into an order.
  • exchange – The exchange the action will be executed on.
  • portfolio – The portfolio of wallets used to execute the action.
Returns:

The order to be executed on the exchange this time step.

set_pairs(exchange_pairs)[source]