Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 15:22:31 +0000



sc.BaseData array NOT readonly! (was Custom study causing changes to sc.BaseData arrays!)

View Count: 953

[2017-09-10 14:31:46]
binaryduke - Posts: 360
Hi SierraChart

Strange situation. I am coding a custom study and for some reason it is causing the sc.BaseData to be affected.

Image 1: Chart prior to custom study being applied featuring standard SC indicators: Numbers Bars (open/close marker in column 1 set to candlestick outline) + High/Low for time period
http://www.sierrachart.com/image.php?Image=1505053353860.png

Image 2: Custom study has been applied. The only thing this study is doing is checking if time is >= 09:00:00 (note this is when the high has become stuck) and performing some calculations based upon the relationships of sc.High[sc.Index], sc.Low[sc.Index], sc.Open[sc.Index] and sc.Close[sc.Index]. After application of the study, the standard SC indicators (Numbers Bars candlestick outline) are dealing with a 'stuck' high value. This can also be seen in the Chart Values Window.
http://www.sierrachart.com/image.php?Image=1505053817566.png

This has been tested on v1598 and v1605. Compilation using your remote compiler.

Please let me know what if anything I can provide you with to aid diagnosis. I can't begin to think what I can tell you about the study to assist as I cannot see how in any way an ACSIL study could affect the sc.BaseData array.

Thanks

Lee.
[2017-09-10 15:02:30]
binaryduke - Posts: 360
I have resolved this. I had a typo where I was comparing sc.High[sc.Index] to a variable. '>=' was mistyped as '='

However, I am surprised by this as the sc.BaseData documentation ACSIL Interface Members - Variables and Arrays: sc.BaseDataIn[][] / sc.BaseData[][] states:
Type: Read-only array of float arrays.

and I was inadvertently able to assign a new value to an sc.BaseData variable!
[2017-09-10 15:38:42]
Marmany - Posts: 303
Lee, for info >= is not accurate for comparing floating point numbers. Use sc.FormattedEvaluate with GREATER_EQUAL_OPERATOR.
[2017-09-10 16:03:26]
binaryduke - Posts: 360
Top tip - thanks!
[2017-09-10 21:27:11]
Sierra Chart Engineering - Posts: 104368
sc.BaseData is meant to be read only, but there is no compiler enforcement of that.

The custom study can modify the sc.BaseData of the chart.
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

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

Login

Login Page - Create Account