Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Implement trade buffer with a sensible default #2

Open
atkinson opened this issue Nov 3, 2021 · 0 comments
Open

Implement trade buffer with a sensible default #2

atkinson opened this issue Nov 3, 2021 · 0 comments

Comments

@atkinson
Copy link
Owner

atkinson commented Nov 3, 2021

A trade buffer prevents you from sending an order to the market if it only makes a minor change to the position.

e.g. if we have a position of 0.1 ETH and the algorithm says, make it 0.1001 ETH, we probably want to leave the position as is, avoiding trading fees.

pseudocode:

current_position = self.get_position(market)
delta = current_position - units
if abs(delta) > (trade_buffer * abs(current_position)):
    if delta < 0:
        self._place_order(market, side.SHORT, delta)
    else:
        self._place_order(market, side.LONG, delta)

trade buffer needs to originate in the strategy (e.g. yolo), and shouldn't really thread all of the way through to execution for implementation.

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

No branches or pull requests

1 participant