Login Page - Create Account

Support Board


Date/Time: Mon, 07 Jul 2025 05:41:52 +0000



CQG data IB for trade

View Count: 9584

[2018-12-15 19:30:36]
User269839 - Posts: 4
I am wondering if it is possible to use IB for trade execution and CQG for data? If so, can you please tell me how to set that up on sierra.

Thank you, Lenny
[2018-12-15 23:18:02]
Sierra Chart Engineering - Posts: 104368
You can but it really is most recommended to use the Sierra Chart Exchange Data Feed instead:
Sierra Chart Exchange Data Feed
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: 2018-12-15 23:18:16
[2018-12-16 13:44:43]
User269839 - Posts: 4
I understand, but there are several types of charts that I use that require a cqg feed. How do I go about setting up CQG for data and IB for trading?


Thank you
[2018-12-18 10:39:51]
Sierra Chart Engineering - Posts: 104368
This does not make sense as long as you are looking at CME, EUREX or ICE markets, the Sierra Chart Exchange Data Feed does provide the necessary data that you would need. And that is the recommended choice.

Anyway, here is the reference:
https://www.sierrachart.com/index.php?page=doc/MultipleServices.html#AccessingMarketDataFromOtherInstancesOfSierra%20Chart
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: 2019-04-14 22:40:55
[2019-01-03 12:57:01]
thabet - Posts: 1
where you able to have IB works with CQG and Sierra ?

how much is the monthly cost compared to the Sierra Chart Exchange Feed ?
[2019-04-14 02:23:40]
User745789 - Posts: 381
I am researching this path as well: CQG data + IBKR broker on SC. I'd love to use the Sierra Chart Exchange Data Feed, but it doesn't offer JPX products, so it is CQG for me instead.

I am interested in any comments regarding practical implications, reliability, complexity etc.
[2019-04-14 13:28:54]
User993113 - Posts: 77
I have already tryed this
Can not set Multiple Data and Trading Services at the Same Time

But I was not able to make it work
[2019-04-14 13:29:06]
JanS - Posts: 46
Have a good look at the documentation. It's all in there.

Using Multiple Data and Trading Services at the Same Time
[2019-04-14 13:37:21]
User993113 - Posts: 77
JanS, would you mind to give an example?
just copy and paste the symbol settings of a future that is working
Date Time Of Last Edit: 2019-04-14 13:38:03
[2019-04-14 22:20:01]
Kiwi - Posts: 375
I was curious.

So I set used my source as my AMP CQG & set up the server settings as per 5. This is a free SC on AMP account.

I set up my destination as an IB instance with my normal username/password.

I edited the destination directories GlobalSymbolSettings.XML using exactly the Sierra settings but with HSI symbol changes and although a Custom category appeared, I didn't get a symbol (I'd changed the old futures symbol to xxxHSI & it still showed but as xxxHSI.)

So I tried Futures instead of custom. Not there.

So I copied the xxxHSI settings block, got rid of the xxx's, deleted the first line (service code) and removed two lines from the end that seemed to be duplicated by the lines I planned to add. So I got rid of:


    <service-code>interactive_brokers.trading</service-code>
    <realtime-data-client>default_primary</realtime-data-client>
    <symbol-query-options-realtime-data-client>default_primary</symbol-query-options-realtime-data-client>

Then I added lines from SC's settings to the bottom. The new lines start at <source-data-symbol


  <settings>
    <symbol>HSI-######-HKFE</symbol>
    <historical-chart-symbol>HS?##</historical-chart-symbol>
    <use-pattern-matching-characters>true</use-pattern-matching-characters>
    <contract-months>FGHJKMNQUVXZ</contract-months>
    <description>Hang Seng Stock Index Futures - HKFE</description>
    <category>Futures</category>
    <value-format-code>1</value-format-code>
    <tick-size>1</tick-size>
    <currency-value-per-tick>1</currency-value-per-tick>
    <rollover-method>Method11</rollover-method>
    <rollover-input-1>1</rollover-input-1>
    <sc-data-symbol>HS?##</sc-data-symbol>
    <sc-data-srvcode>HongKongFutures.Exchange</sc-data-srvcode>
    <service-code></service-code>
    <source-data-symbol>F.US.HSIJ19</source-data-symbol>
    <source-data-multiplier>1.0</source-data-multiplier>
    <generic-sub-client-server-address>127.0.0.1:11094</generic-sub-client-server-address>
    <realtime-data-client>Generic_Sub_Clients</realtime-data-client>
    <historical-data-server>127.0.0.1:11095</historical-data-server>
  </settings>

