Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more functionality to BasePolicy #1506

Open
wakamex opened this issue May 31, 2024 · 1 comment
Open

add more functionality to BasePolicy #1506

wakamex opened this issue May 31, 2024 · 1 comment
Assignees

Comments

@wakamex
Copy link
Contributor

wakamex commented May 31, 2024

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()?).

@dpaiton
Copy link
Member

dpaiton commented Jun 5, 2024

Related to #1289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants