enarjord / passivbot Goto Github PK
View Code? Open in Web Editor NEWTrading bot running on Binance, Bybit, Bitget, OKX, BingX, and Hyperliquid
Home Page: https://www.passivbot.com
License: Other
Trading bot running on Binance, Bybit, Bitget, OKX, BingX, and Hyperliquid
Home Page: https://www.passivbot.com
License: Other
Hi.
I'm trying the code for the grid_style, and get an error running it, as it asks the ddown_factor in settings. I"ve created it with the value of 10, and the code works.
My doubt is if the ddown_factor is really needed for the grid style version, as the code seems to work different than the doubler version.
I had some trouble when pulling latest after a few weeks, I couldn't get Ray. Turns out it is not available on python 3.9. The readme suggests >= 3.8 is fine, but I think it should be specifically 3.8 for this reason. Thanks
Hi, thanks for the bot. I'm trying it on binance.
It is possible to implement a stop loss function, based on a % from the actual position price?
I've made a simple bot using ccxt, and could be able to implement the stop loss on it, but the code for the passivbot is way more sophisticaed, I cannot edit it properly.
Hello
Sorry to ask a stupid question but I'm new to Binance and Bot!
Is it possible to test your two bot in "test mode" or on a very limited part of the portfolio?
Thank you and happy new year ! :-)
Hi Sorry for the simple question,
I try to change my ticker to other such as, BTCUSDT, and BNBUSDT but it just stuck at fetching.
exchange binance
symbol BNBUSDT
starting_balance 100
start_date 2021-06-23
end_date 2021-06-30
latency_simulation_ms 750
linear perpetual
2021-07-13T10:28:52 fetched ticks BNBUSDT 1 2020-02-10T15:01:27.404000
2021-07-13T10:28:52 Fetching BNBUSDT 2021-06
and nothing happen on after that.
Should be simple question, but its failing on me.
Anyone have idea ?
Thank you
What are the limits for the parameters in the file configs/optimize/default.hjson?
{
leverage: [1, 16]
n_close_orders: [16, 16]
qty_pct: [0.0, 0.5]
ddown_factor: [0.0, 3.5]
pos_margin_grid_coeff: [-600.0, 600.0]
volatility_grid_coeff: [-1200.0, 1200.0]
volatility_qty_coeff: [-1200.0, 1200.0]
grid_spacing: [0.0002, 0.02]
markup_range: [0.0, 0.02]
min_markup: [0.0005, 0.012]
ema_span: [6000.0, 300000.0]
ema_spread: [0.0, 0.03]
stop_loss_liq_diff: [0.2, 0.7]
stop_loss_pos_pct: [0.01, 0.2]
entry_liq_diff_thr: [0.0, 0.0]
}
It would be nice to have a button to update the code when the new version comes out in the main branch.
ask maybe taken
error cancelling orders b [{'order_id': 4743681398, 'symbol': 'XMRUSDT', 'price': 137.88, 'qty': 0.006, 'type': 'limit', 'side': 'sell', 'timestamp': 1611641554675}, {'order_id': 4743681394, 'symbol': 'XMRUSDT', 'price': 137.77, 'qty': 0.006, 'type': 'limit', 'side': 'sell', 'timestamp': 1611641554670}, {'order_id': 4743681397, 'symbol': 'XMRUSDT', 'price': 137.98, 'qty': 0.006, 'type': 'limit', 'side': 'sell', 'timestamp': 1611641554673}, {'order_id': 4743681395, 'symbol': 'XMRUSDT', 'price': 138.09, 'qty': 0.006, 'type': 'limit', 'side': 'sell', 'timestamp': 1611641554671}] binance {"code":-2011,"msg":"Unknown order sent."}
ETHUSDT shrt -0.022 @ 1314.68 exit 1313.74 ddown 1326.08 pct 0.90 liq_diff 2.403 last 1314.96 error cancelling orders b [{'order_id': 8389765491632963844, 'symbol': 'ETHUSDT', 'price': 1344.6, 'qty': 3.952, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568457410}, {'order_id': 8389765491632963845, 'symbol': 'ETHUSDT', 'price': 1360.0, 'qty': 1.545, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568457411}, {'order_id': 8389765491632959730, 'symbol': 'ETHUSDT', 'price': 1370.46, 'qty': 0.604, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568452475}, {'order_id': 8389765491632959718, 'symbol': 'ETHUSDT', 'price': 1378.22, 'qty': 0.236, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568452453}] binance {"code":-2011,"msg":"Unknown order sent."}
2021-01-26T10:18:08 ETHUSDT shrt -0.022 @ 1314.68 exit 1313.74 ddown 1326.08 pct 0.82 liq_diff 2.400 last 1315.92 error with update position binance {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."}
ETHUSDT shrt -0.022 @ 1314.68 exit 1313.74 ddown 1326.08 pct 0.90 liq_diff 2.403 last 1314.96 error cancelling orders b [{'order_id': 8389765491632963844, 'symbol': 'ETHUSDT', 'price': 1344.6, 'qty': 3.952, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568457410}, {'order_id': 8389765491632963845, 'symbol': 'ETHUSDT', 'price': 1360.0, 'qty': 1.545, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568457411}, {'order_id': 8389765491632959730, 'symbol': 'ETHUSDT', 'price': 1370.46, 'qty': 0.604, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568452475}, {'order_id': 8389765491632959718, 'symbol': 'ETHUSDT', 'price': 1378.22, 'qty': 0.236, 'type': 'limit', 'side': 'buy', 'timestamp': 1611568452453}] binance {"code":-2011,"msg":"Unknown order sent."}
2021-01-26T10:18:08 ETHUSDT shrt -0.022 @ 1314.68 exit 1313.74 ddown 1326.08 pct 0.82 liq_diff 2.400 last 1315.92 error with update position binance {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."}
set:
"ddown_factor": 0.558,
"default_qty": -0.4268,
"dynamic_grid": true,
"grid_coefficient": 5.12,
"grid_spacing": 0.00787,
"grid_step": 0.0,
"leverage": 83,
"liq_diff_threshold": 0.0423,
"balance": -1,
"market_stop_loss": true,
"min_markup": 0.00071,
"max_markup": 0.01216,
"n_close_orders": 25,
"n_entry_orders": 8,
"stop_loss_pos_reduction": 0.84,
"symbol": "ETHUSDT"
Starting binance_01 TXZUSDT configs/live/binance_xtzustd.json futures
Traceback (most recent call last):
File "passivbot.py", line 11, in
from procedures import load_live_config, make_get_filepath, load_exchange_key_secret, print_, add_argparse_args
File "/root/passivbot/procedures.py", line 4, in
import hjson
ModuleNotFoundError: No module named 'hjson'
bot stopped, attempting restart in 0 seconds
Please help me. Thank!
How to make a more risky strategy? With a lot of leverage? And with a large grid of orders?
On the master
branch, for bybit i needed to cast some data:
diff --git a/passivbot.py b/passivbot.py
index 06b33c4..147353b 100644
--- a/passivbot.py
+++ b/passivbot.py
@@ -766,10 +766,11 @@ class Bot:
def init_tick_ema(self, ticks: [dict]):
print_(['initiating tick ema...'])
ema_span = self.indicator_settings['tick_ema']['span']
- ema = ticks[0]['price']
+ ema = float(ticks[0]['price'])
alpha = 2 / (ema_span + 1)
+
for t in ticks:
- ema = ema * (1 - alpha) + t['price'] * alpha
+ ema = ema * (1 - alpha) + float(t['price']) * alpha
self.indicators['tick_ema'] = ema
self.indicator_settings['tick_ema']['alpha'] = alpha
self.indicator_settings['tick_ema']['alpha_'] = 1 - alpha
After this few fix, I got this error
error` starting websocket bybit {"ret_code":34015,"ret_msg":"cross_margin : cannot set leverage which is same to the old leverage","ext_code":"","ext_info":"","result":null,"time_now":"1616775733.292937","rate_limit_status":74,"rate_limit_reset_ms":1616775733291,"rate_limit":75}
Starting binance_01 XTZUSDT configs/test/binance_xtzustd.json futures
not using numba
There was an error starting the bot: 'min_span'
Passivbot was stopped succesfully
bot stopped successfully
failed to initialize telegram
Traceback (most recent call last):
File "passivbot.py", line 641, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "passivbot.py", line 636, in main
signal.signal(signal.SIGINT, telegram.exit)
AttributeError: 'NoneType' object has no attribute 'exit'
I would like to leave a suggestion: an option to translate the text of the Telegram buttons, according to the language file.
Thanks!
fetching market_specific_settings...
Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()
All git commands will error until this is rectified.
ching ticks... 256258 of 256618 debug len ticks, prices deque, ema_span 257303 256618 256618 The lock file has been removed succesfully Task exception was never retrieved future: <Task finished name='Task-317' coro=<Bot.decide() done, defined at c:\Users\Zver\PycharmProjects\passivbot\passivbot.py:417> exception=KeyError('long')> Traceback (most recent call last): File "c:\Users\Zver\PycharmProjects\passivbot\passivbot.py", line 438, in decide await self.update_output_information() File "c:\Users\Zver\PycharmProjects\passivbot\passivbot.py", line 443, in update_output_information line += f"l {self.position['long']['size']} @ " KeyError: 'long' Task exception was never retrieved future: <Task finished name='Task-318' coro=<Bot.decide() done, defined at c:\Users\Zver\PycharmProjects\passivbot\passivbot.py:417> exception=KeyError('long')> Traceback (most recent call last): File "c:\Users\Zver\PycharmProjects\passivbot\passivbot.py", line 438, in decide await self.update_output_information() File "c:\Users\Zver\PycharmProjects\passivbot\passivbot.py", line 443, in update_output_information line += f"l {self.position['long']['size']} @ " KeyError: 'long' Task exception was never retrieved future: <Task finished name='Task-321' coro=<Bot.decide() done, defined at c:\Users\Zver\PycharmProjects\passivbot\passivbot.py:417> exception=KeyError('long')> Traceback (most recent call last): File "c:\Users\Zver\PycharmProjects\passivbot\passivbot.py", line 438, in decide await self.update_output_information() File "c:\Users\Zver\PycharmProjects\passivbot\passivbot.py", line 443, in update_output_information line += f"l {self.position['long']['size']} @ " KeyError: 'long'
# entry orders
new_long_entries = [item for item in fills if item not in self.fills and
item['side'] == 'buy' and item['position_side'] == 'long']
if len(new_long_entries) > 0:
if self.telegram is not None:
qty_sum = sum(fill['qty'] for fill in new_long_entries)
cost = sum(fill['qty'] / fill['price'] if self.inverse else fill['qty'] * fill['price']
for fill in new_long_entries)
# volume weighted average price
vwap = qty_sum / cost if self.inverse else cost / qty_sum
fee = sum([fill['fee_paid'] for fill in new_long_closes])
total_size = self.position['shrt']['size'] >>>> total_size = self.position['long']['size']
self.telegram.notify_entry_order_filled(position_side='long', qty=qty_sum, fee=fee, price=vwap, total_size=total_size)
and also
async def check_long_fills(self, fills):
#closing orders
new_long_closes = [item for item in fills if item not in self.fills and
item['side'] == 'sell' and item['position_side'] == 'long']
if len(new_long_closes) > 0:
realized_pnl_long = sum(fill['realized_pnl'] for fill in new_long_closes)
if self.telegram is not None:
qty_sum = sum([fill['qty'] for fill in new_long_closes])
cost = sum(fill['qty'] / fill['price'] if self.inverse else fill['qty'] * fill['price']
for fill in new_long_closes)
# volume weighted average price
vwap = qty_sum / cost if self.inverse else cost / qty_sum
fee = sum([fill['fee_paid'] for fill in new_long_closes])
total_size = self.position['long']['size']
self.telegram.notify_close_order_filled(realized_pnl=realized_pnl_long, position_side='short', >>> realized_pnl_long, position_side='long',
qty=qty_sum, fee=fee,
wallet_balance=self.position['wallet_balance'],
remaining_size=total_size, price=vwap)
Is there any frontend for the bot. Like a gui
I've seen a lot of Connection reset by peer during backtesting while fetching historical data.(Maybe exchange is disconnecting)
The backtester(optimzer.py) then stops fetching data and starts doing iterations.
Now while start_bot.py is throwing same error but its not restarting...
2021-05-05T17:38:37 DENTUSDT long 507.0 @ 0.00987 close @ 0.009985 enter @ 0.00975 || shrt 0.0 @ 0.0 close @ 0.0 enter @ 0.009951 || last 0.009854 liq 0.0 sl trig 0.0 ema 0.00991 bal 102.1 equity 102.1 v. 0.02771823 error with update
open orders [Errno 104] Connection reset by peer
error with update position [Errno 104] Connection reset by peer
flushing update_position
2021-05-05T17:38:47 DENTUSDT long 507.0 @ 0.00987 close @ 0.009985 enter @ 0.00975 || shrt 0.0 @ 0.0 close @ 0.0 enter @ 0.009951 || last 0.009851 liq 0.0 sl trig 0.0 ema 0.00991 bal 102.1 equity 102.1 v. 0.02771377 Traceback (most re
cent call last):
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/protocol.py", line 827, in transfer_data
message = await self.read_message()
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/protocol.py", line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/protocol.py", line 971, in read_data_frame
frame = await self.read_frame(max_size)
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/protocol.py", line 1047, in read_frame
frame = await Frame.read(
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/framing.py", line 105, in read
data = await reader(2)
File "/usr/lib/python3.8/asyncio/streams.py", line 723, in readexactly
await self._wait_for_data('readexactly')
File "/usr/lib/python3.8/asyncio/streams.py", line 517, in _wait_for_data
await self._waiter
asyncio.exceptions.CancelledError
Traceback (most recent call last):
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/ext/updater.py", line 520, in _network_loop_retry
if not action_cb():
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/ext/updater.py", line 471, in polling_action_cb
updates = self.bot.get_updates(
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/bot.py", line 127, in decorator
result = func(*args, **kwargs)
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/bot.py", line 2761, in get_updates
result = self._post(
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/bot.py", line 259, in _post
return self.request.post(
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/utils/request.py", line 350, in post
result = self._request_wrapper(
File "/opt/passivbot/.env/lib/python3.8/site-packages/telegram/utils/request.py", line 259, in _request_wrapper
raise NetworkError(f'urllib3 HTTPError {error}') from error
telegram.error.NetworkError: urllib3 HTTPError HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getUpdates (Caused by NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7fa31ce5a0d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
Getting this error on the latest master v3.5.3
fetching ticks... 11977 of 12711
debug len ticks, prices deque, ema_span
12901 12711 12711
The lock file has been removed succesfully
Task exception was never retrieved
future: <Task finished name='Task-51' coro=<Bot.decide() done, defined at /opt/passivbot/passivbot.py:416> exception=UnboundLocalError("local variable 'new_long_psize' referenced before assignment")>
Traceback (most recent call last):
File "/opt/passivbot/passivbot.py", line 433, in decide
await self.cancel_and_create()
File "/opt/passivbot/passivbot.py", line 400, in cancel_and_create
self.calc_orders(),
File "/opt/passivbot/passivbot.py", line 341, in calc_orders
for tpl in iter_entries(balance, long_psize, long_pprice, shrt_psize, shrt_pprice,
File "/opt/passivbot/jitted.py", line 341, in iter_entries
bankruptcy_price = calc_bankruptcy_price(balance, new_long_psize, new_long_pprice,
UnboundLocalError: local variable 'new_long_psize' referenced before assignment
Version: 2ef6fc0
I am using the default configuration for backtesting
Summary: Restructure the project in such a way that strategy logic and order execution are separated.
The main idea of this refactor is a separation of different functionality in the project. The following aspects are part of it:
Any input is welcome!
I tried to backtest BCTUSDT.
I changed the following in the backtest.py:
elif exchange == 'bybit':
settings = {
...
'inverse': False
'symbol': 'BTCUSDT',
'margin_limit': 1000,
When i try to run the backtest it errors out with:
File "backtest.py", line 262, in backtest
liq_price = calc_liq_price(balance, pos_size, pos_price)
UnboundLocalError: local variable 'calc_liq_price' referenced before assignment
Do i need to change something else? Or what do i have to do to make it work with BTCUSDT?
It probably is a good strategy to accumulate both BTC and USDT in both tickers to hedge price risk.
Otherwise nice idea and nice bot, dude:)
Appreciate the sharing.
fetching ticks... 12066 of 12711
debug len ticks, prices deque, ema_span
13046 12711 12711
The lock file has been removed succesfully
2021-05-24T17:28:46 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.19762 liq .38905 sl trig .2305 ema .19557 bal 1060 eq 696 v. .021466
2021-05-24T17:35:06 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.19756 liq .38905 sl trig .2305 ema .19566 bal 1060 eq 695 v. .021729 flushing decide
flushing update_position
error with update position string indices must be integers
2021-05-24T17:35:35 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.19829 liq .38905 sl trig .2305 ema .19566 bal 1060 eq 695 v. .021746 flushing update_position
2021-05-24T17:43:55 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.19775 liq .38905 sl trig .2305 ema .19603 bal 1060 eq 696 v. .022715 flushing decide
flushing update_position
error with update position string indices must be integers
2021-05-24T17:52:38 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.20102 liq .38905 sl trig .2305 ema .19712 bal 1060 eq 685 v. .024106 flushing decide
flushing update_position
2021-05-24T17:52:44 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.20096 liq .38905 sl trig .2305 ema .19712 bal 1060 eq 685 v. .024095 error with update position string indices must be integers
2021-05-24T17:52:55 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.20115 liq .38905 sl trig .2305 ema .19713 bal 1060 eq 685 v. .024093 flushing update_position
2021-05-24T17:52:56 COTIUSDT l 2292.0 @ 0.24324 c@ 0.0 e@ 0.0 || s -5763.0 @ 0.15265 c@ 0.0 e@ 0.0 || last 0.20107 liq .38905 sl trig .2305 ema .19713 bal 1060 eq 685 v. .024092 error with update position string indices must be integers
2021-06-08T01:07:13 Fetching ETHUSDT 2021-06-06
Traceback (most recent call last):
File "optimize.py", line 265, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "optimize.py", line 243, in main
ticks = await downloader.get_ticks(True)
File "/root/binance/downloader.py", line 621, in get_ticks
await self.download_ticks()
File "/root/binance/downloader.py", line 466, in download_ticks
end_id = sys.maxsize if end_id == 0 else end_id - 1
NameError: name 'sys' is not defined
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fef7a722640>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fef7a6cbfa0>, 11219.746704129)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fef7a7229d0>
I think can use the archive of the Binance future for backtesting instead of downloading aggrades from Binance API, this will improve downloading many times
useful links:
https://www.binance.com/en/landing/data
https://github.com/binance/binance-public-data/
Hello.
Could you please explain a little bit about live results, if that's OK?
Actually I was wondering if market making especially on ByBit (or Bitmex) which pay a rebate is overall profitable or at least not a completely looser strategy.
Thanks
2021-06-10T00:22:03 Saving single file with 347520972 ticks to backtests\binance\ETHUSDT\caches\2020-01-01T000000_2021-06-09T000000_ticks_cache.npy ...
2021-06-10T00:22:21 Saved single file!
simple sliding window optimization
Traceback (most recent call last):
File "optimize.py", line 264, in
asyncio.run(main())
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "optimize.py", line 258, in main
analysis = backtest_tune(ticks, config)
File "optimize.py", line 191, in backtest_tune
backtest_wrap = tune.with_parameters(simple_sliding_window_wrap, ticks=ticks)
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\site-packages\ray\tune\function_runner.py", line 628, in with_parameters
parameter_registry.put(prefix + k, v)
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\site-packages\ray\tune\registry.py", line 162, in put
self.flush()
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\site-packages\ray\tune\registry.py", line 171, in flush
self.references[k] = ray.put(v)
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\site-packages\ray_private\client_mode_hook.py", line 47, in wrapper
return func(*args, **kwargs)
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\site-packages\ray\worker.py", line 1489, in put
object_ref = worker.put_object(value)
File "C:\Users\anusorbo\Anaconda3\envs\tradebot\lib\site-packages\ray\worker.py", line 277, in put_object
self.core_worker.put_serialized_object(
File "python\ray_raylet.pyx", line 994, in ray._raylet.CoreWorker.put_serialized_object
File "python\ray_raylet.pyx", line 918, in ray._raylet.CoreWorker._create_put_buffer
File "python\ray_raylet.pyx", line 145, in ray._raylet.check_status
ray.exceptions.ObjectStoreFullError: Failed to put object ffffffffffffffffffffffffffffffffffffffff0100000001000000 in object store because it is full. Object size is 8340503586 bytes.
The local object store is full of objects that are still in scope and cannot be evicted. Tip: Use the ray memory
command to list active objects in the cluster.
simple sliding window optimization
2021-07-05 10:27:00,924 WARNING function_runner.py:540 -- Function checkpointing is disabled. This may result in unexpected behavior when using checkpointing features or certain schedulers. To enable, set the train function arguments to be func(config, checkpoint_dir=None)
.
2021-07-05 10:27:01,095 WARNING tune.py:411 -- Tune detects GPUs, but no trials are using GPUs. To enable trials to use GPUs, set tune.run(resources_per_trial={'gpu': 1}...) which allows Tune to expose 1 GPU to each trial. You can also override Trainable.default_resource_request
if using the Trainable API.
Traceback (most recent call last):
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\record_writer.py", line 58, in open_file
factory = REGISTERED_FACTORIES[prefix]
KeyError: 'C'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "optimize.py", line 326, in
asyncio.run(main())
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result()
File "optimize.py", line 318, in main
analysis = backtest_tune(data, config, start_candidate)
File "optimize.py", line 253, in backtest_tune
analysis = tune.run(
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\tune.py", line 421, in run
runner.step()
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\trial_runner.py", line 389, in step
if _start_trial(next_trial):
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\trial_runner.py", line 380, in _start_trial
self._callbacks.on_trial_start(
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\callback.py", line 180, in on_trial_start
callback.on_trial_start(**info)
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\logger.py", line 397, in on_trial_start
self.log_trial_start(trial)
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\logger.py", line 605, in log_trial_start
self._trial_writer[trial] = self._summary_writer_cls(
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\writer.py", line 299, in init
self._get_file_writer()
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\writer.py", line 350, in _get_file_writer
self.file_writer = FileWriter(logdir=self.logdir,
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\writer.py", line 105, in init
self.event_writer = EventFileWriter(
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\event_file_writer.py", line 106, in init
self._ev_writer = EventsWriter(os.path.join(
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\event_file_writer.py", line 43, in init
self._py_recordio_writer = RecordWriter(self._file_name)
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\record_writer.py", line 176, in init
self._writer = open_file(path)
File "C:\Users\P-A\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorboardX\record_writer.py", line 61, in open_file
return open(path, 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\P-A\BinBot\passivbot\backtests\binance\ETHUSDT\optimize\2021-07-05T102648\search\_inner_270da77e_1_break_early_factor=0.5,c_mult=1.0,caches_dirpath=backtests\binance\ETHUSDT\caches\,config_name=name,do_long=True_2021-07-05_10-27-01\events.out.tfevents.1625477221'
i want to use bybit bot but it isn't working to me
how can i fix it?
and repoting error was this
===================================
Starting bybit_01 BTCUSDT configs/live/bybit_btcusdm21.json
not using numba
There was an error starting the bot: https:///api-testnet.bybit.com/v2/public/symbols
how can i fix it?
this is what i got
Could not find a version that satisfies the requirement websockets>=8.1 (from -r requirements.txt (line 1)) (from versions: 1.0, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 4.0.1, 5.0, 5.0.1)
No matching distribution found for websockets>=8.1 (from -r requirements.txt (line 1))
i change python version manytimes, but no progress at my side
somebody help me out pls. T_T
im using Ubuntu 18.04.5 LTS
Starting binance example_user
2021-02-19T09:51:47 settings for user example_user not found, using default settings
loaded settings:
{'balance_pct': 1.0,
'config_name': 'XRPUSDT',
'cross_mode': True,
'ddown_factor': 0.79,
'entry_qty_pct': 0.00368,
'grid_coefficient': 277.48,
'grid_spacing': 0.00187,
'indicator_settings': {'do_long': True,
'do_shrt': True,
'funding_fee_collect_mode': False,
'ohlcv_rsi': {'n_periods': 21, 'period_ms': 1800000},
'tick_ema': {'span': 59854.0}},
'leverage': 30.0,
'logging_level': 0,
'market_stop_loss': False,
'max_markup': 0.02161,
'min_close_qty_multiplier': 0.24,
'min_markup': 0.00137,
'n_close_orders': 13.0,
'n_entry_orders': 8,
'stop_loss_liq_diff': 0.0912,
'stop_loss_pos_price_diff': 0.1193,
'stop_loss_pos_reduction': 0.092,
'symbol': 'DASHUSDT'}
Traceback (most recent call last):
File "C:\Users\qwerty\Desktop\ddd\binance.py", line 367, in
asyncio.run(main())
File "C:\Users\qwerty\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\qwerty\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\qwerty\Desktop\ddd\binance.py", line 362, in main
bot = await create_bot(sys.argv[1], load_settings('binance', sys.argv[1]))
File "C:\Users\qwerty\Desktop\ddd\binance.py", line 117, in create_bot
await bot._init()
File "C:\Users\qwerty\Desktop\ddd\binance.py", line 132, in _init
exchange_info, leverage_bracket = await asyncio.gather(
File "C:\Users\qwerty\Desktop\ddd\venv\lib\site-packages\ccxt\async_support\binance.py", line 2565, in request
response = await self.fetch2(path, api, method, params, headers, body)
File "C:\Users\qwerty\Desktop\ddd\venv\lib\site-packages\ccxt\async_support\base\exchange.py", line 94, in fetch2
request = self.sign(path, api, method, params, headers, body)
File "C:\Users\qwerty\Desktop\ddd\venv\lib\site-packages\ccxt\async_support\binance.py", line 2495, in sign
signature = self.hmac(self.encode(query), self.encode(self.secret))
File "C:\Users\qwerty\Desktop\ddd\venv\lib\site-packages\ccxt\base\exchange.py", line 1233, in encode
return string.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 64-66: ordinal not in range(256)
binance requires to release all resources with an explicit call to the .close() coroutine. If you are using the exchange instance with async coroutines, add exchange.close() to your code into a pla
ce when you're done with the exchange and don't need the exchange instance anymore (at the end of your async coroutine).
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x00000031D3BFD820>
bot stopped, attempting restart in 27 seconds
Traceback (most recent call last):
File "~passivbot/venv/lib/python3.8/site-packages/redis/connection.py", line 706, in send_packed_command
sendall(self._sock, item)
File "~passivbot/venv/lib/python3.8/site-packages/redis/_compat.py", line 9, in sendall
return sock.sendall(*args, **kwargs)
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "optimize.py", line 246, in <module>
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "optimize.py", line 240, in main
analysis = backtest_tune(ticks, config)
File "optimize.py", line 174, in backtest_tune
analysis = tune.run(
File "~passivbot/venv/lib/python3.8/site-packages/ray/tune/tune.py", line 306, in run
experiments[i] = Experiment(
File "~passivbot/venv/lib/python3.8/site-packages/ray/tune/experiment.py", line 149, in __init__
self._run_identifier = Experiment.register_if_needed(run)
File "~passivbot/venv/lib/python3.8/site-packages/ray/tune/experiment.py", line 294, in register_if_needed
register_trainable(name, run_object)
File "~passivbot/venv/lib/python3.8/site-packages/ray/tune/registry.py", line 71, in register_trainable
_global_registry.register(TRAINABLE_CLASS, name, trainable)
File "~passivbot/venv/lib/python3.8/site-packages/ray/tune/registry.py", line 124, in register
self.flush_values()
File "~passivbot/venv/lib/python3.8/site-packages/ray/tune/registry.py", line 146, in flush_values
_internal_kv_put(_make_key(category, key), value, overwrite=True)
File "~passivbot/venv/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 47, in wrapper
return func(*args, **kwargs)
File "~passivbot/venv/lib/python3.8/site-packages/ray/experimental/internal_kv.py", line 35, in _internal_kv_put
updated = worker.redis_client.hset(key, "value", value)
File "~passivbot/venv/lib/python3.8/site-packages/redis/client.py", line 3050, in hset
return self.execute_command('HSET', name, *items)
File "~passivbot/venv/lib/python3.8/site-packages/redis/client.py", line 900, in execute_command
conn.send_command(*args)
File "~passivbot/venv/lib/python3.8/site-packages/redis/connection.py", line 725, in send_command
self.send_packed_command(self.pack_command(*args),
File "~passivbot/venv/lib/python3.8/site-packages/redis/connection.py", line 717, in send_packed_command
raise ConnectionError("Error %s while writing to socket. %s." %
redis.exceptions.ConnectionError: Error 32 while writing to socket. Broken pipe.
I'm not very familiar with python and ray[tune] but I understand I can make a cluster of multiple nodes for that, how I can do it?
2021-05-06T23:22:22 DENTUSDT long 514.0 @ 0.009739 close @ 0.009853 enter @ 0.009641 || shrt 0.0 @ 0.0 close @ 0.0 enter @ 0.009827 || last 0.009724 liq 0.0 sl trig 0.0 ema 0.00979 bal 104.0 equity 104.0 v. 0.0204
2021-05-06T23:22:22 cancelled order DENTUSDT sell shrt 3874.0 0.011192
2021-05-06T23:22:59 DENTUSDT long 514.0 @ 0.009739 close @ 0.009853 enter @ 0.009641 || shrt 0.0 @ 0.0 close @ 0.0 enter @ 0.009827 || last 0.00969 liq 0.0 sl trig 0.0 ema 0.00979 bal 104.0 equity 104.0 v. 0.0204 Traceback (most recent call last):
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 750, in transfer_data
message = await self.read_message()
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 819, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 895, in read_data_frame
frame = await self.read_frame(max_size)
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 971, in read_frame
frame = await Frame.read(
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/framing.py", line 55, in read
data = await reader(2)
File "/usr/lib/python3.8/asyncio/streams.py", line 721, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "passivbot.py", line 621, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "passivbot.py", line 617, in main
await start_bot(bot)
File "passivbot.py", line 561, in start_bot
await bot.start_websocket()
File "/opt/passivbot/passivbot.py", line 536, in start_websocket
async for msg in ws:
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 356, in aiter
yield await self.recv()
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 421, in recv
await self.ensure_open()
File "/opt/passivbot/.env/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 726, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
On top of purging, potentially create a plugin approach to support these kind of projects.
Is it possible to use environment variables?
Hi
bot is good
but i have a question
How do I adjust the first entry quantity?
in the config file
{
"config_name": "xmrusdt_176_days_adg2.97%_liq22%",
"logging_level": 0,
"ddown_factor": 2.87266652098384,
"qty_pct": 0.4006013838132979,
"leverage": 4,
"n_close_orders": 16,
"grid_spacing": 0.0027546543109687,
"pos_margin_grid_coeff": 25.000581115260182,
"volatility_grid_coeff": 53.29623819281044,
"volatility_qty_coeff": -1049.1647569175063,
"min_markup": 0.0054855049349101,
"markup_range": 0.0046312730017832,
"do_long": true,
"do_shrt": true,
"ema_span": 11207.096105186987,
"ema_spread": 0.0068673283681542,
"min_qty": 0.05,
"stop_loss_liq_diff": 0.05,
"stop_loss_pos_pct": 0.05
}
I think "min_qty" is the first entry quantity
"min_qty": 0.05 <- I put this
turn the bot
"min_qty": Displayed as 0.01
where do i need to edit?
in the process of operating passivbot on vps I don't see the bot saying completed orders (buy, sell). i have added token and chat id full telegram in api-keys.json file. although the control command via telegram bot returns results. is the telegram_bot.py file corrupted. thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.