Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 04:37:57 +0000



[Programming Help] - ACSIL - How to draw multiple lines on the chart and read price of line from another study

View Count: 286

[2024-04-03 04:39:26]
TraderSiva - Posts: 1
My requirement is as follows:

1. Draw multiple lines on the chart based on my own condition.
2. Retain line handles or something similar in a persistent array to delete lines when candle body closes through the lines.
3. I want to expose the remaining lines to another study in another chart.

So far, I figured out the following

1. I can draw multiple lines using sc.AddLineUntilFutureIntersection and delete sc.DeleteLineUntilFutureIntersection. But, I need to store the handle of these lines and delete when candle body closes not when it intersects with a wick.
2. I don't see a way to store an array with any of the in-built persistent methods.
3. I have written few studies to read subgraph from other studies from another chart. I also see this method sc.GetPersistentSCStringFromChartStudy to read persistent variables from another study. But, I'm figuring out a way to store the line/price array in the persistent storage first to read from another study. Worst case I will store the price array as a delimited string using
sc.GetPersistentSCString

Any help would be greatly appreciated, Thanks!
[2024-04-03 07:38:33]
emmanuel - Posts: 57
If you know the size of the array that you need, then you can use `sc.[Get|Set]PersistentPointer()` to dynamically allocate the memory for the array. See ACSIL Programming Concepts: Dynamic Memory Allocations Within Study Instance

If you need an "array" which grows dynamically, then you can use a vector from the standard C++ library. But memory allocation for classes is different in ACSIL. See ACSIL Programming Concepts: Allocating Memory for Classes

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

Login

Login Page - Create Account