Ad
Get_historical_klines() Missing 1 Required Positional Argument: 'start_str'
I'm trying to get historical data; however upon executing the code:
def get_data():
historical_data = client.get_historical_klines(symbol=config.SYMBOL, interval=Client.KLINE_INTERVAL_1MINUTE, limit=100, klines_type=HistoricalKlinesType.SPOT)
print(historical_data)
I get the error:
historical_data = client.get_historical_klines(symbol=config.SYMBOL, interval=Client.KLINE_INTERVAL_1MINUTE, limit=100, klines_type=HistoricalKlinesType.SPOT)
TypeError: get_historical_klines() missing 1 required positional argument: 'start_str'
What seems to be wrong? Thanks!
Ad
Answer
You have to provide how much historical data you need. This is made with a 'start_str'. For example :
'1 day ago UTC'
'1 hour ago UTC'
So you shoud use the function like that:
klines = client.get_historical_klines(SYMBOL, Client.KLINE_INTERVAL_15MINUTE , "1 day ago UTC")
Ad
source: stackoverflow.com
Related Questions
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Django, code inside <script> tag doesn't work in a template
- → React - Django webpack config with dynamic 'output'
- → GAE Python app - Does URL matter for SEO?
- → Put a Rendered Django Template in Json along with some other items
- → session disappears when request is sent from fetch
- → Python Shopify API output formatted datetime string in django template
- → Can't turn off Javascript using Selenium
- → WebDriver click() vs JavaScript click()
- → Shopify app: adding a new shipping address via webhook
- → Shopify + Python library: how to create new shipping address
- → shopify python api: how do add new assets to published theme?
- → Access 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT' with Python Shopify Module
Ad