Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 23:34:09 +0000



[Programming Help] - ACSIL How to identify a study?

View Count: 352

[2024-01-28 15:12:09]
User43 - Posts: 101
Based on the type of a study different actions are to be taken.
Therefore I'm looking to identify a study.
Outside of ACSIL in the "Studies to Graph" panel I can see the short name, the original name, as well as the S_ID.

But inside ACSIL so far I figured only out how to get the short name, which does not tell me which study I found.
This is important to know when planning to make adjustments via ACSIL to the study inputs.

Either options (Type: 1=short, 2=orig, 3=s_id) for the existing functions to allow which name to deliver are needed,

sc.GetStudyName(int StudyIndex, int Type)
sc.GetStudyNameFromChart(int ChartNumber, int StudyID, int Type)
sc.GetStudyNameUsingID(unsigned int StudyID, int Type)
sc.GetStudyInternalIdentifier(int ChartNumber, int StudyID, int Type, SCString& r_StudyName)

or new functions specific to the request
e.g.

sc.GetStudyName() // for the original name
sc.GetStudyShortName() // for the short name
sc.GetStudySID() // for the S_ID

Please advise, Thanks
[2024-01-28 20:26:52]
User719512 - Posts: 264
Doesn't this always give the actual sc.GraphName of a study?

sc.GetStudyInternalIdentifier()

It was added in v2484 as was https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scGetBuiltInStudyName.

Both seem to be lacking more details about their usage or examples.
[2024-01-29 00:22:57]
User43 - Posts: 101
In my test sc.GetStudyInternalIdentifier() also returned the short name.

Also that is one of the functions which is poorly documented.
[2024-01-29 14:28:10]
User43 - Posts: 101
I updated to the latest version 2586 64-bit revision 48734M
and wrote a little test study.
The attached screen shot shows the studies I've on my chart,
and below is the result of using the different functions.

All of them return the Short Name if set.


i=0
GetStudyName=MESH24_FUT_CME [CBV][M] 1000 Volume #1
GetStudyNameFromChart=MESH24_FUT_CME [CBV][M] 1000 Volume #1
GetStudyNameUsingID=MESH24_FUT_CME [CBV][M] 1000 Volume #1
GetStudyInternalIdentifier=MESH24_FUT_CME [CBV][M] 1000 Volume #1
i=1
GetStudyName=MESH24_FUT_CME [CBV][M] 1000 Volume #1 Heikin-Ashi
GetStudyNameFromChart=Time Range Highlight
GetStudyNameUsingID=Time Range Highlight
GetStudyInternalIdentifier=Time Range Highlight
i=2
GetStudyName=Time Range Highlight
GetStudyNameFromChart=Time Range Highlight
GetStudyNameUsingID=Time Range Highlight
GetStudyInternalIdentifier=Time Range Highlight
i=3
GetStudyName=Time Range Highlight
GetStudyNameFromChart=HULL fast
GetStudyNameUsingID=HULL fast
GetStudyInternalIdentifier=HULL fast
i=4
GetStudyName=HULL fast
GetStudyNameFromChart=HULL slow
GetStudyNameUsingID=HULL slow
GetStudyInternalIdentifier=HULL slow
i=5
GetStudyName=HULL slow
GetStudyNameFromChart=SIG 1
GetStudyNameUsingID=SIG 1
GetStudyInternalIdentifier=SIG 1
i=6
GetStudyName=SIG 1
GetStudyNameFromChart=SIG 2
GetStudyNameUsingID=SIG 2
GetStudyInternalIdentifier=SIG 2
i=7
GetStudyName=SIG 2
GetStudyNameFromChart=ATR
GetStudyNameUsingID=ATR
GetStudyInternalIdentifier=ATR
i=8
GetStudyName=ATR
GetStudyNameFromChart=
GetStudyNameUsingID=
GetStudyInternalIdentifier=
i=9
GetStudyName=SIG 2 TH LONG
GetStudyNameFromChart=SIG 2 TH LONG
GetStudyNameUsingID=SIG 2 TH LONG
GetStudyInternalIdentifier=SIG 2 TH LONG
i=10
GetStudyName=SIG 2 TH SHORT
GetStudyNameFromChart=SIG 2 TH SHORT
GetStudyNameUsingID=SIG 2 TH SHORT
GetStudyInternalIdentifier=SIG 2 TH SHORT
i=11
GetStudyName=Test GetStudyName
GetStudyNameFromChart=MESH24_FUT_CME [CBV][M] 1000 Volume #1 Heikin-Ashi
GetStudyNameUsingID=MESH24_FUT_CME [CBV][M] 1000 Volume #1 Heikin-Ashi
GetStudyInternalIdentifier=MESH24_FUT_CME [CBV][M] 1000 Volume #1 Heikin-Ashi
i=12
GetStudyName=
GetStudyNameFromChart=Test GetStudyName
GetStudyNameUsingID=Test GetStudyName
GetStudyInternalIdentifier=Test GetStudyName


SCSFExport scsf_TestGetStudyName(SCStudyInterfaceRef sc) {
SCString MesTxt;

if (sc.SetDefaults) {
// Set the configuration and defaults

sc.GraphName = "Test GetStudyName";

sc.StudyDescription = "Testing functions to retrieve study names. "
"sc.GetStudyName(), sc.GetStudyNameFromChart(), sc.GetStudyNameUsingID() "
"sc.GetStudyInternalIdentifier(), looking for one function to return "
"the original name of a study, not the short name.";
}

if (sc.IsFullRecalculation && sc.Index == 0) {
for (int i=0; i<20; i++) {
MesTxt.Format("i=%i - ", i);
MesTxt.Append("GetStudyName=");
MesTxt.Append(sc.GetStudyName(i));
MesTxt.Append(" - GetStudyNameFromChart=");
MesTxt.Append(sc.GetStudyNameFromChart(sc.ChartNumber, i));
MesTxt.Append(" - GetStudyNameUsingID=");
MesTxt.Append(sc.GetStudyNameUsingID(i));
MesTxt.Append(" - GetStudyInternalIdentifier=");
SCString StrTmp;
sc.GetStudyInternalIdentifier(sc.ChartNumber, i, StrTmp);
MesTxt.Append(StrTmp);
sc.AddMessageToLog(MesTxt, 0);
}
}
}

imageSierraChart_64_fUoI1YIDVI.png / V - Attached On 2024-01-29 14:20:32 UTC - Size: 45.38 KB - 66 views

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

Login

Login Page - Create Account