Problem Description:
File Issue:
c:/TradingBot/main.py
Output: Results: 0 trades, total P&L ₹0, Win Rate 0%
Log Issue:
ERROR:root:API error for 29025: 400 Client Error: for url: https://api.dhan.co/v2/charts/intraday
WARNING:root:No or insufficient data for INDOFARM.NS: 0 candles
INFO:root:Telegram sent: Supertrend Backtest 2025-10-20: 0 trades, P&L \u20b90, Win 0%
Postman Error:
Payload:
{
“dhanClientId”: “[REDACTED]”,
“securityId”: “10993”,
“exchangeSegment”: “NSE_EQ”,
“instrumentType”: “EQ”,
“fromDate”: “2025-10-20T09:15:00Z”,
“toDate”: “2025-10-20T15:30:00Z”,
“timeFrame”: “FIVE_MINUTE”
}
Response:
{
“errorType”: “Input_Exception”,
“errorCode”: “DH-905”,
“errorMessage”: “Missing required fields, bad values for parameters etc.”
}
Request:
The /v2/fundlimit endpoint returns a successful response, confirming that the API authentication (via access-token and client-id) is functional. But the /v2/charts/intraday endpoint consistently fails with the DH-905 error despite using security IDs sourced from the official scrip_master.csv file for NSE equity instruments. Goal is to retrieve 5 minute historical data for backtesting purposes. Please provide the precise payload structure and any additional required parameters or headers needed to resolve this error, including verifying the correct format for securityId (e.g., string vs. integer), timeFrame (e.g., “FIVE_MINUTE” vs. alternatives), and fromDate/toDate (e.g., ISO 8601 with timezone). Any guidance on potential subscription limitations or endpoint versioning that might affect historical data access would also be appreciated. @Hardik @Shubham_Singh @Trishul_Devadiga @Shrutika_Poojari @Prithvi