Thank you @pavank
I realized it later.
Boofy
@Boofy
Best posts made by Boofy
Latest posts made by Boofy
-
RE: getCandleData() missing 1 required positional argument: 'historicDataParams'
-
RE: getCandleData() missing 1 required positional argument: 'historicDataParams'
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'
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'
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'
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.
@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"?
@rjbanna Understood Thank you.
-
What are these numbers in "nse_cm|2885"?
Can someone please explain the significance of these numbers.?