BlndMrn / Scalperist

Scalp bot for Bybit
17 stars 8 forks source link

Exception has occurred: panic #2

Closed firthyrie closed 12 months ago

firthyrie commented 1 year ago

After adding the API key to the main.go, the script runs with an error in VS: Exception has occurred: panic "runtime error: index out of range [1] with length 1"

Stack: 3 0x000000000099ea25 in ScalperistBybit/bybit/usdt.GetPositions at C:/Program Files/Go/src/ScalperistBybit/bybit/usdt/funcs_usdt.go:332 4 0x0000000000999d56 in ScalperistBybit/bybit/usdt.MainLogic at C:/Program Files/Go/src/ScalperistBybit/bybit/usdt/funcs_usdt.go:24 5 0x00000000009a081b in main.main.func1 at C:/Users/firth/Documents/Go/src/ScalperistBybit/main.go:55

The program also crashes when built and run with CMD. Go 1.18

I noticed that if I don't specify the API key in the main.go, the program works and updates the current BTC price (screenshot 4). Maybe a recent update to the Bybit API broke the program? Can you please tell me where I need to fix the error?

Screenshots: https://drive.google.com/drive/folders/1F3Zmu5ujpXxmWzNDQrTMMgRQ_LyC5Rzz?usp=share_link

firthyrie commented 1 year ago

Information from console:

panic: runtime error: index out of range [1] with length 1

goroutine 6 [running]: ScalperistBybit/bybit/usdt.GetPositions({0xc000014b94, 0x7}, {0xaca4f3, 0x12}, {0xad2913, 0x24}, {0xacc459, 0x16}) C:/Program Files/Go/src/ScalperistBybit/bybit/usdt/funcs_usdt.go:332 +0x2e5 ScalperistBybit/bybit/usdt.MainLogic({0xc000014b94, 0x7}, 0x4000000000000000, {0xaca4f3, 0x12}, {0xad2913, 0x24}, {0xac63b2, 0x5}, {0xacc459, ...}) C:/Program Files/Go/src/ScalperistBybit/bybit/usdt/funcs_usdt.go:24 +0x156 created by main.main C:/Users/firth/Documents/Go/src/ScalperistBybit/main.go:55 +0xc85

BlndMrn commented 12 months ago

All Bybit APIs for trading are outdated. Development is no longer supported.