Support Board
Date/Time: Wed, 27 Nov 2024 14:37:05 +0000
SC as a frontend for proprietary trading platform?
View Count: 1800
[2022-03-16 17:16:45] |
User814333 - Posts: 13 |
I'm new to Sierra Chart and am looking for some information. I'm part of a group that's developing an AI driven trading system (for futures trading) that will run on a Linux server with its own data feed. I'm wondering if Sierra Chart could possibly be used as frontend for this system, where trade signals from the server would be sent to SC for trade execution with the broker. The idea is to use SC to place the actual trade orders as well as monitor market activity, trade results, account status, etc. It would also be nice if SC could communicate with the server and provide some basic control of its operation. I know this is very different from how SC is normally used (and probably overkill for this application) but just wanted to find out if this was feasible and worth exploring further. Other suggestions/recommendations for this are welcomed as well. Thanks for your help. I appreciate it. |
[2022-03-16 18:05:12] |
norvik_ - Posts: 106 |
Hi, all what you want is possible. Client with DTC protocol over TCP/IP as part of your system can provide such functionality. Sierra will be server in this case.
|
[2022-03-16 20:38:51] |
1+1=10 - Posts: 270 |
@User814333, I'm part of a group that's developing an AI driven trading system (for futures trading) that will run on a Linux server with its own data feed.
What data feed will the server be using? The reason I ask is many of them, including Rithmic, CQG, & Trading Technologies all provide APIs for data & trading as well as front-end software. The most cost-effective is Rithmic's at $20-$100 a month depending on broker: https://edgeclear.com/rithmic/ For CQG's unfortunately, you have to get it as an add-on to their CQG Integrated Client front-end with total costs of $595 + $245 /m: https://www.cqg.com/products/product-comparison Trading Technologies is $400 /m w/ $2000 cap: https://www.tradingtechnologies.com/resources/pricing/ -------------------------- I'm wondering if Sierra Chart could possibly be used as frontend for this system, where trade signals from the server would be sent to SC for trade execution with the broker. The idea is to use SC to place the actual trade orders as well as monitor market activity, trade results, account status, etc.
A few thoughts here: 1. I'd recommend subscribing to a data feed within SC and then passing that data to your server through the aforementioned DTC protocol. However, SC is not allowed to send live data from the CME Group (NYMEX, COMEX, CBOT, CME) through DTC. But, if you're trading other exchanges then this could be an option. 2. If the server has a separate data feed from SC, then keep in mind you'll need to subscribe to a 2nd data feed for SC too. 3. Yes, you can send orders from the your server to SC through DTC. It would also be nice if SC could communicate with the server and provide some basic control of its operation.
This can't be done through the DTC Protocol but it can be done through SC's normal custom study language, ACSIL, which is a C++ library. It includes functions for making HTTP Get/Post requests, which you could use to control your server. Docs here: DTC Protocol: DTC Protocol SC as DTC Protocol Server: Data and Trading Communications (DTC) Protocol Server ACSIL: Table of Contents | (Advanced Custom Study/System Interface and Language (ACSIL)) Date Time Of Last Edit: 2022-03-16 20:39:41
|
[2022-03-16 21:54:55] |
User814333 - Posts: 13 |
Hi, all what you want is possible. Client with DTC protocol over TCP/IP as part of your system can provide such functionality. Sierra will be server in this case.
Very good to know. Thanks! What data feed will the server be using? The reason I ask is many of them, including Rithmic, CQG, & Trading Technologies all provide APIs for data & trading as well as front-end software.
Rithmic (likely) for the data feed. Currently with IB for the broker, but that might change for this. I know Rithmic has its R|Trader and R|Trader Pro platforms, but while researching this I didn't see those mentioned much. I also thought it would be better to use a platform that supports multiple brokers and datafeeds, as I expect those might change at some point in the future. 2. If the server has a separate data feed from SC, then keep in mind you'll need to subscribe to a 2nd data feed for SC too.
Data will be coming from CME. But I was assuming we would subscribe to a second data feed for SC just to keep it simple. Hopefully the broker/Rithmic will give a price break on that. This can't be done through the DTC Protocol but it can be done through SC's normal custom study language, ACSIL, which is a C++ library. It includes functions for making HTTP Get/Post requests, which you could use to control your server.
Good to know this should be possible (much of the trade system is written in C++). Hopefully the development time won't be too exorbitant. Is there documentation available that describes how such customizations are actually accomplished in SC? I would like to take a look to get an idea of how involved this might get if we go with SC. Thanks for all the feedback. Very much appreciated! |
[2022-03-16 23:30:22] |
1+1=10 - Posts: 270 |
Rithmic (likely) for the data feed. Currently with IB for the broker, but that might change for this. I know Rithmic has its R|Trader and R|Trader Pro platforms, but while researching this I didn't see those mentioned much.
You likely know that IB has an API for TWS? The three potential downsides for using it to get data/communicate are: 1. Their normal data is given in 250 milli snapshots and only has best bid/best ask. If you want tick-by-tick or market depth you're limited to only 5-9 subscriptions depending on how many market data lines you've paid for. For many futures traders these limitations aren't suitable. 2. ... much higher intra-day margins with IB than many dedicated futures brokers. 3. ... much slower executions than many dedicated futures brokers because their risk server is not in Chicago/Aurora. Actually, regarding the fastest executions possible for an algorithm, which for short term trading can be the difference between profit and loss, see post #3 and down here: Backtest results are radically different from live trading results As for Rithmic's R Trader Pro and any other software they typically have free trials -- direct message me and I'll provide a link if you don't find one via search. Hopefully the development time won't be too exorbitant. Is there documentation available that describes how such customizations are actually accomplished in SC? I would like to take a look to get an idea of how involved this might get if we go with SC.
SC's C++ ACSIL library is extremely well documented and designed. If you download SC, and look in the C:\SierraCharts\ACS_Source\ folder there's files with the ACSIL for all the built-in SC studies. (I typically just open the whole folder in VS Code, as one's own custom study file is also saved in that folder. This is the easiest way to help the auto-complete find relevant ACSIL structures/constants/etc.) To get a feel for ACSIL see this example trading system here: Example ACSIL Trading Systems ACSIL docs are here: Table of Contents | (Advanced Custom Study/System Interface and Language (ACSIL)) ACSIL functions for sending a HTTP GET/POST request are here: 1. sc.MakeHTTPRequest() 2. sc.MakeHTTPPOSTRequest() Date Time Of Last Edit: 2022-03-16 23:32:06
|
[2022-03-16 23:35:50] |
1+1=10 - Posts: 270 |
Oh, one last note. The first user who responded, "norvik_" very helpfully provided an example of implementing a C++ DTC protocol client here: DTC client example
|
[2022-03-16 23:49:21] |
1+1=10 - Posts: 270 |
Oh, this is the last note, I promise! Regarding deciding whether fast executions will matter to your strategy I shared some useful info in this post, above and beyond the previous link I mentioned: Teton Routing service and appropriate VPS wit lowest Ping! | Post: 299278
|
[2022-03-17 20:54:49] |
User814333 - Posts: 13 |
You likely know that IB has an API for TWS? The three potential downsides for using it to get data/communicate are:
Yes, but I've seen a number of posts where people had some problems with it. We'll probably go with one of Rithmic's introducing brokers, which will give us a discount on the data. SC's C++ ACSIL library is extremely well documented and designed. If you download SC, and look in the C:\SierraCharts\ACS_Source\ folder there's files with the ACSIL for all the built-in SC studies.
I took a look at some of your links (thanks again for those) and the documentation does look very good. The process to create your own studies and add them to SC appears pretty straightforward. I've written some (simple) C++ dll's before (for another application) and the process was similar (used an IDE rather than notepad though). With regard to DTC, I looked through the documentation on SC's DTC server, and the process for setting it up seems pretty straight forward. What I didn't see mentioned though is how trade-related messages are actually passed to the broker once their received by the server. Is that something a custom study is needed for? The other part is the DTC client for the Linux server. Not sure how involved that will be to implement. Hopefully there's some open source code available. Thanks again for the help. Overall it's looking promising. |
[2022-03-17 21:13:00] |
1+1=10 - Posts: 270 |
What I didn't see mentioned though is how trade-related messages are actually passed to the broker once their received by the server. Is that something a custom study is needed for?
Oh, right! Ah, first you sign into your trading account via SC. Then any DTC messages you send to the SC Protocol server will be for that trading account. (You can have multiple SC instances that each have a different trading account all running unique SC protocol servers to pass messages to.) The other part is the DTC client for the Linux server. Not sure how involved that will be to implement. Hopefully there's some open source code available.
_norvik provided a C++ example of a DTC protocol client that I linked to in post 6 above. A few months ago I also searched DTC Protocol on GitHub and found these projects —- I think a few are in C++ — they are listed in no particular order. https://github.com/jseparovic/python-ws-dtc-client https://github.com/QANTau/DTC-Client https://github.com/Queeq/pydtc https://github.com/deepmarker/ocaml-dtc-pb https://github.com/gaoxiaojun/DTC https://github.com/6qat/dtc-scala https://github.com/AndrewAMD/SierraChartZorroPlugin I implemented a DTC client in Rust and it was doable but would likely take someone working full time half a month at least. Maybe _norvik has a different opinion. Date Time Of Last Edit: 2022-03-17 21:13:49
|
[2022-03-17 22:47:25] |
Sierra Chart Engineering - Posts: 104368 |
Referring to the first post, yes you can certainly do this. Have a look at: Table of Contents | (Advanced Custom Study/System Interface and Language (ACSIL)) Data and Trading Communications (DTC) Protocol Server 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 |
[2022-03-18 00:55:31] |
User814333 - Posts: 13 |
Oh, right! Ah, first you sign into your trading account via SC. Then any DTC messages you send to the SC Protocol server will be for that trading account.
(You can have multiple SC instances that each have a different trading account all running unique SC protocol servers to pass messages to.) Oh, ok. I see now. I had read that SC was lightweight, so running multiple instances is apparently no problem (and perhaps standard practice). Thanks. Referring to the first post, yes you can certainly do this. Have a look at:
Table of Contents | (Advanced Custom Study/System Interface and Language (ACSIL)) Thanks for the link. The External Interfaces section had the info on DTC I was looking for. I think that answers all of my questions for now. Thanks again for all the help. I think SC could be a really good solution for this application. |
To post a message in this thread, you need to log in with your Sierra Chart account: