Simple Market Maker BFH (Binance & Bybit)

2 500 Views 6 Comments 1 month ago
  • This is a modified version of Phsai’s amazing Simple Market Maker that intended ONLY FOR BINANCE FUTURES USDT/COIN & BYBIT FUTURES USDT with HEDGE MODE ENABLED with dynamic maximum open position and slot size.

    *Attention on Bybit; if you get order rejected that could be because your spread and/or slot count is too tight. In other words for now Bybit seem does not like “ultra busy” bot.

    The default mode is already set profitable for normal market movement but it won’t survive something like covid dump on mid March ’20. For that you have to adjust either the slot spread or maximum size divider.

    1. Bot switch.
    Allowing you to stop the bot creating new long/short order and stop the bot when has no position. Make sure you ticked Allow Long or/and Short before you start the bot or don’t ticked and start the bot if you want to check the calculated max open and slot size.

    2. Budgeting & Dynamic Maximum Open Position
    The only thing that will avoid you from liquidation is risk management by doing budgeting. Decide how much you want to allocate for trading (single or multiple bots) and how much from that trading budget you allocate for opening positions.
    Don’t get greedy, unused balance in your futures wallet actually is being used as your buffer, it is your defense that silently keeping your position away from liquidation price.

    3. Dynamic Slot Size
    So you have the maximum open position position activated then you should have this mode activated also to give you the total freedom from adjusting the bot. Dynamic Slot Size will calculate the slot size by dividing the maximum open position (either dynamic calculated or manually) with Max Slot Divider.

    4. Size Reduction Counter & Size Exposure Chart
    Giving you information about how many times your bot is oversized and how much the open position at any moment to check how far is it from liquidation or even if it’s liquidated or not (combine this with liquidation calculator in Binance Futures page). The slot exposure is one of Kobalt’s ultilities.

    This bot and its dynamic settings will allow you to have more family time because bot will automatically calculate your budget and slot size with price movement. No more going back to bot just to adjust just because price changing.


    Please consider donating to support our work!
    — Phsai BTC: 3FRx1EkG4T4izrkaS34xeZHJFK4kQefHKf
    — Smokyho BTC: 35KY1GPFtxKoJ6Bzri6sLYQPcmGZhHfRac

    Update 1

    Budget Balance: How much from wallet balance allocated for this bot. Could be all of your wallet or a portion of it.
    Working Balance: Position cost (margin allocated to position) – PNL.

    Example 1:
    Position cost: $17.81
    PNL: -$90.67
    Working Balance = 17.81 – (-90.67) = $108.48

    Example 2:
    Position cost: $17.81
    PNL: $9.23
    Working Balance = 17.81 – 9.23 = $8.58

    1. Balance Monitor Fix
    Changing the ratio from working balance : available balance to working balance : budget balance.
    This will simulate how close is the position(s) to liquidation based on budget balance.

    2. Exposure Chart + Balance Monitor Chart
    Additional charts in backtest result to see the movement of positions and working balance

    3. Back test Settings
    Deactivate on Over Budget: Deactivate bot either live or backtest when working balance > budget balance.
    Deactivate on Over Size: Deactivate bot either live or in backtest when position size > max open position a.k.a. oversize.

    Update 2

    1. Bybit Compatibility
    Bot will detect if the market Binance or Bybit and will adjust the budget calculation to match their “style”. Information will be shown in log.

    2. Back test Profit Compounding
    Adding option to compound profit and use it for trade when in back test to give you more “realistic” result on the bot performance.

    • This topic was modified 1 month, 1 week ago by smokyho. Reason: description fix
    • This topic was modified 1 month, 1 week ago by smokyho. Reason: changing default slotBudget to 377
    • This topic was modified 1 month, 1 week ago by smokyho. Reason: Changing, Log, description & default value
    • This topic was modified 1 month ago by smokyho. Reason: Update 1 2021-01-26
    • This topic was modified 1 month ago by smokyho. Reason: balance ratio small fix
    • This topic was modified 3 weeks, 3 days ago by smokyho. Reason: Bybit Compatibility, Back test Profit Compounding
    • This topic was modified 3 weeks, 2 days ago by smokyho. Reason: Description edit
    • This topic was modified 3 weeks ago by smokyho. Reason: small fix on wallet balance
    HaasScript Code
    Sign in or Register to view
    • #1861

      What parameters do you use or recommend?

    • #1864

      Each coin will need different parameters because they “behave” differently. The default one was tested for ETH and LTC (i think) and some alts that i don’t remember exactly.
      If you want a “safe for all” parameters try;
      Slot count: 1
      Slot Spread: 1.236
      Divider: 610
      Profit: 0.236

      Backtest it on several coins for at least 4 weeks.

    • #1868

      hey, what time frame was this backtest?
      and why does it say losing positions 0 but further down winratio is about 28%?

      • #1872

        1h and I don’t know about how that win ratio is calculated. it is that is “there” by default is haasscript

      • #1873

        Any chance we could talk via email?


      • #1877

        Find me in Haasonline’s discord smokyho#0662

Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free