c9s / bbgo

The modern cryptocurrency trading bot framework written in Go.
https://bbgo.finance
GNU Affero General Public License v3.0
1.2k stars 291 forks source link

bollmaker strategy would take profit < 0 when disable the long setting #642

Closed jessy1092 closed 2 years ago

jessy1092 commented 2 years ago

I disable the long setting, so I can sell the origin hold BTC.

The bot sell average cost = 30237.17599375

But still buy at 30526 that cause the profit <0. Maybe we should buy at < average cost ?

image

BBGO v1.32.0

My yaml config

exchangeStrategies:
- on: ftx
  bollmaker:
    symbol: BTCUSD
    interval: 1m
    amount: 30
    askSpread: 0.04%
    bidSpread: 0.1%

    minProfitSpread: 0.1%
    useTickerPrice: true

    dynamicExposurePositionScale:
      byPercentage:
        # exp means we want to use exponential scale, you can replace "exp" with "linear" for linear scale
        exp:
          # from down to up
          domain: [ -1, 1 ]
          # when in down band, holds 1.0 by maximum
          # when in up band, holds 0.05 by maximum
          range: [ 0.21, 0.0579 ]

    uptrendSkew: 0.2
    downtrendSkew: 1.5

    buyBelowNeutralSMA: true
    tradeInBand: true

    defaultBollinger:
      interval: "4h"
      window: 21
      bandWidth: 2.0

    neutralBollinger:
      interval: "5m"
      window: 21
      bandWidth: 2.0

    persistence:
      type: redis
c9s commented 2 years ago

yes, it should buy below the average cost when the it's short position.