Support Board
Date/Time: Wed, 15 Jan 2025 21:44:14 +0000
Code using UseTool and DRAWING_TEXT not working in 1609 vs 1595
View Count: 976
[2017-09-19 04:19:34] |
binaryduke - Posts: 373 |
Hi Sierra Chart Something seems to have changed since 1595 to 1609 that is affecting code using drawing tools to draw text. I plan to deconstruct the affected code to find out exactly and will advise but ahead of this, do you have any changes that have been made between these releases that could have affected UseTool and DRAWING_TEXT? The code below works fine in 1595 but not in 1609: s_UseTool displaytext; displaytext.Clear(); displaytext.ChartNumber = sc.ChartNumber; displaytext.Region = sc.GraphRegion; displaytext.DrawingType = DRAWING_TEXT; displaytext.TextAlignment = DT_CENTER; displaytext.FontSize = 10; displaytext.ReverseTextColor = 1; displaytext.Color = RGB(0,0,255); displaytext.BeginIndex = sc.Index; if (sc.Index == sc.ArraySize - 1) displaytext.AddMethod = UTAM_ADD_OR_ADJUST; else displaytext.AddMethod = UTAM_ADD_ALWAYS; displaytext.BeginValue = sc.High[sc.Index] + (2 * sc.TickSize); displaytext.Text = output; sc.UseTool(displaytext); Thanks Lee. |
[2017-09-19 04:27:01] |
Sierra Chart Engineering - Posts: 104368 |
This code works just fine. Just test it on its own and use hardcoded text for displaytext.Text to rule out any problems with whatever text string you are using.
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 |
[2017-09-19 04:28:46] |
binaryduke - Posts: 373 |
OK. This forms part of a function into which the text is passed. I will start investigating and advise what code is causing the change between 1595 and 1609.
|
[2017-09-19 18:49:45] |
binaryduke - Posts: 373 |
For your reference: 1. Our code (snippet above) was compiled using your remote compiler in v1593 2. This stopped working in versions >= v1599 3. We have just recompiled using the remote compiler (v1609) and it now works as it should in v1599 |
[2017-09-19 19:01:51] |
Sierra Chart Engineering - Posts: 104368 |
This does not mean anything to us. We see no reason why there would be a problem at all. The remote compiler is the same for all versions since it is on a server. The only difference is the header file used and the header file is not going to effect the text strings. It makes no sense for this to be version specific. This is not something that we can understand or help with because we do not have access to your code. 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 |
[2017-09-20 05:08:54] |
Sierra Chart Engineering - Posts: 104368 |
This is really not making sense. We do not believe for a second that if we took this code: s_UseTool displaytext;
displaytext.Clear(); displaytext.ChartNumber = sc.ChartNumber; displaytext.Region = sc.GraphRegion; displaytext.DrawingType = DRAWING_TEXT; displaytext.TextAlignment = DT_CENTER; displaytext.FontSize = 10; displaytext.ReverseTextColor = 1; displaytext.Color = RGB(0,0,255); displaytext.BeginIndex = sc.Index; if (sc.Index == sc.ArraySize - 1) displaytext.AddMethod = UTAM_ADD_OR_ADJUST; else displaytext.AddMethod = UTAM_ADD_ALWAYS; displaytext.BeginValue = sc.High[sc.Index] + (2 * sc.TickSize); displaytext.Text = "Test"; sc.UseTool(displaytext); And used it with the Remote Build command in versions 1599 through 1608, that there would be any problem with it executing as designed. There simply is no difference with building between those versions. And there really are not any header file changes. Only new structure members added, if any. It all of our experience, inconsistencies like you are describing generally are the cause of the study itself causing a memory corruption or doing something incorrectly and therefore having inconsistent behavior. 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: 2017-09-20 05:10:38
|
[2017-09-20 06:20:15] |
binaryduke - Posts: 373 |
I agree 100%. All I can point to is my direct experience that: - a study which was compiled in v1593 exhibited the non-working UseTool behaviour in v1599 onwards - but when compiled in v1609, it worked fine The only difference I can attribute this to its the header file. I also do not think it relates in any way to UseTool. I notice that in v1599, you increased the number of persistent variables per data type in ACSIL from 5000 to 50,000. The study makes use of persistent variables. v1599 was the version from which the study's UseTool routine stopped displaying. The code snippet above forms part of a function in which the LineNumber for UseTool is stored in a persistent variable to enable the drawing to be subsequently deleted. I can well imagine that some change in persistent variable handling from v1599 was the cause. I'm unconcerned as everything works correctly since recompiling. While it would be nice to pin down the exact cause, I can understand that this is work on both our sides. If it's something you'd like to investigate further however, I'll be happy to provide sample code (privately) that demonstrates the behaviour pre-v1599 and post. Just let me know. |
[2017-09-21 05:26:06] |
Sierra Chart Engineering - Posts: 104368 |
We do not think this relates to persistent variables. Essentially the handling is the same. There was no practical difference. Persistent variables are stored in an STL map. The interface to it is very straightforward and simple. We will just let this go for now. It is more likely the problem has to do with the particular generated code by the compiler. But the compiler is the same across versions. And we do not see why some very small differences in the header file would make a difference. 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 |
[2017-09-21 08:19:30] |
Marmany - Posts: 307 |
For info I recently updated from v1594 to v1611 and found the text display on one of my studies (compiled Aug 2017) no longer appeared. I re-compiled the study using remote build to resolve the issue. On this study there are 128 lines of code between s_UseTool Tool and sc.UseTool, if required for investigation I will supply the study code. Found it strange that the problem only occurred on one of the 10 custom studies I run, so to be on the safe side I re-compiled them all. |
To post a message in this thread, you need to log in with your Sierra Chart account: