Giter VIP home page Giter VIP logo

Comments (7)

enarjord avatar enarjord commented on June 23, 2024

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.

dasbts avatar dasbts commented on June 23, 2024

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.

dasbts avatar dasbts commented on June 23, 2024

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.

dasbts avatar dasbts commented on June 23, 2024

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.

dasbts avatar dasbts commented on June 23, 2024

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"
  • user: "bybit_01"
    symbols:

    • "MATICUSDT"
      live_config_name: "MATIC_clock.json"
      live_config_path: "MATIC_clock.json"

from passivbot.

dasbts avatar dasbts commented on June 23, 2024

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.

dasbts avatar dasbts commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.