Login Page - Create Account

Support Board


Date/Time: Sun, 06 Jul 2025 09:12:07 +0000



[Programming Help] - Implementation of AddAndManageSingleTextDrawingForStudy()

View Count: 37

[2025-07-01 00:23:12]
gambotage - Posts: 26
Hi guys,

I wanted to get clarification on why sc.AddAndManageSingleTextDrawingForStudy() is rendering output repeatedly to itself. Can you do a quick code review and offer any suggestions. I'm also experiencing performance issues once the study renders, guessing it renders every time the chart updates (300ms) per per Chart Settings > Performance.

What I'd like is the following:

1. A single stationary text label that supports transparency if user-preferred.
2. It populates the label if the chart is either fully loaded OR on bar close (or bar open if they're synonymous) for efficiency reasons if possible, & will render output of the last bar's data value calculations if looking back at historical data (I know s_UseTool doesn't appear to show historical values when backscrolling from current bar).

Here's a simple implementation:

if (sc.GetBarHasClosedStatus(sc.Index) == BHCS_BAR_HAS_CLOSED) { // Update label on bar close?
sc.AddAndManageSingleTextDrawingForStudy(
sc,
false,
Input_HorizontalPosition.GetInt(),
Input_VerticalPosition.GetInt(),
Subgraph_TextDisplay,
true, // transparent label background enabled
text,
sc.DrawStudyUnderneathMainPriceGraph ? 0 : 1
);
}

Thanks in advance!
Attachment Deleted.
imagetext-label.png / V - Attached On 2025-07-01 00:16:11 UTC - Size: 105 KB - 5 views

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

Login

Login Page - Create Account