CryptoGnome / Bybit-Bot

Open Beta Version of Bybit Bot that I am currently working on to practice my developing skills.
55 stars 17 forks source link

Make quantity based on equity #5

Open smoochy opened 4 years ago

smoochy commented 4 years ago

Currently _marketqty is a static value which does not change.

It would be better, that _marketqty could be set as a percentage of the equity (optional).

Example: Fixed value:

# AMOUNT IN USD TO BE TRADEDED ON EACH LIQUIDATION EVENT  

market_qty = 8

Percentage value:

# AMOUNT IN USD TO BE TRADEDED ON EACH LIQUIDATION EVENT  

market_qty = 0.05%

By this it could be achieved, that not only equity increases, but also order size and hence helps to increase equity even faster.

CryptoGnome commented 4 years ago

I want to implement this however this varies so much based on leverage, depending on what you select it will vary. Any ideas on how to solve this easily?

smoochy commented 4 years ago

If you can read the leverage set on the Bybit website via API, this could be taken into the calculations.

If you can not read the leverage from the Bybit website, you could add a variable to the settings file, the user has to set. Ofc it should be the same value as set on the Bybit website.