This version tries to connect to IB (for trading I assume) and protested that it wasn't open. And it connected to the source SierraChart and created a new data file from CQG data. So I'd say it worked.
Date Time Of Last Edit: 2019-04-14 22:25:56
[2019-04-14 22:40:02]
Sierra Chart Engineering - Posts: 104368
Change this to:
<source-data-symbol>F.US.HSI?##</source-data-symbol>

This can remain:
<service-code>interactive_brokers.trading</service-code>
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-04-14 22:41:35]
Sierra Chart Engineering - Posts: 104368
I am researching this path as well: CQG data + IBKR broker on SC. I'd love to use the Sierra Chart Exchange Data Feed, but it doesn't offer JPX products, so it is CQG for me instead.

I am interested in any comments regarding practical implications, reliability, complexity etc.
Yes this is supported. An example of doing this is in post #10. It is totally reliable and it is not complicated.
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: 2019-04-14 22:41:58
[2019-04-14 23:12:04]
User993113 - Posts: 77
In regards to post #10
So I'd say it worked.
When you open an HSI chart, do you see an [M] indicator after the symbol?
[2019-04-14 23:31:04]
Kiwi - Posts: 375
Yes. IB TWS is not running. The SC instance is set to disconnect. The data is loaded and the resulting chart header is:

https://i.imgur.com/ezKFUpc.png

I just started TWS, connected to data service, and place an order which came up on TWS. I will check in a couple of hours if this instance is getting data from CQG live ... I guess if the granularity matches my CQG instance its probably right, then disconnect & shut down tws to make sure it continues.
Date Time Of Last Edit: 2019-04-14 23:37:00
[2019-04-14 23:38:20]
Kiwi - Posts: 375
Just shut down the CQG instance & the other one started protesting that the data feed was disconnected despite being connected to TWS so thats promising.
[2019-04-15 00:02:58]
Kiwi - Posts: 375
There is one problem. When I connect to IB I then get error messages from the DTC connection which I assume relate to the setting to require authentication. Not sure what causes that. Admin?

They may just be because HKFE is not open yet & thus CQG is saying "can't connect here, historical only". I'll see if they disappear once HSI preopens.

Interactive Brokers | Connecting to 127.0.0.1:7496 | 2019-04-15 09:59:43
Socket (2) | Creating socket. | 2019-04-15 09:59:43
Socket (2) | Connecting to IP: 127.0.0.1. | 2019-04-15 09:59:43
Interactive Brokers | Sending API sign: API | 2019-04-15 09:59:43
Interactive Brokers | Sending client version: v100..136 +PACEAPI. Waiting for acceptance. | 2019-04-15 09:59:43
Interactive Brokers | TWS server version: 136 | 2019-04-15 09:59:43
Interactive Brokers | TWS time: 20190415 09:59:43 AEST | 2019-04-15 09:59:43
Interactive Brokers | Connected. Sending Start API command. | 2019-04-15 09:59:44
Interactive Brokers | Waiting for account information. | 2019-04-15 09:59:44
IB Account information received. | 2019-04-15 09:59:44
Interactive Brokers | Received 1 Trade Accounts from TWS. | 2019-04-15 09:59:44
Interactive Brokers | Connected to Live account. | 2019-04-15 09:59:44
Interactive Brokers | Year-Month last connected to Live account: 2019-04 | 2019-04-15 09:59:44
Interactive Brokers | Connected to data and trading server. | 2019-04-15 09:59:44
Next valid order ID: 128 | 2019-04-15 09:59:44
Message from IB: Market data farm connection is OK:hfarm. IB Error Code: 2104. Request ID: -1. | 2019-04-15 09:59:44
Message from IB: Market data farm connection is OK:cashfarm. IB Error Code: 2104. Request ID: -1. | 2019-04-15 09:59:44
Message from IB: Market data farm connection is OK:usfarm. IB Error Code: 2104. Request ID: -1. | 2019-04-15 09:59:44
Message from IB: HMDS data farm connection is OK:hkhmds. IB Error Code: 2106. Request ID: -1. | 2019-04-15 09:59:44
Message from IB: HMDS data farm connection is OK:ushmds. IB Error Code: 2106. Request ID: -1. | 2019-04-15 09:59:44
Next valid order ID: 128 | 2019-04-15 09:59:44
Generic Client (127.0.0.1:11094) | Starting real-time market data updates for: HSI-201904-HKFE. ID: 1 | 2019-04-15 09:59:44
Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-15 09:59:44
DTC Client socket (3) | Creating socket. | 2019-04-15 09:59:44
Generic Client (127.0.0.1:11094) | Requesting security definition data for: HSI-201904-HKFE. ID: 1 | 2019-04-15 09:59:44
Starting first historical Intraday data download. When complete another download will be done from the primary service. Symbol: HSI-201904-HKFE | 2019-04-15 09:59:44
Intraday data recording state for symbol HSI-201904-HKFE is set to download 'Pending'. | 2019-04-15 09:59:44
DTC Client socket (3) | Connecting to IP: 127.0.0.1. | 2019-04-15 09:59:44
DTC Client socket (3) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-15 09:59:44 *
Delaying start of download for HSI-201904-HKFE | 2019-04-15 09:59:44
DTC Client socket (3) | Closed. | 2019-04-15 09:59:44
Generic Client (127.0.0.1:11094) | Disconnected from the server. | 2019-04-15 09:59:44
Generic Client (127.0.0.1:11094) | Data feed disconnected. Will reconnect in 2 seconds. | 2019-04-15 09:59:44
Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-15 09:59:46
DTC Client socket (1) | Creating socket. | 2019-04-15 09:59:46
DTC Client socket (1) | Connecting to IP: 127.0.0.1. | 2019-04-15 09:59:46
DTC Client socket (1) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-15 09:59:46 *
DTC Client socket (1) | Closed. | 2019-04-15 09:59:46
Generic Client (127.0.0.1:11094) | Disconnected from the server. | 2019-04-15 09:59:46
Generic Client (127.0.0.1:11094) | Data feed disconnected. Will reconnect in 2 seconds. | 2019-04-15 09:59:46
Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-15 09:59:48
DTC Client socket (1) | Creating socket. | 2019-04-15 09:59:48
DTC Client socket (1) | Connecting to IP: 127.0.0.1. | 2019-04-15 09:59:48
DTC Client socket (1) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-15 09:59:48 *
Generic Client (127.0.0.1:11094) | Disconnected from the server. | 2019-04-15 09:59:48
Generic Client (127.0.0.1:11094) | Data feed disconnected. Will reconnect in 2 seconds. | 2019-04-15 09:59:48
DTC Client socket (1) | Closed. | 2019-04-15 09:59:48
Interactive Brokers | Requesting Trade Positions snapshot and updates (IB account data updates (6)) for account: U708* | 2019-04-15 09:59:49
Interactive Brokers | Received Trade Positions download end message for account U708* | 2019-04-15 09:59:49

Date Time Of Last Edit: 2019-04-15 00:04:19
[2019-04-15 01:52:55]
Sierra Chart Engineering - Posts: 104368
DTC Client socket (1) | Creating socket. | 2019-04-15 09:59:48
DTC Client socket (1) | Connecting to IP: 127.0.0.1. | 2019-04-15 09:59:48
DTC Client socket (1) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-15 09:59:48 *
Generic Client (127.0.0.1:11094) | Disconnected from the server. | 2019-04-15 09:59:48
Related to the above, do you see an incoming connection on the server instance being connected to? Check the Message Log at the time.
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: 2019-04-15 01:53:04
[2019-04-15 02:52:10]
Kiwi - Posts: 375
No I don't. Just checked and nothing happens on source log when sink is trying to connect.

Also the source is set (as recommended) to require authentication and I don't know where that should be set on the sink.

Also source is 1902 and sink is 1898.
[2019-04-15 02:55:20]
Kiwi - Posts: 375
My fault. I'd accidentally unticked the sources Enable DTC Protocol Server.

Will experiment & report back
[2019-04-15 03:04:25]
Kiwi - Posts: 375
No. Still not right. OK. This is taking too much time for something I don't need.

User993113, I don't have enough time to work it through at present but its obviously a little tricky & I suspect my final issue is to do with authentication.
[2019-04-17 22:18:45]
Kiwi - Posts: 375
Coming up to the holiday I decided to try again but with a completely clean install for both CQG & IB instances. My tendency to experiment, use soft links for directories onto a ram disk plus the fact that I run Sierra Chart under Wine 3.0 on Linux may have contributed to the original issues :)

