eppenga / Sunflow-Cryptobot

Trailing Buy and Sell Cryptobot for Bybit in real time via Websockets. Includes technical analysis, multiple intervals, order combination, grids, automatic reconnect and error handling.
MIT License
9 stars 3 forks source link

After placing a buy order, order cannot be found. #1

Closed cyberjunky closed 6 months ago

cyberjunky commented 6 months ago

Trying out your code -with almost default config- (apart from API keys of course)

I get below error when a buy is done (which succeeded on the exchange) Could this be a Non-UTA compatibility issue (i'm still on old Bybit account format). Or maybe a timing issue (trying to fetch faster than created?) Still trying to understand where what is done in trying to find the cause.


2024-04-21 14:29:15.69 | OPUSDT: Sunflow: handle_kline: Buy matrix (3m): TA-1 1m: 0.5 (Buy), TA-2 3m: -0.5 (Buy), Spread: 0% (Buy), BUY!

2024-04-21 14:29:15.69 | OPUSDT: Orders: get_info: session: get_instruments_info

2024-04-21 14:29:15.95 | OPUSDT: Preload: get_info: Instrument info loaded!

2024-04-21 14:29:15.95 | OPUSDT: Orders: buy: *** BUY BUY BUY! ***

2024-04-21 14:29:15.95 | OPUSDT: Orders: buy: session: place_order

2024-04-21 14:29:16.23 | OPUSDT: Orders: history: session: get_open_orders

2024-04-21 14:29:16.46 | OPUSDT: Defs: log_error: Displaying exception:

2024-04-21 14:29:16.46 | OPUSDT: Order does not exist. (ErrCode: 170213) (ErrTime: 14:29:16).
Request → GET https://api.bybit.com/v5/order/realtime: category=spot&orderId=1669112842430830841.

2024-04-21 14:29:16.46 | OPUSDT: Defs: error: *** Termination program, error to severe! ***

2024-04-21 14:29:16.46 | OPUSDT: Order does not exist. (ErrCode: 170213) (ErrTime: 14:29:16).
Request → GET https://api.bybit.com/v5/order/realtime: category=spot&orderId=1669112842430830841.```
cyberjunky commented 6 months ago

I may have found the answer: https://bybit-exchange.github.io/docs/v5/order/open-order


INFO
Classic account spot can return open orders only
cyberjunky commented 6 months ago

Also these will fail... hmm, maybe I should convert, it will be forced later on anyway.

cumExecValue    string  Cumulative executed order value. Classic spot is not supported
cumExecFee  string  Cumulative executed trading fee. Classic spot is not supported
eppenga commented 6 months ago

My first comment! Thank you @cyberjunky ! I will add it to the documentation of Sunflow.