Login Page - Create Account

Support Board


Date/Time: Fri, 09 May 2025 17:33:50 +0000



Need help formatting sc.SetAlert() message output

View Count: 1183

[2016-08-16 04:10:32]
User147461 - Posts: 33
Trying to convert an alert message output from TS to SC

EasyLanguage code:
Alert("ABC Sell Signal for " + GetSymbolName + " at " + NumToStr(Close, 2));

TS alert message output example:
ABC Sell Signal for ESU16 at 2190.75

I didn't expect this code to compile but describes the output desired:
sc.SetAlert(sc.SelectedAlertSound, "ABC Sell Signal for ", sc.Symbol.GetChars(), " at ", sc.Close[sc.Index]);

Is this possible to convert to SC?

Thank you!
[2016-08-16 19:09:39]
Sierra Chart Engineering - Posts: 104368
Yes this is fully possible to do using the standard Format function on the SCString. Refer to:

http://www.sierrachart.com/index.php?page=doc/ACSILProgrammingConcepts.html#FormattedTextString
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
[2016-08-17 05:57:46]
User147461 - Posts: 33
Thanks for the link! Got it working.


SCString AlertMessageString;

AlertMessageString.Format("%s %s %s %.2f", "ABC Sell Signal for", sc.Symbol.GetChars(), "at", sc.Close[sc.Index]);
sc.SetAlert(sc.SelectedAlertSound, AlertMessageString);

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

Login

Login Page - Create Account