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

Implement trade buffer with a sensible default #2

Description

@atkinson

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions