Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

okex error=start price not found: ETHUSDT #1054

Open
yubing744 opened this issue Jan 24, 2023 · 2 comments
Open

okex error=start price not found: ETHUSDT #1054

yubing744 opened this issue Jan 24, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@yubing744
Copy link
Contributor

yubing744 commented Jan 24, 2023

Using the okex exchange to backtest the supertrend strategy, it prompts: 'start price not found' error

bbgo.yaml

persistence:
  redis:
    host: 127.0.0.1  # The IP address or the hostname to your Redis server, 127.0.0.1 if same as BBGO  
    port: 6379  # Port to Redis server, default 6379
    db: 0  # DB number to use. You can set to another DB to avoid conflict if other applications are using Redis too.

sessions:
  okex:
    exchange: okex
    envVarPrefix: okex
    margin: false
    isolatedMargin: false
    isolatedMarginSymbol: ETHUSDT

sync:
  # since is the date you want to start sync
  since: 2020-01-01

  # if you have multiple sessions defined, but you don't want to sync all sessions, you can define a list here
  sessions:
  - okex

  # optional, if you want to insert the trades and orders from the websocket stream
  # if you're running multiple bbgo instance, you should avoid setting this on
  userDataStream:
    # if you set this, all received trades will be written into the database
    trades: true
    # if you set this, all received filled orders will be written into the database
    filledOrders: true

  # symbols is the symbol you want to sync
  # If not defined, BBGO will try to guess your symbols by your existing account balances
  symbols:
  - ETHUSDT

backtest:
  sessions: [okex]
  # for testing max draw down (MDD) at 03-12
  # see here for more details
  # https://www.investopedia.com/terms/m/maximum-drawdown-mdd.asp
  startTime: "2022-01-01"
  endTime: "2022-12-31"
  symbols:
  - ETHUSDT
  accounts:
    okex:
      makerCommission: 10  # 0.15%
      takerCommission: 15  # 0.15%
      balances:
        BTC: 0.0
        USDT: 8.0

exchangeStrategies:
- on: okex
  supertrend:
    symbol: ETHUSDT

    # interval is how long do you want to update your order price and quantity
    interval: 1m

    # ATR window used by Supertrend
    window: 220
    # ATR Multiplier for calculating super trend prices, the higher, the stronger the trends are
    supertrendMultiplier: 10

    # leverage uses the account net value to calculate the order qty
    leverage: 1.0
    # quantity sets the fixed order qty, takes precedence over Leverage
    #quantity: 0.5

    # fastDEMAWindow and slowDEMAWindow are for filtering super trend noise
    fastDEMAWindow: 28
    slowDEMAWindow: 170

    # Use linear regression as trend confirmation
    linearRegression:
      interval: 1m
      window: 18

    # TP according to ATR multiple, 0 to disable this
    TakeProfitAtrMultiplier: 0

    # Set SL price to the low of the triggering Kline
    stopLossByTriggeringK: false

    # TP/SL by reversed supertrend signal
    stopByReversedSupertrend: false

    # TP/SL by reversed DEMA signal
    stopByReversedDema: false

    # TP/SL by reversed linear regression signal
    stopByReversedLinGre: false

    # Draw pnl
    drawGraph: true
    graphPNLPath: "./pnl.png"
    graphCumPNLPath: "./cumpnl.png"

    exits:
      # roiStopLoss is the stop loss percentage of the position ROI (currently the price change)
      - roiStopLoss:
          percentage: 4.6%
      - protectiveStopLoss:
          activationRatio: 3.5%
          stopLossRatio: 2.9%
          placeStopOrder: false
      - protectiveStopLoss:
          activationRatio: 11.1%
          stopLossRatio: 9.5%
          placeStopOrder: false
      - trailingStop:
          callbackRate: 1.1%
          #activationRatio: 20%
          minProfit: 19.5%
          interval: 1m
          side: both
          closePosition: 100%

command:

bbgo backtest -v --sync --config ./bbgo.yaml

output
image

@yubing744
Copy link
Contributor Author

When debug mode is enabled, output:

image

@c9s
Copy link
Owner

c9s commented Mar 14, 2023

looks like okex changed some API response? not quiet sure

@c9s c9s added the bug Something isn't working label Mar 14, 2023
@c9s c9s changed the title [BUG] error=start price not found: ETHUSDT, okex error=start price not found: ETHUSDT, okex Mar 14, 2023
@c9s c9s changed the title error=start price not found: ETHUSDT, okex okex error=start price not found: ETHUSDT Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants