Basic Algos

    LeanπŸ”—

    The goal of the lean order is to watch the opposite-inside market size and cross when that size goes below the threshold (this also implies a cross if that size goes to zero and the market trades away from you) If the market trades toward you, you can opt into several different behaviors

    ParametersπŸ”—
    • Cross Thresh - size thresh in absolute or ratio terms
    • Max Chase Ticks - max levels to pay up, in ticks

    JoinπŸ”—

    The goal of the join order is to watch the opposite-inside market and join when the market flips (that is, when the best offer becomes the best bid) and has at least threshold size.

    ParametersπŸ”—
    • Join Thresh - size thresh in absolute or ratio terms

    TopπŸ”—

    The goal of the top order is to not trade by yourself, but the intent at the time of order entry is to get filled.If the order is on the market (say current bid price) AND the quantity on that bid price is below top thresh then cancel the order else remain working.

    ParametersπŸ”—
    • Top Thresh - size thresh in absolute or ratio terms

    CoverπŸ”—

    A Cover order’s purpose is to fire a hedge order (of any type) in response to fills from it’s child order on the opposite side of the market N ticks away

    ParametersπŸ”—
    • Profit Ticks - ticks above or below fill price to place profit / cover order

    OCOπŸ”—

    An OCO order creates a relationship between a child order and a 'stop' or 'other' order such that when one of these is cancelled, both cancel, or when one is filled, the other order's size is debited in the amount of the fill.

    Composing this order with Cover simulates scalping functionality

    ParametersπŸ”—
    • Stop Ticks - ticks below or above main order to place stop / other order

    SplitterπŸ”—

    The splitter is useful for pro-rata markets where you want to vary your exposure independent of the order quantity that you want to fill. The splitter will complete when the number of fills reaches or exceeds the order quantity but it will put exposed_qty total size on the market. Splitter favors order size over queue position.

    If exposed_qty is set to 0 the splitter will continue to exist in the Order Book but will cancel all of its child orders. This makes it a useful building block for custom algos that need to implement a 'paused' state.

    ParametersπŸ”—
    • exposed_qty - The total quantity to expose on the market.
    • max_order_qty - The maximum size of a single order.

    ScratchπŸ”—

    The scratch algo is similar to Lean, but instead of watching the opposite inside market, it watches the same side market and pays up when this quantity recedes below the scratch_threshold

    ParametersπŸ”—
    • scratch_threshold - The quantity on the same side market below which to scratch
    • chase_ticks - The number of ticks through the opposite market to pay up

    ProRataπŸ”—

    The prorata algo is a special case hedging algo for pro-rata markets. Users can specify two hedge types-- normal hedge and overfill hedge, the latter is spawned when you receive more fills than your fill_limit. Further, the algo attempts to scratch when in an overfilled state AND optionally the same side size falls below stay_in_threshold

    ParametersπŸ”—
    • hedge_ticks - The amount of ticks better hedges are placed on the opposite side market as the fill
    • chase_ticks - How many ticks through the opposite market on a scratch
    • fill_limit - The limit after which the algo considers further fills to be 'overfills'
    • stay_in_threshold - A same side size threshold that enables the algo to 'stay in' even if overfilled
    • enable_scratch_on_overfill - When true, overfills are immediately scratched upon the algo exiting
    • enable_stay_in - When true, the algo will 'stay in' so long as the same side size is above stay_in_threshold, when false the algo attempts to 'get out' (and potentially scratch overfills) as soon as it reaches overfill status
    • hedge - Child order type to send for normal hedges
    • overfill_hedge - Child order type to send for overfill hedges