-
Notifications
You must be signed in to change notification settings - Fork 259
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
symbol not found #46
Comments
This is an interesting error. I am testing your code locally and it performs the backtest correctly. I'm checking if this is because of platform or python version (using 3.7 on MacOS). It could also be an error with the account quoting system under pairs outside of These types of bugs are extremely hard to identify by us, so thanks for creating an issue! |
I believe the issue is that there is no generic I have pushed a new version - |
You are a very hardworking team. You are making great progress. Thank you very much for your reply and interest. By the way, unfortunately the backtest did not work and I will continue my experiments by installing a linux. Including: ETH-USDT,1546290000,1630270800,300.0.csv in backtest.
Including: ETH-USDT,1546290000,1630270800,900.0.csv in backtest.
Including: ETH-USDT,1546290000,1630270800,1800.0.csv in backtest.
Including: ETH-USDT,1546290000,1630270800,3600.0.csv in backtest.
Including: ETH-USDT,1546290000,1630270800,14400.0.csv in backtest.
Including: ETH-USDT,1546290000,1630270800,21600.0.csv in backtest.
Including: ETH-USDT,1546290000,1630270800,86400.0.csv in backtest.
Including: ETH-USDT,1627776000.0,1630108800.0,3600.0.csv in backtest.
Initializing...
1630098000.0
Backtesting...
Progress: [----------] 0.02% Traceback (most recent call last):
File "c:\python39\lib\site-packages\blankly\exchanges\interfaces\paper_trade\backtest_controller.py", line 452, in run
raise e
File "c:\python39\lib\site-packages\blankly\exchanges\interfaces\paper_trade\backtest_controller.py", line 445, in run
self.price_events[0]['function'](self.interface.get_price(self.price_events[0]['asset_id']),
File "C:\Blankly\RSI-strategy.py", line 11, in price_event
state.interface.market_order(symbol, side='buy', funds=10)
File "c:\python39\lib\site-packages\blankly\exchanges\interfaces\paper_trade\paper_trade_interface.py", line 341, in market_order
trade_local.test_trade(symbol, side, qty, price, quote_decimals, quantity_decimals)
File "c:\python39\lib\site-packages\blankly\exchanges\interfaces\paper_trade\local_account\trade_local.py", line 87, in test_trade
raise InvalidOrder("Insufficient funds. Available:" +
blankly.utils.exceptions.InvalidOrder: Insufficient funds. Available:0.0 hold: 0 requested: 0.0749.
c:\python39\lib\site-packages\blankly\metrics\portfolio.py:29: RuntimeWarning: divide by zero encountered in double_scalars
return (end_value / start_value) ** (1 / years) - 1 |
Hi! I'm glad you like our graphical output! I believe all the output you showed is expected behavior. The insufficient funds error is caused by running out of There is a warning caused by the portfolio valuation because the timeframe is over less than a year (so its a divide by zero). I will work to remove this warning but I want to give speedy responses. If you want to continue the backtest even with errors you can toggle You can also check your cash value by doing |
Hi, I am still getting this error when I try to backtest Binance. Was the fix reverted? |
This should be patched, can you show your console output @rohsat? |
Hi Emerson, I am running through Google Colab. Running the bot.py for Binance. Codeimport blankly def price_event(price, symbol, state: blankly.StrategyState): def init(symbol, state: blankly.StrategyState): if name == "main":
|
Error:INFO: No portfolio name to load specified, defaulting to the first in the file: (another cool portfolio). This is fine if there is only one portfolio in use. Initializing...KeyError Traceback (most recent call last) 6 frames KeyError: 'USD' During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/blankly/frameworks/strategy/strategy.py in backtest(self, to, initial_values, start_date, end_date, save, settings_path, callbacks, **kwargs) /usr/local/lib/python3.7/dist-packages/blankly/exchanges/interfaces/paper_trade/backtest_controller.py in run(self) /usr/local/lib/python3.7/dist-packages/blankly/exchanges/interfaces/paper_trade/backtest_controller.py in format_account_data(self, local_time) /usr/local/lib/python3.7/dist-packages/blankly/utils/utils.py in wrapper(self, symbol) /usr/local/lib/python3.7/dist-packages/blankly/exchanges/interfaces/paper_trade/paper_trade_interface.py in get_account(self, symbol) KeyError: 'Symbol not found. This can be caused by an invalid quote currency in backtest.json.' |
I have set USDT in backtest.json. { |
Additional details - My Binance tld is .com but I have created the account from India. |
I was able to make it work by modifying "quote_account_value_in": "USDT" in utils.py. default_backtest_settings = {
"price_data": {
"assets": []
},
"settings": {
"use_price": "close",
"smooth_prices": False,
"GUI_output": True,
"show_tickers_with_zero_delta": False,
"save_initial_account_value": True,
"show_progress_during_backtest": True,
"cache_location": "./price_caches",
"continuous_caching": True,
"resample_account_value_for_metrics": "1d",
"quote_account_value_in": "USDT",
"ignore_user_exceptions": False,
"risk_free_return_rate": 0.0,
"benchmark_symbol": None
}
} |
Description
whatever I do, I can't get past the "symbol not found" error.
Standard RSI strategy
settings.json
backtest.json
Error in Pyzo Editor
Error in CMD
Platform Info
The text was updated successfully, but these errors were encountered: