Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 01:25:47 +0000



s_UseTool in multiple GraphRegions on same chart does not render

View Count: 566

[2020-07-06 03:44:39]
mm3599 - Posts: 13
I'm using the s_UseTool object on 2 studies.
One study is added to GraphRegion 0
Another study is added to GraphRegion 1

Each study uses the same method for creating a tool.

Study 1 Function:

s_UseTool CreateTextUseToolFunc(SCStudyGraphRef sc, SCString SDRangeValue, float loc, int Index) {

s_UseTool Tool;
Tool.Clear();
Tool.ChartNumber = sc.ChartNumber;
Tool.DrawingType = DRAWING_TEXT;
Tool.BeginIndex = Index;
Tool.BeginValue = loc;
Tool.LineNumber = Index;
Tool.Color = RGB(0,200,200);
Tool.Text = SDRangeValue;
Tool.LineWidth = 7;
Tool.Region = 0;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;

return Tool;
}

This calls function 1:

s_UseTool new_text_tool = CreateTextUseToolFunc(sc, Output1, Array_MACDP_PLL_SD3_Range_Location[sc.Index], sc.Index);
int line_number;
line_number = new_text_tool.LineNumber;
sc.UseTool(new_text_tool);

Study 2 Function:

s_UseTool CreateTextUseToolROCFunc(SCStudyGraphRef sc, SCString last_pll_roc_diff, float loc, int Index) {

s_UseTool Tool2;
Tool2.Clear();
Tool2.ChartNumber = sc.ChartNumber;
Tool2.DrawingType = DRAWING_TEXT;
Tool2.BeginIndex = Index;
Tool2.BeginValue = loc;
Tool2.LineNumber = Index;
Tool2.Color = RGB(0,200,200);
Tool2.Text = last_pll_roc_diff;
Tool2.LineWidth = 7;
Tool2.Region = 1;
Tool2.AddMethod = UTAM_ADD_OR_ADJUST;
return Tool2;

}

This calls function 2:

s_UseTool new_text_tool_roc = CreateTextUseToolROCFunc(sc, Output2, Array_Subgraph_ROC_Last_PLL_Diff_Location[sc.Index], sc.Index);
int line_number2;
line_number2 = new_text_tool_roc.LineNumber;
sc.UseTool(new_text_tool_roc);


The s_UseTool study added to GraphRegion 1:
a) does not render
b) causes the s_UseTool on GraphRegion 0 to not render

When I use s_UseTool on GraphRegion 0 by itself, s_UseTool renders correctly
Date Time Of Last Edit: 2020-07-06 13:22:17
[2020-07-06 04:40:54]
Sierra Chart Engineering - Posts: 104368
The structure member you are not setting is this:
Using Drawing Tools From an Advanced Custom Study: s_UseTool::Region
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
[2020-07-06 13:31:56]
mm3599 - Posts: 13
I added the new member to both studies. However now, the text rendering acts like a toggle. When one is present it shows the text from the s_UseTool; when the second is added the first s_UseTool no longer renders. When I remove the study one from the main graph, the study below starts to render.

I'm making sure the studies are in the appropriate regions (main price vs lower).

Version: 2113 64-bit(31507M)
[2020-07-06 19:40:32]
Sierra Chart Engineering - Posts: 104368
You must be doing something incorrectly. Possibly involving the LineNumber:
https://www.sierrachart.com/index.php?page=doc/ACSILDrawingTools.html#LineNumber
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: 2020-07-06 19:40:43

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

Login

Login Page - Create Account