Comments (7)
The bybit implementation of passivbot has been updated to use their API v5 via CCXT. The latest master branch works fine for me.
from passivbot.
I was so confused, because I had not made any changes other than maybe a git pull. Tried migrating from v1 manager config to v2 but without success as syncing worked but info showed stopped instances. Turned out to be just as easy as just pip install -r requirements.txt to update CCXT, lol.
Asked ChatGPT to make a script to automatically do this in the future, might be useful for other Linux-heads:
set -e
# Define your repository path
REPO_PATH="/home/aaa/bbb"
# Change to the repository directory
cd "$REPO_PATH"
# Perform a Git pull
git pull
# Activate your Python virtual environment if needed
# source /path/to/venv/bin/activate
# Install Python packages from requirements.txt
pip install -r requirements.txt
# Restart the systemd service
sudo systemctl restart your-service-name
Still haven't seen any new trades coming in, but I'm gonna close this for now since it says it's running again now.
from passivbot.
This occurred due to:
2023-10-30T23:26:52 ERROR error on minute mark float division by zero
Traceback (most recent call last):
File "/home/abc/Trading/passivbot/passivbot.py", line 1546, in on_minute_mark
await self.cancel_and_create()
File "/home/abc/Trading/passivbot/passivbot.py", line 1000, in cancel_and_create
all_orders = self.calc_orders()
File "/home/abc/Trading/passivbot/passivbot.py", line 662, in calc_orders
calc_clock_entry_long(
File "/home/abc/Trading/passivbot/njit_clock.py", line 81, in calc_clock_entry_long
wallet_exposure_long = qty_to_cost(psize_long, pprice_long, inverse, c_mult) / balance
ZeroDivisionError: float division by zero
from passivbot.
Tried assigning it a balance of $250 and over night it's the same result sadly.
2023-10-31T10:31:51 ERROR error on minute mark float division by zero
Traceback (most recent call last):
File "/home/abc/Trading/passivbot/passivbot.py", line 1546, in on_minute_mark
await self.cancel_and_create()
File "/home/abc/Trading/passivbot/passivbot.py", line 1000, in cancel_and_create
all_orders = self.calc_orders()
File "/home/abc/Trading/passivbot/passivbot.py", line 662, in calc_orders
calc_clock_entry_long(
File "/home/abc/Trading/passivbot/njit_clock.py", line 81, in calc_clock_entry_long
wallet_exposure_long = qty_to_cost(psize_long, pprice_long, inverse, c_mult) / balance
ZeroDivisionError: float division by zero
I can look into the code and try to fix it sometime in the upcoming days if no1 else knows what is wrong. Could eventually just be solved with a try: catch: but haven't investigated the code base yet.
A quick look in the file seem like balance is undefined/null/0, and that balance_long is not set, strange because my config does not include it at all, leading me to think it defaults to zero so it won't trade, which obviously causes problems in any calculations.
This leads me to def backtest_clock, is passivbot automatically backtesting?
from passivbot.
Attaching config:
version: 2
defaults:
config: "latest.json"
api_keys: /home/samd/Trading/passivbot/api-keys.json
assigned_balance: 250
market_type: "futures"
leverage: 7
long_mode: "n"
short_mode: "m"
#long_exposure: 0.99
instances:
-
user: "bybit_01"
symbols:- "DOGEUSDT"
live_config_name: "DOGE_clock.json"
live_config_path: "DOGE_clock.json"
- "DOGEUSDT"
-
user: "bybit_01"
symbols:- "MATICUSDT"
live_config_name: "MATIC_clock.json"
live_config_path: "MATIC_clock.json"
- "MATICUSDT"
from passivbot.
After a quick check of the code base, it leads me back to:
def calc_orders(self):
balance = self.position["wallet_balance"]
Meaning it likely fails in "async def cancel_and_create(self)".
The account has two active orders since the time it crashed. SOLUSDT 0/0.1 filled at price 26.606 and ADAUSDT 0/19 filled at order price 0.2478. No TP/SL set in the app. Tried both cancelling these and adding a try: ... except: all_orders = [] in cancel_and_create but same result, so this has to do with positions most likely. Strange because first off it is trying to get positions where there are none.
I know in CCXT I get positions with value zero even if there is nothing in it, so ByBit seem to return more data than we expect, and likely since passivbot works with multi exchanges, this maybe haven't popped up before. So obviously then self.position["wallet_balance"]
Very strange, because there is balance in this wallet, about $250. I suspect /passivbot/exchanges/bybit.py "async def fetch_position(self)" is the issue.
from passivbot.
Row 173, is this return not supposed to be indented once more? @enarjord
https://github.com/enarjord/passivbot/blob/master/exchanges/bybit.py
EDIT: Nvm, seem to just be duplicated code.
from passivbot.
Related Issues (20)
- error initiating market type okx GET,How to solve this problem HOT 2
- cc.close() function in finally block HOT 1
- Not working with bybit since 2023-07-11 HOT 2
- Fixed Capital Purchase Issue: Same Quantity of DOGE Bought with 100USDT and 200USDT HOT 2
- Spot trading does not work
- missing bingx exhange in forager
- error on minute mark unsupported operand type(s) for -: 'NoneType' and 'float' HOT 4
- seeing errors in ADA/USDT pair again. HOT 3
- Bybit API returns "Invalid request, please check your server timestamp or recv_window param"
- Servertime
- Request for Integration of OKX Exchange Spot Trading Functionality
- TypeError: string indices must be integers
- bybit: "retCode":10001,"retMsg":"order link id is longer than 45" HOT 1
- Binance error -5022 HOT 1
- XTB
- How to set the net proxy?
- error fetching ohlcvs for XLMUSDT HOT 3
- Error: error fetching open orders string indices must be integers HOT 2
- error fetching ohlcvs for ETHUSDT binanceusdm GET https://fapi.binance.com/fapi/v1/exchangeInfo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passivbot.