Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 06:06:31 +0000



Share a drawing tool across charts

View Count: 2079

[2013-06-28 18:26:22]
maxpi - Posts: 175
I have an ACSIL study that produces a tool drawing on chart #1 at times. I'd like to replicate that drawing to chart #2. Quite possibly I missed something but it appears that the only way I can do that is to have a study running on chart #2 receiving the tool parameters from the study on chart #1. Am I correct in that? Overlaying the study from chart #1 to chart #2 and specifying Tool.ChartNumber = 2 in the study running on chart #1 doesn't seem to produce the drawing on chart #2, I thought that worth a try at least.

Passing the parameters from one study to another seemingly can be done by writing a text file or sharing a SCSubgraphRef? It really would be super nice if a variable could be shared between studies directly but from what I read that complicates things..
[2013-06-28 21:38:11]
Sierra Chart Engineering - Posts: 104368
Tool.ChartNumber = 2
This does work. We tested it. This is how you should do it.

Persistent Variables are shareable across charts.:
https://www.sierrachart.com/index.php?l=doc/doc_ACSIL_Members.html#scGetStudyPersistentVariablesFromChartUsingID
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
[2013-06-28 21:52:39]
Sierra Chart Engineering - Posts: 104368
Thinking about this some more, putting a custom study drawing on one chart from another chart by using Tool.ChartNumber no longer is going to work properly and we have not considered this scenario with changes over the last couple of years. So we really do have to remove support for that.
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: 2013-06-28 21:53:16
[2013-06-28 22:08:43]
Sierra Chart Engineering - Posts: 104368
It is still supported for a study to put a chart drawing on a chart other than its own if it sets s_UseTool::AddAsUserDrawnDrawing to a nonzero number.

Refer to the documentation for this member.
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
[2013-06-28 22:28:58]
maxpi - Posts: 175
The following code won't compile: [The ACS source folder is not in the typical location, doubt that is a problem]

Tool.Clear(); // reset tool structure for our next use
Tool.ChartNumber = 3;
Tool.DrawingType = DRAWING_LINE;
Tool.LineNumber = UniqueLineNumber +16;
int BarIndex = max(0, sc.ArraySize - 90);
Tool.BeginDateTime = sc.BaseDateTimeIn[sc.Index -111];
Tool.BeginValue = sc.Open[BarIndex];
BarIndex = max(0, sc.ArraySize - 60);
Tool.EndDateTime = sc.BaseDateTimeIn[sc.Index];
Tool.EndValue = sc.Open[BarIndex];
Tool.Color = RGB(0,128,0);
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
s_UseTool::AddAsUserDrawnDrawing = 1;
sc.UseTool(Tool);

Build Output:

-- Starting build of Custom Studies Source File: ASystem.cpp. -- 15:25:23
"C:\SierraChart\CPPCompiler\bin\g++.exe" "C:\SierraChart\ACS_Source\ASystem.cpp" -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -o "C:\Barchart\Data\ASystem.dll"

In file included from C:\SierraChart\ACS_Source\ASystem.cpp:2:0:
C:\SierraChart\ACS_Source\sierrachart.h: In function 'void scsf_ASystem(SCStudyInterfaceRef)':
C:\SierraChart\ACS_Source\sierrachart.h:960:7: error: invalid use of non-static data member 's_UseTool::AddAsUserDrawnDrawing'
C:\SierraChart\ACS_Source\ASystem.cpp:314:18: error: from this location
-- End of Build -- 15:25:23
Date Time Of Last Edit: 2013-06-28 22:30:04
[2013-06-28 22:59:07]
Sierra Chart Engineering - Posts: 104368
Tool.AddAsUserDrawnDrawing = 1;
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
[2013-06-30 22:43:02]
maxpi - Posts: 175
OK, I can put a tool drawing on another chart but I can't assign a unique line number to it. I can get just one drawing on a chart iow, because the recipient chart is assigning the line number?
[2013-06-30 23:04:25]
Sierra Chart Engineering - Posts: 104368
If you are setting:
Tool.AddMethod = UTAM_ADD_OR_ADJUST;

then you will only be able to add one line if you are using the same 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: 2013-06-30 23:04:33

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

Login

Login Page - Create Account