Thank you @pavank
I realized it later.
Posts made by hisameer
-
RE: getCandleData() missing 1 required positional argument: 'historicDataParams'posted in Python SDK
-
RE: getCandleData() missing 1 required positional argument: 'historicDataParams'posted in Python SDK
THE ISSUE IS SOLVED
I needed to use the initiated object of SmartApi class.import secrets import smartapi #create object of call obj = smartapi.SmartConnect(api_key=secrets.datafeed_key) #login api call loginData = obj.generateSession(secrets.client_id,secrets.pswd) refreshToken= loginData['data']['refreshToken'] #fetch the feedtoken feedToken = obj.getfeedToken() #fetch User Profile userProfile = obj.getProfile(refreshToken) hist = { "exchange": "NSE", "symboltoken": "3045", "interval": "ONE_MINUTE", "fromdate": "2021-02-08 09:00", "todate": "2021-02-08 09:16" } try: hist_data = obj.getCandleData(hist) print(hist_data) except Exception as e: print("Historical API failed: {}".format(e))This is the code in case someone else also encountered something like this.
-
RE: getCandleData() missing 1 required positional argument: 'historicDataParams'posted in Python SDK
EDIT:
I also tried this:
try: smartapi.SmartConnect.getCandleData(historicDataParams=hist) except Exception as e: print("Historical API failed: {}".format(e))But after doing that I get this error:

-
RE: getCandleData() missing 1 required positional argument: 'historicDataParams'posted in Python SDK
Hello @pavank,
I tried logging in and then executing the same code but still the result is same.See here below:

But when I do this:
try: smartapi.SmartConnect.getCandleData(hist, hist) except Exception as e: print("Historical API failed: {}".format(e))Somehow previous error gets resolved, though that should not happen.
But after doing this I get new kind of error:
-
getCandleData() missing 1 required positional argument: 'historicDataParams'posted in Python SDK
I have been trying to use the historical data but I am encountering this issue every time.
Please tell me what mistake I am making below:import smartapi hist = { "exchange": "NSE", "symboltoken": "3045", "interval": "ONE_MINUTE", "fromdate": "2021-02-08 09:00", "todate": "2021-02-08 09:16" } try: smartapi.SmartConnect.getCandleData(hist) except Exception as e: print("Historical API failed: {}".format(e))And this is the error I am encountering:
Historical API failed: getCandleData() missing 1 required positional argument: 'historicDataParams' -
RE: Python Streaming Tick Data Problem.posted in Python SDK
@rjbanna Ohh.. that was the reason, no wonder I was not able to save data in list or anything.
-
RE: What are these numbers in "nse_cm|2885"?posted in General Discussion
@rjbanna Understood Thank you.
-
What are these numbers in "nse_cm|2885"?posted in General Discussion
Can someone please explain the significance of these numbers.?