Start two brand new folders in Wine's Drive C level. Both using a clean download of 1898.

SC_CQG and SC_IB, both log in to Sierra with my old level 3 password

Both have only AlertSounds, Data, DTC, Graphics, SierraChart_64.exe
& SierraChartStudies_64.dll to start with.

Working from: Using Multiple Data and Trading Services at the Same Time

Both initially logged in but no files added. set hist days to download to 10 to speed things up. Will only use HSI as its common to both accounts.

Step 5. Source settings https://i.imgur.com/tHTAGew.png

Step 10. Given prior issues I backed up GlobalSymbolSettings.xml & in the active
copy deleted all settings blocks that mentioned HSI. The backup will let me
source them if I can't use the raw version from the web page step 12.

Step 12. I will initially use no pattern matching to be sure of a simple
linkage between symbols ... so initial version looks like:
https://i.imgur.com/sjS2oSf.png

---

So far so good ... filled historical and intraday data in out of hours
condition. turned trade sim off. turned chart trade on.
https://i.imgur.com/ks63t9R.png

---

Things to test: will it fill accurately while the market is open. can I place
orders on ib from ib instance.

1. normally you can place trades on ib out of hours (but not on cqg). Initial attempt to place trade from ib instance resulting in no trade being placed. Possibly I need to give a complete symbol including HKEX ... will amend symbol settings. Changed symbol to HSI-201904-HKFE and order placed ok and cancelled ok.

Will now wait for market to open (2 hours) so that I can test, fill from cqg, data from cqg (millisecond timestamped tick data vs ib 5 second or snapshot), and placing & cancelling ib order while market is open. If that all works I'll try changing symbols back to use pattern matching.
Date Time Of Last Edit: 2019-04-17 23:21:14
[2019-04-18 01:55:42]
Kiwi - Posts: 375
So, connected after market opened and had the same problem as last time. The ib instance didn't connect whether the cqg instance had an HSI chart open or not. Submitted logs from both instances but the basic issue from the ib instance was:

Interactive Brokers | Requesting Trade Positions snapshot and updates (IB account data updates (6)) for account: U708* | 2019-04-18 01:46:57
Interactive Brokers | Received Trade Positions download end message for account U708* | 2019-04-18 01:46:57
HSI-201904-HKFE 1 Min #1 | Reloading chart. | 2019-04-18 01:47:59
Generic Client (127.0.0.1:11094) | Starting real-time market data updates for: HSI-201904-HKFE (F.US.HSIJ19). ID: 1 | 2019-04-18 01:47:59
Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-18 01:47:59
DTC Client socket (2) | Creating socket. | 2019-04-18 01:47:59
Generic Client (127.0.0.1:11094) | Requesting security definition data for: HSI-201904-HKFE (F.US.HSIJ19). ID: 1 | 2019-04-18 01:47:59
DTC Client socket (2) | Connecting to IP: 127.0.0.1. | 2019-04-18 01:47:59
Intraday data recording state for symbol HSI-201904-HKFE is set to download 'Pending'. | 2019-04-18 01:47:59
DTC Client socket (2) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-18 01:47:59 *
Delaying start of download for HSI-201904-HKFE | 2019-04-18 01:47:59
Generic Client (127.0.0.1:11094) | Disconnected from the server. | 2019-04-18 01:47:59
DTC Client socket (2) | Closed. | 2019-04-18 01:47:59
Generic Client (127.0.0.1:11094) | Data feed disconnected. Will reconnect in 2 seconds. | 2019-04-18 01:47:59
Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-18 01:48:01
DTC Client socket (2) | Creating socket. | 2019-04-18 01:48:01
DTC Client socket (2) | Connecting to IP: 127.0.0.1. | 2019-04-18 01:48:01
DTC Client socket (2) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-18 01:48:01 *
Generic Client (127.0.0.1:11094) | Disconnected from the server. | 2019-04-18 01:48:01
Generic Client (127.0.0.1:11094) | Data feed disconnected. Will reconnect in 2 seconds. | 2019-04-18 01:48:01
DTC Client socket (2) | Closed. | 2019-04-18 01:48:01
Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-18 01:48:03
DTC Client socket (2) | Creating socket. | 2019-04-18 01:48:03
DTC Client socket (2) | Connecting to IP: 127.0.0.1. | 2019-04-18 01:48:03
DTC Client socket (2) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-18 01:48:03 *
DTC Client socket (2) | Closed. | 2019-04-18 01:48:03


I don't actually need this and it might be a Sierra / Wine / Linux issue rather than a "real" issue.
Date Time Of Last Edit: 2019-04-18 06:15:59
[2019-04-18 02:18:05]
Sierra Chart Engineering - Posts: 104368
First, there is no reason why you should have any difficulty. So we do not really see this as helping other users. Rather just creating more confusion and doubts for a feature that works well and is well documented and is not that hard to use.


Generic Client (127.0.0.1:11094) | Connecting to the server 127.0.0.1. Port 11094 | 2019-04-18 01:48:01
DTC Client socket (2) | Creating socket. | 2019-04-18 01:48:01
DTC Client socket (2) | Connecting to IP: 127.0.0.1. | 2019-04-18 01:48:01
DTC Client socket (2) | Connect event error. Windows error code 10061: Connection refused. | 2019-04-18 01:48:01 *
This is a basic low-level networking issue on your system. Why is the connection being refused? You can see the IP and port being connected to and the error.

Check to make sure you have a copy of Sierra Chart running on your local system with the DTC server listening in on that port. This is configured through Global Settings >> Data/Trade Service Settings >> SC Server Settings >>DTC Protocol Server >> Listening Port.
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: 2019-04-18 03:46:38
[2019-04-18 04:57:31]
Kiwi - Posts: 375
Interesting. I agree that this should be easy and was only trying it because two of your other customers found it otherwise so I thought I'd give it a go and document my attempt for them.

That's the second time "Enable DTC Protocol Server" on the cqg instance has unticked during this experiment. In the earlier case (post #16) I thought I might have switched it off accidentally. This time I avoided adding extra actions.. it worked at 9:15 (step 5 picture in post 21) and miraculously switched off by 11:30 for the market open test.

Thanks for pointing out the issue again.
Date Time Of Last Edit: 2019-04-18 05:01:24
[2019-04-18 05:20:55]
Kiwi - Posts: 375
So market open again and I can report that following the process in post 21 works (double and triple check that the "Enable DTC Protocol Server" setting on the source instance is ticked if you have connectivity issues). Data from cqg was good. Order management to ib was fine. I'll confirm and post the pattern matching version of the settings once I get a quiet period.

So the final version of the service data for HSI (no session times added) was:

<settings>
<service-code></service-code><!--Leave this blank. It will be automatically set.-->
<symbol>HSI-######-HKFE</symbol>
<historical-chart-symbol>HS?##</historical-chart-symbol>
<use-pattern-matching-characters>true</use-pattern-matching-characters>
<contract-months>FGHJKMNQUVXZ</contract-months>
<description>Hang Seng Index (HSI) - HKFE</description>
<category>Custom</category>
<value-format-code>0</value-format-code>
<tick-size>1</tick-size>
<currency-value-per-tick>50</currency-value-per-tick>
<error-filtering>false</error-filtering>
<default-order-quantity>1</default-order-quantity>
<source-data-symbol>F.US.HSI?##</source-data-symbol>
<source-data-multiplier>1.0</source-data-multiplier>
<generic-sub-client-server-address>127.0.0.1:11094</generic-sub-client-server-address>
<realtime-data-client>Generic_Sub_Clients</realtime-data-client>
<historical-data-server>127.0.0.1:11095</historical-data-server>
<historical-daily-data-source>SC_DTC_HISTORICAL_DATA_SERVER</historical-daily-data-source>
<historical-intraday-data-source>SC_DTC_HISTORICAL_DATA_SERVER</historical-intraday-data-source>
</settings>

For the symbols you need to map, these lines can be found in your IB file:

<symbol>HSI-######-HKFE</symbol>
<historical-chart-symbol>HS?##</historical-chart-symbol>
<use-pattern-matching-characters>true</use-pattern-matching-characters>
<contract-months>FGHJKMNQUVXZ</contract-months>

<value-format-code>0</value-format-code>
<tick-size>1</tick-size>
<currency-value-per-tick>50</currency-value-per-tick>

And these lines can be found in your cqg file:

<source-data-symbol>F.US.HSI?##</source-data-symbol>
Date Time Of Last Edit: 2019-04-18 06:18:46

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

Login

Login Page - Create Account