Support Board
Date/Time: Thu, 08 Oct 2026 10:27:56 +0000
v2960 Cannot set Horizontal Ray TextColor from s_UseTool
View Count: 266
| [2026-09-27 16:28:58] |
| User719512 - Posts: 495 |
|
v2960 Cannot set Horizontal Ray TextColor from s_UseTool; or at least I am not seeing the change when looking at the v2960 scstructures.h s_UseTool changes. In v2957, the text color was same as the tool.Color. In v2960, I am seeing white and unable to change this from code. EDIT: I should clarify, that I set .TextColor and it had no effect. Date Time Of Last Edit: 2026-09-27 18:49:33
|
| |
| [2026-09-27 19:43:56] |
| User719512 - Posts: 495 |
|
Wrote a sample to create a new ray when at bar index scArraySize-10 and immediately read it back. I stepped through my code from when sc.UseTool was first called thru the next several lines. Code snippet constexpr uint32_t kTextColor = 0xeeddcc;
const int beginIndex = sc.ArraySize - 10; s_UseTool newRay; newRay.ChartNumber = sc.ChartNumber; newRay.DrawingType = DRAWING_HORIZONTAL_RAY; newRay.LineNumber = kDrawingLineNumber; newRay.AddMethod = UTAM_ADD_OR_ADJUST; newRay.Region = 0; newRay.BeginIndex = beginIndex; newRay.BeginValue = sc.Close[beginIndex]; newRay.Color = kLineColor; newRay.LineWidth = 1; newRay.Text = "TextColor probe"; newRay.TextColor = kTextColor; newRay.FontSize = 12; newRay.TransparentLabelBackground = 1; sc.UseTool(newRay); } s_UseTool chartDrawing; const int found = sc.GetACSDrawingByLineNumber( sc.ChartNumber, kDrawingLineNumber, chartDrawing ); // Breakpoint: chartDrawing.TextColor should be 0xeeddcc if Sierra kept it. found is 1 when the ray exists. const uint32_t readbackTextColor = chartDrawing.TextColor; (void)found; (void)readbackTextColor; Debugger watch newRay.TextColor 0x00eeddcc unsigned int readbackTextColor 0x00ffffff const unsigned int found 0x00000001 const int |
| [2026-09-28 15:23:42] |
| John - SC Support - Posts: 48143 |
|
We are not seeing an issue with the use of the TextColor member. We did a test to ensure it is working properly in version 2960, and it showed as expected. Here is the code we used (based on your own): #include "sierrachart.h" SCDLLName("Drawing Test") SCSFExport scsf_DrawingTest(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { return; } const int beginIndex = sc.ArraySize - 10; s_UseTool newRay; newRay.ChartNumber = sc.ChartNumber; newRay.DrawingType = DRAWING_HORIZONTAL_RAY; newRay.LineNumber = 1; newRay.AddMethod = UTAM_ADD_OR_ADJUST; newRay.Region = 0; newRay.BeginIndex = beginIndex; newRay.BeginValue = sc.Close[beginIndex]; newRay.Color = RGB(255, 0, 0); newRay.LineWidth = 1; newRay.Text = "TextColor probe"; newRay.TextColor = RGB(0, 255, 0); newRay.FontSize = 12; newRay.TransparentLabelBackground = 1; sc.UseTool(newRay); } And attached is an image of what we see when we add this to the chart. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
| |
| [2026-09-28 15:50:18] |
| User719512 - Posts: 495 |
|
Appreciate the follow up. This full sample code will demonstrate the issue. If you only draw the Tool a single time (controlled by a persistent), the text is white. If drawn a second time, it will turn from white to green. SCSFExport scsf_DrawingTest(SCStudyInterfaceRef sc) { int& r_MaxDrawCount = sc.GetPersistentIntFast(0); if (sc.SetDefaults) { return; } if (sc.Index == 0) { r_MaxDrawCount = 0; } // set this to 2, text will be green. set to 1 and it is white. constexpr int kMaxCount = 1; if (r_MaxDrawCount < kMaxCount) { ++r_MaxDrawCount; const int beginIndex = sc.ArraySize - 10; s_UseTool newRay; newRay.ChartNumber = sc.ChartNumber; newRay.DrawingType = DRAWING_HORIZONTAL_RAY; newRay.LineNumber = 1; newRay.AddMethod = UTAM_ADD_OR_ADJUST; newRay.Region = 0; newRay.BeginIndex = beginIndex; newRay.BeginValue = sc.Close[beginIndex]; newRay.Color = RGB(255, 0, 0); newRay.LineWidth = 1; newRay.Text = "TextColor probe"; newRay.TextColor = RGB(0, 255, 0); newRay.FontSize = 12; newRay.TransparentLabelBackground = 1; sc.UseTool(newRay); } } |
| [2026-09-29 14:14:20] |
| User719512 - Posts: 495 |
|
Here is an even better repro. Log ... | Created 1 * ... | chartDrawing1.TextColor 0x00FFFFFF, should be 0x0000FF00 (and it's probably 0x00FFFFFF) * ... | chartDrawing2.TextColor 0x0000FF00, should be 0x0000FF00 * Code SCSFExport scsf_DrawingTest(SCStudyInterfaceRef sc) { int& r_Created = sc.GetPersistentIntFast(0); if (sc.SetDefaults) { return; } if (sc.Index == 0) { r_Created = 0; } if (!r_Created) { ++r_Created; const int beginIndex = sc.ArraySize - 10; s_UseTool newRay; newRay.ChartNumber = sc.ChartNumber; newRay.DrawingType = DRAWING_HORIZONTAL_RAY; newRay.LineNumber = 1; newRay.AddMethod = UTAM_ADD_OR_ADJUST; newRay.Region = 0; newRay.BeginIndex = beginIndex; newRay.BeginValue = sc.Close[beginIndex]; newRay.Color = RGB(255, 0, 0); newRay.LineWidth = 1; newRay.Text = "TextColor probe"; newRay.TextColor = RGB(0, 255, 0); newRay.FontSize = 12; newRay.TransparentLabelBackground = 1; sc.UseTool(newRay); SCString msg; msg.Format("Created %d", newRay.LineNumber); sc.AddMessageToLog(msg, 1); s_UseTool chartDrawing1; const int found1 = sc.GetACSDrawingByLineNumber( sc.ChartNumber, 1, chartDrawing1 ); msg.Format("chartDrawing1.TextColor 0x%08X, should be 0x%08X (and it's probably 0x%08X)", chartDrawing1.TextColor, RGB(0, 255, 0), ~s_UseTool::DEFAULT_COLOR_VALUE ); sc.AddMessageToLog(msg, 1); // hack, get it, set color again chartDrawing1.TextColor = RGB(0, 255, 0); sc.UseTool(chartDrawing1); s_UseTool chartDrawing2; const int found2 = sc.GetACSDrawingByLineNumber( sc.ChartNumber, 1, chartDrawing2 ); msg.Format("chartDrawing2.TextColor 0x%08X, should be 0x%08X", chartDrawing2.TextColor, RGB(0, 255, 0) ); sc.AddMessageToLog(msg, 1); } } |
| [2026-10-01 23:27:02] |
| Sierra_Chart Engineering - Posts: 25103 |
|
This will be resolved in the next release.
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, use the Teton service: Sierra Chart Teton Futures Order Routing |
| [2026-10-02 16:56:22] |
| User719512 - Posts: 495 |
|
This will be resolved in the next release.
Confirming this is fixed in v2963. Thank you very much for investigating this and fixing. Hoping the fix was pretty easy and did not detract too much from all the important work with the double conversion. Upcoming Development and Internal Number Precision Improvement Project Another recompile of my custom studies against v2963, and all charts are working flawlessly. My studies do not exercise updated code with s_ACSNewOrder and such, so no feedback in those areas. |
To post a message in this thread, you need to log in with your Sierra Chart account:
