Login Page - Create Account

Support Board


Date/Time: Thu, 26 Dec 2024 19:49:46 +0000



ACSIL - How to force data recalculation on feed connect/disconnect?

View Count: 909

[2015-12-18 01:10:42]
ejtrader - Posts: 688
SC Team - Is there any reliable way to force recalculate when data feed is connected/disconnected?

I have explored - sc.ServerConnectionState - but probably running into usage issues.

The following code - doesn't get executed when the feed is disconnected/connected. Would you please provide any tips on this?


if (sc.UpdateStartIndex == 0) {
sc.AddMessageToLog(" ---- testind --- update == 0 -----", 0);
}

thanks
[2015-12-18 18:49:16]
Sierra Chart Engineering - Posts: 104368
We can only recommend sc.ServerConnectionState.

The documentation explains here that the study function will be called whenever there is a connection or disconnection to/from the servers:
https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scServerConnectionState
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
[2015-12-18 22:57:10]
ejtrader - Posts: 688
Thanks SC Team.

For anyone interested - this is the solution I came up with ( whether efficient or not). This would trigger a recalc - when there is a change with the ServerConnection state.

Just wish there is such option for a chart which is remote data based. Any possibility to add this function?


int &dfStatus = sc.GetPersistentInt(1);

if (sc.UpdateStartIndex == 0 || (dfStatus != sc.ServerConnectionState && sc.ServerConnectionState == SCS_CONNECTED)) {
sc.AddMessageToLog(" ---- testind --- update == 0 -----", 0);
}

dfStatus = sc.ServerConnectionState;


Date Time Of Last Edit: 2015-12-19 02:58:30

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

Login

Login Page - Create Account