Login Page - Create Account

Support Board


Date/Time: Wed, 30 Apr 2025 11:04:26 +0000



Post From: DTC Protocol Integration Issue - Historical Data Requests Not Being Processed

[2025-04-20 20:15:52]
colin0021 - Posts: 30
Hi,

I'm just trying to get Sierra Chart communicate with a software I have create through DTC protocol. So you say I can't access historical data. That is fine. But I do like my software to be able to initiate trades to sierra chart via DTC protocol. I've been trying python with binary/json for a week but no luck. This weekend I try C++.

But with C++ + binary I keep getting my username backward. Below is the message from sierra chart and beside username, you see "niloc" which is my name spelled backward. Please scroll down below to see my questions.

2025-04-20 16:01:24.365 | HD Server Manager | Incoming connection from IP: 127.0.0.1
2025-04-20 16:01:24.366 | HD Server Manager | Started new historical data server. Count=1
2025-04-20 16:01:24.372 | HD Server | Thread:46316 (2) | Creating socket.
2025-04-20 16:01:24.372 | HD Server | Thread:46316 (2) | New receive buffer size: 262144
2025-04-20 16:01:24.372 | HD Server | Thread:46316 (2) | Allocated send buffers: 32 of 4096 bytes.
2025-04-20 16:01:24.372 | HD Server | Unexpected DTC encoding request: 826496068 | Thread:46316
2025-04-20 16:01:24.495 | HD Server | Received login. Requesting authorization. | Username: niloc. | Thread:46316
2025-04-20 16:01:24.495 | HD Server | Login rejected: Logon rejected due to invalid username or password.. | Username: niloc. | Thread:46316
2025-04-20 16:01:24.573 | HD Server | Thread:46316 (2) | Close event error. Windows error code 10053: An established connection was aborted by the software in your host machine. *
2025-04-20 16:01:24.573 | HD Server | Thread:46316 (2) | Socket gracefully closed by remote side.
2025-04-20 16:01:24.573 | HD Server | Thread:46316 (2) | CloseSocket call.
2025-04-20 16:01:24.574 | HD Server | Thread:46316 (2) | Graceful close received or receive error. Shutdown complete. Closing socket now.
2025-04-20 16:01:24.574 | HD Server | Thread:46316 (2) | Closed.
2025-04-20 16:01:24.574 | HD Server | Thread:46316 (0) | CloseSocket call. | Number times message added: 1
2025-04-20 16:01:24.721 | HD Server | Server thread ending. Closing socket. | Username: niloc. | Thread:46316
2025-04-20 16:01:24.721 | HD Server Manager | Current server count=0


I'm implementing a DTC protocol client to connect to Sierra Chart, and I've identified and fixed an issue with the username byte order/endianness, but I'm still having authentication problems. I'm hoping you can provide guidance on the correct authentication setup.
Technical Details:

I've identified that Sierra Chart reads usernames in reverse byte order. For example, when I send "colin", Sierra Chart sees "niloc".
I've implemented a fix in my client that reverses the username before sending:
cpp// Create a reversed copy of the username
std::string reversed_username = username;
std::reverse(reversed_username.begin(), reversed_username.end());

// Copy the reversed string into the request
strncpy(request.Username, reversed_username.c_str(), sizeof(request.Username) - 1);

My client successfully connects to Sierra Chart, and I can see in the Sierra Chart logs that it's correctly receiving the reversed username:
2025-04-20 16:01:24.495 | HD Server | Received login. Requesting authorization. | Username: niloc. | Thread:46316
2025-04-20 16:01:24.495 | HD Server | Login rejected: Logon rejected due to invalid username or password. | Username: niloc. | Thread:46316

Despite Sierra Chart correctly receiving the reversed username, authentication is still failing with "invalid username or password".

Configuration:

DTC Protocol Server is enabled (Yes)
Listening Port: 11099 (for market data)
Historical Data Port: 11098 (for historical data)
Require Authentication: Yes
Encoding: Binary

Questions:

Where in Sierra Chart can I set up or view the usernames and passwords for DTC Protocol connections?
Are there any default credentials I should be using for testing?
Is there anything else needed for DTC authentication beyond username and password?
Do you have any example code or specific format requirements for the authentication process?


Any assistance you can provide would be greatly appreciated. I've gotten past the technical hurdle of the string reversal issue, but I need guidance on the correct authentication credentials to use.
Thank you for your help,
[Your Name]

This message explains your technical progress, clearly identifies the remaining issue, and asks specific questions that their support team should be able to answer directly.RetryClaude can make mistakes. Please double-check responses.Tip: Long chats cause you to reach your usage limits faster.
attachmentsierra_chart_client.cpp - Attached On 2025-04-20 20:14:39 UTC - Size: 21.29 KB - 21 views
attachmentCMakeLists.txt - Attached On 2025-04-20 20:15:10 UTC - Size: 831 B - 22 views