You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've set this up in the .env file, in openalgo folder.
The API secret though, is about 5 times the length of what's shown here (is there some catch here?)
Still getting the same issue
Hello
After setup, on login page it gave options for various brokers. I am choosing Dhan. I configured environment variables using DHAN api key.
On restarting the app, getting this error. What am I missing
127.0.0.1 - - [02/May/2024 01:30:40] "GET /dashboard HTTP/1.1" 500 -
127.0.0.1 - - [02/May/2024 01:30:41] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [02/May/2024 01:32:24] "GET /setup HTTP/1.1" 302 -
127.0.0.1 - - [02/May/2024 01:32:24] "GET /auth/login HTTP/1.1" 302 -
127.0.0.1 - - [02/May/2024 01:32:24] "GET /auth/broker HTTP/1.1" 302 -
<broker_api_secret>
Funds Details: {'errorCode': 'UNAUTHORIZED', 'httpStatus': 'UNAUTHORIZED', 'internalErrorCode': 'RS-9005', 'internalErrorMessage': 'The token was expected to have 3 parts, but got 1.'}
Positionbook : {'errorCode': 'UNAUTHORIZED', 'httpStatus': 'UNAUTHORIZED', 'internalErrorCode': 'RS-9005', 'internalErrorMessage': 'The token was expected to have 3 parts, but got 1.'}
[2024-05-02 01:32:24,643] ERROR in app: Exception on /dashboard [GET]
Traceback (most recent call last):
File "C:\Users\V\AppData\Roaming\Python\Python39\site-packages\flask\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\V\AppData\Roaming\Python\Python39\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\V\AppData\Roaming\Python\Python39\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\V\AppData\Roaming\Python\Python39\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "C:\Users\V\openalgo\blueprints\dashboard.py", line 51, in dashboard
margin_data = get_margin_data_func(AUTH_TOKEN)
File "C:\Users\V\openalgo\broker\dhan\api\funds.py", line 49, in get_margin_data
total_realised, total_unrealised = sum_realised_unrealised(position_book)
File "C:\Users\V\openalgo\broker\dhan\api\funds.py", line 45, in sum_realised_unrealised
total_realised = sum(position['realizedProfit'] for position in position_book)
File "C:\Users\V\openalgo\broker\dhan\api\funds.py", line 45, in
total_realised = sum(position['realizedProfit'] for position in position_book)
TypeError: string indices must be integers
127.0.0.1 - - [02/May/2024 01:32:24] "GET /dashboard HTTP/1.1" 500 -
The text was updated successfully, but these errors were encountered: