Skip to content

add more functionality to BasePolicy #1506

@wakamex

Description

@wakamex

by doing so, we can make it easier for the writer of a policy, hiding some low-level mechanisms from them, while retaining full functionality.

we could have trading functions in BasePolicy that match our existing signature:
close_short_trade(reduce_short_amount, maturity_time, slippage_tolerance, base_fee_multiple, priority_fee_multiple, gas_limit)

so the policy just calls self.close_short_trade(...) and doesn't care about the implementation, passing in overrides if they want, if not the defaults are used.
those can just append the trade to an internal ._action_list which is retrieved by the simulation instead of being returned by the policy's action(...) function.
or action() could exist in BasePolicy and return action_list as it currently does, while calling another function left to be implemented by the user which actually populates the action list (trade_if_you_want_to()?).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions