tensortrade.actions.continuous_action_strategy module

class tensortrade.actions.continuous_action_strategy.ContinuousActionStrategy(instrument_symbol='BTC', max_allowed_slippage_percent=1.0, dtype=<class 'numpy.float16'>)[source]

Bases: tensortrade.actions.action_strategy.ActionStrategy

Simple continuous strategy, which calculates the trade amount as a fraction of the total balance.

__init__(instrument_symbol='BTC', max_allowed_slippage_percent=1.0, dtype=<class 'numpy.float16'>)[source]
Parameters
  • instrument_symbol (str) – The exchange symbol of the instrument being traded. Defaults to ‘BTC’.

  • max_allowed_slippage – The maximum amount above the current price the strategy will pay for an instrument. Defaults to 1.0 (i.e. 1%).

  • dtype (Union[type, str]) – A type or str corresponding to the dtype of the action_space. Defaults to np.float16.

get_trade(action)[source]

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

Parameters

action (Union[int, float, tuple]) – The action to be converted into a trade.

Return type

Trade

Returns

The trade to be executed on the exchange this timestep.