Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 18:33:35 +0000



sc.ApplyStudyCollection() ACSIL function

View Count: 758

[2019-08-18 14:28:43]
kas64h - Posts: 87
Is there any documentation for the new sc.ApplyStudyCollection() ACSIL function released in version 1973?
I thought it would allow a named Study Collection to be applied to a Chart, but it only seems to take a ChartNumber parameter, and doesn't seem to do anything when I try using it in code.

Thanks
[2019-08-18 23:09:40]
Sierra Chart Engineering - Posts: 104368
This had gotten overlooked. The function is not yet implemented and it is not complete with its parameters. We will finish it today.
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
[2019-08-20 11:14:30]
kas64h - Posts: 87
After your previous post, I can see the StudyCollectionFileName parameter has now been added (version 1977), but I'm unsure if your work on this function is finished as I'm still getting problems.
I created a Study Collection with the name 'StudyColTest' consisting of just a Simple Moving Average. I tested it by just adding it to a Chart in the usual way from the 'Analysis' Menu, and it works fine.

I then tried adding it using the function, i.e. sc.ApplyStudyCollection(sc.ChartNumber, "StudyColTest"); - but am getting the following issues:

1) The function is causing an Access Violation, resulting in the following line in the Message Log: XG# 4 Min #9 | Caught an unhandled exception in c_Chart::WindowProc. Message: 32769, wParam: 18934, lParam: 0 | 2019-08-20 11:05:27.880 *

2) I put the function in a try block and the Study Collection was added, but the Simple Moving Average added was clearly corrupted, with some Study Inputs simply missing etc.

3) This highlighted another issue which I'll admit is more of an enhancement rather than a bug, but would be useful considering the context of the function.
All existing Studies in the Studies to Graph list were automatically removed by the function.
Obviously the Study Collection can be set to 'Prompt to Remove Existing Studies', but naturally this requires a User response.
It would be useful if the function had a third parameter - something like: Remove Existing Parameters (0/1)

4) I noticed if I included the file extension of the StudyCollection FileName, i.e. sc.ApplyStudyCollection(sc.ChartNumber, "StudyColTest.StdyCollct"); it cannot find the file and crashes the application with the following 2 lines in the Message Log:

Error opening study collection file: C:\SierraChart\Data\StudyColTest.StdyCollct.StdyCollct. Windows error code 2: The system cannot find the file specified. | 2019-08-20 11:46:14.187 *
XG# 4 Min #9 | Caught an unhandled exception in c_Chart::WindowProc. Message: 32769, wParam: 18934, lParam: 0 | 2019-08-20 11:46:20.843 *

A similar thing happens if the StudyCollection FileName doesn't exist on the system.

Thanks
[2019-08-20 16:16:04]
Sierra Chart Engineering - Posts: 104368
We did not yet have a chance to test the function and it is clear it needs more work and a different implementation.

We will make sure there is no prompt for removing existing studies and add a parameter to control that.
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: 2019-08-20 16:16:35
[2019-08-20 18:16:21]
kas64h - Posts: 87
Okay.
Also for clarity, the application only crashes when attempting to add a Study Collection to the same Chart (which is actually what I'd like to use it for), so this appears to be the root of the problem.
Adding a Study Collection using the function to a different Chart works fine.
Hope this helps.

Thanks
[2019-08-29 10:08:49]
Sierra Chart Engineering - Posts: 104368
In version 1982 coming out today, sc.ApplyStudyCollection has been fully reimplemented.
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: 2019-08-29 10:09:19
[2019-08-29 16:22:04]
kas64h - Posts: 87
I downloaded version 1982 about an hour ago, and the function no longer crashes the app.
However, it doesn't seem to do anything at all - i.e. the study collection does not get added to the chart, and no messages are logged.
The code I'm using is pretty simple (and is getting hit), i.e. sc.ApplyStudyCollection(sc.ChartNumber, "StudyColTest", 0); plus a number of variations with different chart numbers, file extn included, overwrite etc., and nothing happens?

Thanks.
[2019-08-30 06:55:11]
Sierra Chart Engineering - Posts: 104368
This will be solved in the next release. We did not have a chance to test it but we did earlier today and corrected the problem.
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: 2019-08-30 06:55:57

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

Login

Login Page - Create Account