Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 18:26:19 +0000



[Programming Help] - I want to dynamically/programatically send data to SC for display on a price chart

View Count: 322

[2024-05-11 07:33:33]
reknirt - Posts: 8
Hello! I'm trying to figure out a way to draw various price levels on a chart that are updated every x minutes and I'm having a difficult time figuring out what is actually possible and what is not on the platform. I have a python app that takes options chain data and performs a bunch of calculations and ultimately outputs strike price levels. I would like to plot these on a price chart in SC. My app runs all day and is constantly updating and as it updates I'd like to pass the updated levels to SC so the levels on the price chart are always current.

I'm a developer so I don't need help coding this out, but I would appreciate some guidance on any and all avenues to dynamically feed data to SC. The data I want to pass to SC is not limited -- it can be JSON or a CSV, etc.

For example, would you recommend importing a CSV and if so, is there a way to automate that process?

Is there away to do this over the very confusing DTC Protocol?

I've read all the docs and I'm still a bit lost so I would appreciate it if you don't just point me to the intro page for ASCIL studies or DTC Protocol in the docs. Any specific details about how to constantly send strings/labels and a price to SC would be greatly appreciated.
Date Time Of Last Edit: 2024-05-11 07:34:27
[2024-05-11 10:14:57]
User431178 - Posts: 541
For example, would you recommend importing a CSV and if so, is there a way to automate that process?
sc.ReadFile()

Use the above function as a start and configure your study to periodically update from the csv (as opposed to on every chart update).
Probably the simplest solution.


I'm a developer so I don't need help coding this out
Any specific details about how to constantly send strings/labels and a price to SC would be greatly appreciated.

Seems slightly contradictory, anyways, you have the fullness of c++ at your disposal.

Is Python app on the same machine or remote?
[2024-05-11 13:08:17]
d9e5c763 - Posts: 108
If you only need to display price information in real time on the chart, then encoding the binary data and writing it into a SCID file should be the simplest method in my opinion. It could even support real-time display of market depth data.
Text/CSV Data Format: Using Your Own Data and Not Connecting to External Data Service

In my opinion, the DTC protocol is not 'confusing' at all. At most, it may require special attention to the different time accuracies of various message types
[2024-05-11 18:48:29]
reknirt - Posts: 8
Use the above function as a start and configure your study to periodically update from the csv (as opposed to on every chart update).
Probably the simplest solution.

Thank you, sir.

Seems slightly contradictory, anyways, you have the fullness of c++ at your disposal.
I have 20 years of enterprise software engineering experience but I'm new to SC and I don't know the capabilities or intricacies of every platform or framework ever made.

Is Python app on the same machine or remote?

Currently its local. Long term though I'd like it to be hosted so that I can share it.

If you only need to display price information in real time on the chart, then encoding the binary data and writing it into a SCID file should be the simplest method in my opinion. It could even support real-time display of market depth data.
Text/CSV Data Format: Using Your Own Data and Not Connecting to External Data Service

In my opinion, the DTC protocol is not 'confusing' at all. At most, it may require special attention to the different time accuracies of various message types

Thanks -- I still need the data feed in SC -- I just want to add some more data to it. That link says to turn off external data. Do you know if its possible to use my denali data feed and import data on top of it? And I'm sure the DTC Protocol isn't that confusing, I just have no experience with it. I appreciate the advice. Thank you.
Date Time Of Last Edit: 2024-05-11 18:49:10
[2024-05-11 20:22:37]
reknirt - Posts: 8
This is what I'm trying to do.

Custom Study - reading external csv data in real time | Post: 352180
[2024-05-12 10:46:10]
User431178 - Posts: 541
This is what I'm trying to do.

Ok, so the readfile with periodic updates suggestion would work for the local hosted case.

You could use peristent date time variable to record the last update time, then wait a specified length of time before querying the file again.
Persistent Variable Functions


For the remotely hosted version, it depends, how much data are you sending and how often?
In other words, is it better to stream the data (and only send new/updated/removed levels) or to periodically request a file (from the server) with all the levels?

If the latter, which I would assume the most liekly case, then you have options within ACSIL to make life easy.

sc.MakeHTTPRequest()
sc.MakeHTTPPOSTRequest()
sc.MakeHTTPBinaryRequest()

The process would be similar to local host, you just need to request the file from your server and download it first.

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

Login

Login Page - Create Account