-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backtest.py - neatgrid - Division by zero #344
Comments
Hey try a higher start balance in your backtest config. ie. 10000 That should solve the issue :) |
That solves the issue. btw I've been debugging this for a good 4 hours now, trying to figure it out :) |
Quick catch and BAD BAD WORKAROUND the bugline 42 in backtest.py
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
**Really weird, only managed to catch this on SOLUSDT on Neat Grid.
tried refreshing tick data, didn't work.
OHCLV - same issue
different json - same issue**
different symbol - works
short disabled - works
long disabled - DOESN'T WORK
using numba
using numba
using numba
fetching market_specific_settings...
linear perpetual
exchange binance
spot False
symbol SOLUSDT
market_type futures
starting_balance 1000
start_date 2022-05-09
end_date 2022-07-09
latency_simulation_ms 1000
base_dir backtests
2022-07-11T07:08:31 Loading cached tick data from backtests\binance\SOLUSDT\caches\2022-05-09_2022-07-09_ticks_cache.npy
{'config_name': 'neat_grid_SOLUSDT_655days',
'logging_level': 0,
'long': {'auto_unstuck_ema_dist': 0,
'auto_unstuck_wallet_exposure_threshold': 0,
'backwards_tp': True,
'ema_span_0': 120.62199728529626,
'ema_span_1': 34.76100179121808,
'enabled': True,
'eprice_exp_base': 1.1618608307844618,
'eqty_exp_base': 2.7802305422341758,
'grid_span': 0.17566515453113268,
'initial_eprice_ema_dist': -0.09535081461351516,
'initial_qty_pct': 0.014571840796302686,
'markup_range': 0.009421624486160773,
'max_n_entry_orders': 8,
'min_markup': 0.002,
'n_close_orders': 9,
'wallet_exposure_limit': 0.8},
'short': {'auto_unstuck_ema_dist': 0,
'auto_unstuck_wallet_exposure_threshold': 0,
'backwards_tp': True,
'ema_span_0': 4237.55904931995,
'ema_span_1': 9054.894470988955,
'enabled': True,
'eprice_exp_base': 1.161340927050355,
'eqty_exp_base': 3,
'grid_span': 0.4209059738318962,
'initial_eprice_ema_dist': -0.03917532734094498,
'initial_qty_pct': 0.04879303398638066,
'markup_range': 0.03261166232435841,
'max_n_entry_orders': 13,
'min_markup': 0.012619198687759918,
'n_close_orders': 17,
'wallet_exposure_limit': 0.2}}
n_days 61.0
starting_balance 1000
backtesting...
Traceback (most recent call last):
File "D:\bot\psv57\backtest.py", line 219, in
asyncio.run(main())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "D:\bot\psv57\backtest.py", line 215, in main
plot_wrap(config, data)
File "D:\bot\psv57\backtest.py", line 68, in plot_wrap
fills_long, fills_short, stats = backtest(config, data, do_print=True)
File "D:\bot\psv57\backtest.py", line 47, in backtest
return backtest_neat_grid(
ZeroDivisionError: division by zero
The text was updated successfully, but these errors were encountered: