Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 23:24:26 +0000



Post From: sc.ApplyStudyCollection() ACSIL function

[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