Support Board
Date/Time: Fri, 09 May 2025 14:04:58 +0000
Programatically check if a Symbol is valid - ACSIL
View Count: 936
[2016-09-03 10:49:11] |
William O - Posts: 16 |
How do I check if a string representing a symbol is valid and can be successfully used as input when submitting an order for another chart? In my case I will be submitting orders for a different symbol than the chart the study is on. Some logic should only execute if the different symbol is valid. For example, in a study a user enters the name of 2 symbols(SYMA, SYMB) as input. If SYMA and SYMB are both valid and can accept orders then the study will execute the logic to do that. If either SYMA or SYMB are invalid and cannot accept orders then I do not want the study to execute any logic to submit orders for either symbol. The situation I want to avoid is where SYMA is valid and SYMB is invalid, and the study submits an order for SYMA but cannot for SYMB. Thanks for your help. |
[2016-09-03 11:39:50] |
|
There is no way to verify a particular symbol is valid or not. If you submit a live order for an invalid symbol, it will get rejected by the trading service.
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-09-03 11:43:12] |
|
However, you could potentially use this function: sc.GetBasicSymbolData And see if you get a nonzero last trade price for the symbol. This is a way to possibly see if the market is open for the symbol and indirectly indicate if it is valid. But it can take a few seconds to get a nonzero price initially after the symbol has just been subscribed to. 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: 2016-09-03 11:43:40
|
To post a message in this thread, you need to log in with your Sierra Chart account: