Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 02:23:22 +0000



ASCIL: Left values of SCString

View Count: 1018

[2017-03-16 17:08:38]
6c7574686572 - Posts: 20
I am making a custom indicator to display the symbol on the cart. I only want to display the leftmost 4 characters:

e.g.

sc.Symbol returns "CLJ7-NYMEX"
I want to display "CLJ7"

Thanks in advance.
[2017-03-16 18:35:02]
Sierra Chart Engineering - Posts: 104368
You can use this function:
SCString SCString::Left(int Count)
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: 2017-03-16 18:35:28
[2017-03-16 19:17:56]
6c7574686572 - Posts: 20
Thanks - the below finally worked for me


SCString SymbolDisplay = "";
SymbolDisplay = sc.Symbol;
SymbolDisplay = SymbolDisplay.Left(4);

[2017-03-18 08:59:27]
Marmany - Posts: 301
For info this code can be condensed to 1 line:

SCString SymbolDisplay = sc.Symbol.Left(4);

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

Login

Login Page - Create Account