Support Board
Date/Time: Sun, 08 Sep 2024 00:14:59 +0000
Pointer error - Help with Tool.LineWidth[]
View Count: 362
[2022-09-25 13:57:03] |
User92573 - Posts: 519 |
Dear Support I'm using the SC Tool and have tried both the following: Tool.LineWidth[2] = Input_LineWidth_02.GetInt();
Tool.LineWidth[2] = 2; But I can't seem to solve the following error. error C2109: subscript requires array or pointer type
It's all very simple. SCInputRef Input_Level_02_LineWidth = sc.Input[2]; // array for line 2 width and in Set Defaults Input_Level_02_LineWidth.SetInt(2); // set the int value for line width, followed in the Processing section by either: Tool.LineWidth[2] = Input_LineWidth_02.GetInt(); // get width value for line 2 "Tool[2]" or Tool.LineWidth[2] = 2; // set directly width for Tool.LineWidth[2] which produces the above error: error C2109: subscript requires array or pointer type
What I can't understand is why even Tool.LineWidth[2] = 2; is causing an error?Any help appreciated. Many thanks |
[2022-09-25 14:14:08] |
Sierra_Chart Engineering - Posts: 16292 |
Use this instead: Tool.LineWidth = 2;
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 |
[2022-09-25 20:27:01] |
User92573 - Posts: 519 |
Thank you but there are 4 lines. SCInputRef Input_Level_01_LineWidth = sc.Input[2]; SCInputRef Input_Level_02_LineWidth = sc.Input[3]; SCInputRef Input_Level_03_LineWidth = sc.Input[4]; SCInputRef Input_Level_04_LineWidth = sc.Input[5]; I'd like to format them individually. I'm having no issue with .SetColor, or with values. Just the line width. If I use: Tool.LineWidth = 2;
It's not line specific? Many thanks. |
[2022-09-26 07:23:35] |
Sierra_Chart Engineering - Posts: 16292 |
Every Chart Drawing only has one width. We cannot say anything beyond that. We do not provide programming help.
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 |
[2022-09-26 12:04:45] |
User92573 - Posts: 519 |
I understand that but the tool I'm using here is the retracement which can have multiple levels, each of which is configurable. I can set the colour and value, for each level in the tool, which is then reflected in each drawing, however, I cannot set the line width which makes no sense when both the color and value, for each line, within the tool, can be set. Can you confirm this element is the one characteristic that is not available in the .tool, as it makes no sense? I'm sure it must be available, I'm just missing something. Many thanks. |
[2022-09-26 12:26:43] |
User431178 - Posts: 495 |
You need to use the Level... members to set retracement level properties. Using Drawing Tools From an Advanced Custom Study: s_UseTool::RetracementLevels[] Using Drawing Tools From an Advanced Custom Study: s_UseTool::LevelColor[] Using Drawing Tools From an Advanced Custom Study: s_UseTool::LevelWidth[] Using Drawing Tools From an Advanced Custom Study: s_UseTool::LevelStyle[] There are some examples in studies.cpp |
[2022-09-26 15:38:46] |
User92573 - Posts: 519 |
Brilliant. Thank you very much. Just what I was looking for. I couldn't believe it had been omitted as Sierra are pretty thorough. They have most things covered even though it can be difficult getting feedback - even for paid enhancements. :-) Out of interest have you replicated the SC Retracement tool as an ACSIL Study? Many thanks. |
To post a message in this thread, you need to log in with your Sierra Chart account: