Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 09:31:59 +0000



Sierra Fix connection

View Count: 1353

[2019-10-31 15:49:01]
User521555 - Posts: 24
Hi,

My broker is going to give me a Fix connection, how do I configure SC in order to receive datafeed and send orders ?

Thank you
[2019-10-31 15:56:53]
Sierra Chart Engineering - Posts: 104368
What is the name of the system or service that this FIX connection would connect to?
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-10-31 16:12:13]
User521555 - Posts: 24
I do not know the name of the service, I am in Brazil, if they have a service, probably it is unknow....
the broker told me that they are giving me the Fix connection access for trade and market data.
[2019-10-31 18:06:28]
Sierra Chart Engineering - Posts: 104368
Almost certainly this is not going to be compatible with Sierra Chart. FIX is not standardized enough for compatibility in this way.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-10-31 18:14:55]
User521555 - Posts: 24
I see, what about if I use ctrader platform?

https://help.ctrader.com/fix

Is it possible ?

thank you so much
[2019-11-01 05:44:52]
Sierra Chart Engineering - Posts: 104368
There is not compatibility at this time with that system.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-03-10 14:10:57]
User521555 - Posts: 24
Hi,

I would like to connect Sierra with Trading Technologies to draw charts and sending orders....

I would like to trade at B3 exchange, is it possible ?

thank you
[2021-03-10 16:28:44]
Sierra Chart Engineering - Posts: 104368
This is supported through the Sierra Chart Order Routing Service :
Sierra Chart / Trading Technologies Futures Order Routing Service

The problem is you need to use our data feed for the B3 data. We do not have a good data feed for that. Check with the supported IQ Feed service to see if they have B3 data.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2021-03-10 16:29:01
[2024-11-11 17:08:35]
Marco Tortoli - Posts: 6
Hello, i would integrate https://quickfixengine.org/ based on https://www.fixtrading.org/
I need to get info from Sierra like below:

SenderCompID=YOUR_SENDER_ID
TargetCompID=YOUR_TARGET_ID
SocketConnectHost=sierrachart.com
SocketConnectPort=YOUR_PORT

Where can i get that info once i logged into my account?
how do i configure SierraChart in order to connect with the Client?

Thanks.
[2024-11-11 17:41:57]
Sierra_Chart Engineering - Posts: 17145
There is no support for FIX. So this cannot be used.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-11 17:57:19]
Marco Tortoli - Posts: 6
Thank you for your answer.
So i should go for DTC protocol and follow this doc instead?
Doc: DTC Protocol
and Data and Trading Communications (DTC) Protocol Test Client

Ps. i have also notice you added the Google Protocol Buffers!!!! DTC Protocol: Google Protocol Buffers (GPB)

That's sounds great!
Date Time Of Last Edit: 2024-11-11 18:06:07
[2024-11-11 20:40:19]
John - SC Support - Posts: 36238
Yes, you can use the DTC Protocol to send/receive trades through Sierra Chart.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-19 10:30:18]
Marco Tortoli - Posts: 6
Hello, i am using GRPC Protocol Buffer, Java implementation (DTC Protocol: Google Protocol Buffers (GPB))
Testing how to fetch HistorcalPriceData (Historical Price Data Messages)
          (DTC Messages and Procedures: Historical Price Data)

Configured the Server following up the guide (Data and Trading Communications (DTC) Protocol Server: Server Usage)

Client Java Socket Settings
Host 127.0.0.1
Port: 11098



Standard Output Console

LogonRequest:
ProtocolVersion: 8
ClientName: "MyTradingApp"

Logon response received:
ProtocolVersion: 8
Result: LOGON_SUCCESS
ResultText: "Logon successful. Compression not supported."
ServerName: "SC HistoricalDataServer"
OrderCancelReplaceSupported: 1
HistoricalPriceDataSupported: 1
MarketDepthIsSupported: 1
OneHistoricalPriceDataRequestPerConnection: 1

HistoricalPriceDataRequest:
HistoricalPriceDataRequest: RequestID: 12345
Symbol: "EURUSD"
RecordInterval: INTERVAL_1_DAY
StartDateTime: 1731922993156
EndDateTime: 1732009393157
MaxDaysToReturn: 30
UseZLibCompression: 1
Integer_1: 42

Then for a time i get a lot of:
Unexpected end of ZLIB input stream
It seems like is not receiving the right data, that according with the Doc i should receive one of the below messages
HistoricalPriceDataResponseHeader
HistoricalPriceDataReject
HistoricalPriceDataRecordResponse

According with the Proto
  
// Historical price data
  HISTORICAL_PRICE_DATA_REQUEST= 800;
  HISTORICAL_PRICE_DATA_RESPONSE_HEADER = 801;
  HISTORICAL_PRICE_DATA_REJECT = 802;
  HISTORICAL_PRICE_DATA_RECORD_RESPONSE = 803;
  HISTORICAL_PRICE_DATA_TICK_RECORD_RESPONSE = 804;
  HISTORICAL_PRICE_DATA_RESPONSE_TRAILER = 807;


Log from SierraChart 2700

2024-11-19 09:43:12.822 | HD Server Manager | Incoming connection from IP: 127.0.0.1
2024-11-19 09:43:12.824 | HD Server Manager | Started new historical data server. Count=1
2024-11-19 09:43:12.847 | HD Server | Thread:36 (1) | Creating socket.
2024-11-19 09:43:12.847 | HD Server | Thread:36 (1) | New receive buffer size: 262144
2024-11-19 09:43:12.848 | HD Server | Thread:36 (1) | Allocated send buffers: 32 of 4096 bytes.
2024-11-19 09:43:12.985 | HD Server | Received login. Requesting authorization. | Username: (none). | Thread:36
2024-11-19 09:43:12.985 | HD Server | Login has been authorized. | Username: (none). | Thread:36
2024-11-19 09:43:23.843 | HD Server | Timed out waiting for historical data request. | Username: (none). | Thread:36
2024-11-19 09:43:23.843 | HD Server | Thread:36 (1) | CloseSocket call.
2024-11-19 09:43:23.844 | HD Server | Thread:36 (1) | Shutdown started. Waiting for graceful close.
2024-11-19 09:43:23.844 | HD Server | Thread:36 (0) | CloseSocket call.
2024-11-19 09:43:23.853 | HD Server | Thread:36 (1) | Socket gracefully closed by remote side.
2024-11-19 09:43:23.853 | HD Server | Thread:36 (1) | Closed.
2024-11-19 09:43:23.994 | HD Server | Server thread ending. Closing socket. | Username: (none). | Thread:36
2024-11-19 09:43:23.994 | HD Server Manager | Current server count=0


What am i missing here?
I tested using also with HeartbeatIntervalInSeconds but it's not clear in the doc if i should use or not, btw i am getting the same outcome

LogonRequest logonRequest = LogonRequest.newBuilder()
.setProtocolVersion(8)
.setClientName("MyTradingApp")
.setHeartbeatIntervalInSeconds(10)
.build();

Same for the HistoricalPriceDataRequest i used both values for UseZLibCompression (1 and 0)

HistoricalPriceDataRequest historicalPriceDataRequest = HistoricalPriceDataRequest.newBuilder()
.setRequestID(12345)
.setSymbol("EURUSD")
// .setExchange("NASDAQ")
.setRecordInterval(HistoricalDataIntervalEnum.INTERVAL_1_DAY) // Example interval
.setStartDateTime(ZonedDateTime.now().minusDays(1).toInstant().toEpochMilli())
.setEndDateTime(ZonedDateTime.now().toInstant().toEpochMilli())
.setMaxDaysToReturn(30)
.setUseZLibCompression(1) // 1 for compression, 0 for no compression
// .setRequestDividendAdjustedStockData(1)
.setInteger1(42)
.build();



Some note.
Debugging the response i notice that sometimes i get a message less than 4 bytes, Is there is any valid reason? As far i understand only the Header it should contain the Size of the Body Payload
and the Type is used to see what is the message incoming, from the enum DTCMessageType.

If above is correct i am expecting reading after an HistoricaPriceDataRequest something like the code snippet provided below,
also according with the Doc (DTC Protocol: Google Protocol Buffers (GPB))
From the doc:
The header Size field is set to the length of the encoded message plus the size of the header. The Size field allows the receiver to know when an entire message has been received. The Type field contains the DTC Message type, which are all defined in the DTCMessageType enum in the proto file.


byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
ByteBuffer byteBuffer = ByteBuffer.wrap(buffer, 0, bytesRead).order(ByteOrder.LITTLE_ENDIAN);

short messageSize = byteBuffer.getShort();
short messageType = byteBuffer.getShort();


byte[] messageBody = new byte[messageSize - 4];
byteBuffer.get(messageBody);

try {

switch (messageType) {
case 801: // HistoricalPriceDataResponseHeader
HistoricalPriceDataResponseHeader header = HistoricalPriceDataResponseHeader.parseFrom(messageBody);
log.info("Historical data response header: " + header);
break;

case 802: // HistoricalPriceDataRecordResponse
HistoricalPriceDataRecordResponse record = HistoricalPriceDataRecordResponse.parseFrom(messageBody);
log.info("Historical data record: " + record);
break;

case 803: // HistoricalPriceDataReject
HistoricalPriceDataReject reject = HistoricalPriceDataReject.parseFrom(messageBody);
System.err.println("Historical data request rejected: " + reject);
return; // Exit on rejection

case 3: // Heartbeat
Heartbeat heartbeat = Heartbeat.parseFrom(messageBody);
log.info("Heartbeat received at: " + heartbeat);
break;

default:
log.info("Unknown message type: " + messageType);
break;
}

} catch (IOException e) {
log.error("Failed to decompress or parse message: " + e.getMessage());
}
}

Date Time Of Last Edit: 2024-11-19 10:39:43
imageSierraChart--config.png / V - Attached On 2024-11-19 10:28:07 UTC - Size: 113.45 KB - 15 views
[2024-11-20 02:52:27]
Sierra_Chart Engineering - Posts: 17145
In the case of network communication you can certainly receive, a block of data, that is less than the header size of four bytes. You then have to hold that data in a buffer and wait for additional bytes to be received.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-20 09:04:53]
Marco Tortoli - Posts: 6
Hello,
Thank you for your answer.
Based on your sentence:
You then have to hold that data in a buffer and wait for additional bytes to be received.

Is there any message or method i can use in order to read the size of the Buffer, before starting to receive data from Server?

Any chance you can provide a code snippet (any language) to simulate a Client? A Test class as well it could be help.

Thanks
Date Time Of Last Edit: 2024-11-20 10:43:14
[2024-11-20 21:01:08]
Sierra_Chart Engineering - Posts: 17145

Is there any message or method i can use in order to read the size of the Buffer, before starting to receive data from Server?
This would be something in the socket library you are using.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-11-20 21:01:16
[2024-11-21 08:41:35]
Marco Tortoli - Posts: 6
Hello,
I managed, but it seems i am getting only messageType = 3 (Heartbeat) with empty body

LogonRequest:
ProtocolVersion: 8
ClientName: "MyTradingApp"

Logon response:
ProtocolVersion: 8
Result: LOGON_SUCCESS
ResultText: "Logon successful. Compression not supported."
ServerName: "SC HistoricalDataServer"
OrderCancelReplaceSupported: 1
HistoricalPriceDataSupported: 1
MarketDepthIsSupported: 1
OneHistoricalPriceDataRequestPerConnection: 1

Logon successful. Proceeding to fetch historical data...
HistoricalPriceDataRequest: Symbol: "EURUSD"
RecordInterval: INTERVAL_1_DAY
StartDateTime: 1731271135232
EndDateTime: 1732135135235
MaxDaysToReturn: 30
UseZLibCompression: 1


Debugging Output Console:

Buffer says 4316 //Holding all the data
messageType 3 // Header messageType
messageSize 4

But if i try to parse the Object, in this case the Heartbeat, is just Empty, since messageBody
contains just 0 data

Heartbeat heartbeat = Heartbeat.parseFrom(messageBody);

Debugging to see the Header i have
04 00 03 00 04 00 03 00 04 00 03 00 04 00 03 00 04........
in the MessageBody
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........

It doesn't look i am receiving something described here: DTC Messages and Procedures: Historical Price Data


Please can you help me on that?
[2024-11-22 18:43:22]
Marco Tortoli - Posts: 6
please, if you are not able to give a support, let me know, i can switch provider.

Kinds regards

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account