ryu878 / bybit_scalp_bot_v2

Simple bybit scalp bot v2 (with binance data to check moving averages)
https://aadresearch.xyz
GNU General Public License v3.0
48 stars 18 forks source link

NameError: name 'sell_position_size' is not defined #4

Closed lexciobotariu closed 1 year ago

lexciobotariu commented 1 year ago

Hi there,

I'm getting this error when I run the bot

Traceback (most recent call last): File "/Users/lexciobotariu/Downloads/bybit_scalp_bot_v2-main/bot.py", line 457, in <module> print('│ Sell Position Size:',sell_position_size) NameError: name 'sell_position_size' is not defined

How can I solve it?

ryu878 commented 1 year ago

Please try to place any limit order on that asset on bybit manually. When remove it. And try again. That is known issue, I'll fix it soon when move to v5 API.

lexciobotariu commented 1 year ago

I solved that error now I get a different one

553 exeception: Position idx not match position mode (ErrCode: 130001) (ErrTime: 17:01:30). Request → POST https://api.bybit.com/private/linear/order/create: {'api_key': '*******', 'close_on_trigger': True, 'order_type': 'Limit', 'price': 0.07734, 'qty': 55, 'recv_window': 5000, 'reduce_only': True, 'side': 'Buy', 'symbol': 'DOGEUSDT', 'time_in_force': 'GoodTillCancel', 'timestamp': 1682355689921, 'sign': '**********************************************'}.

lexciobotariu commented 1 year ago

I solved that error now I get a different one

553 exeception: Position idx not match position mode (ErrCode: 130001) (ErrTime: 17:01:30). Request → POST https://api.bybit.com/private/linear/order/create: {'api_key': '*******', 'close_on_trigger': True, 'order_type': 'Limit', 'price': 0.07734, 'qty': 55, 'recv_window': 5000, 'reduce_only': True, 'side': 'Buy', 'symbol': 'DOGEUSDT', 'time_in_force': 'GoodTillCancel', 'timestamp': 1682355689921, 'sign': '**********************************************'}.

NVM, I solved this by changing the account from one-way to hedge.

ryu878 commented 1 year ago

Change the position mode on bybit.