Login Page - Create Account

Support Board


Date/Time: Fri, 18 Oct 2024 05:36:10 +0000



sc.GetLineNumberOfSelectedUserDrawnDrawing() works but not for drawing from other chart.

View Count: 289

[2024-06-17 20:00:24]
User629079 - Posts: 7
Hello, SierraChart works Great! :-)

To the meritum.

Using ACSIL, I want to modify currently selected user drawn drawing in currently active chart window.
I know that there is a function sc.GetLineNumberOfSelectedUserDrawnDrawing() but it works in limited way.
eg.: if I have selected user drawn drawing in chart#3 but this drawing comes from chart#2 (because of setting "Copy chart Drawings From Chart #'s") then function sc.GetLineNumberOfSelectedUserDrawnDrawing() returns zero. So, it doesn't help.

Solution 1:
Could You add variables:
sc.LineNumberOfSelectedUserDrawnDrawing
and
sc.SourceChartNumberOfSelectedUserDrawnDrawing
as a members to the structure of sc.

With help of sc.ChartWindowIsActive (already implemented) It would make possible to properly point and then modify selected user drawn drawing which is a copy drawing from other chart.

Solution 2:
Could You add function:
sc.GetSelectedUserDrawnDrawing(int ChartNumber, s_UseTool& ChartDrawing); which will first check if in the Chart ChartNumber is any user drawn drawing selected, regardless if that drawing comes from this Chart or from any other Chart. If there is any selected user drawn drawing, then fulfill s_UseTool& ChartDrawing
or
sc.GetSelectedUserDrawnDrawing(s_UseTool& ChartDrawing);

Thank You.
Date Time Of Last Edit: 2024-06-17 20:09:48
[2024-07-10 19:43:09]
Sierra_Chart Engineering - Posts: 16656
We can add:

sc.GetLineNumberOfSelectedUserDrawnDrawingFromChart(const int ChartNumber, s_UseTool& ChartDrawing);
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
[2024-07-13 21:32:34]
User629079 - Posts: 7
Yes, It would be great.

Returning the Selected UserDrawnDrawing in s_UseTool& ChartDrawing will totally solve the problem and even it will totally simplify it.


Then with this new function sc.GetLineNumberOfSelectedUserDrawnDrawingFromChart(const int ChartNumber, s_UseTool& ChartDrawing) I will just put:
- sc.ChartWindowIsActive as an input argument
- Fresh/Clean s_UseTool as an input argument by reference
and in return I will get s_UseTool of just Selected (by mouse) UserDrawnDrawing and this s_UseTool is ready for modifying its parameters (colors, position, ...). Even if that drawing originally comes from other chart, what is an issue in sc.GetLineNumberOfSelectedUserDrawnDrawing().

Thank You.
[2024-07-17 16:49:52]
Sierra_Chart Engineering - Posts: 16656
The new function will be out 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
[2024-07-28 15:45:16]
User629079 - Posts: 7
Hello,
(Sierrachart ver 2661, Win10)

I have tested this new (GetSelectedUserDrawnDrawingFromChart) function and it does not work as it supposed to. There are three issues.

1. Very easy issue is that new implemented function throws an exception when there is none drawing selected. Intuitively it should:
case a) when there is any selected drawing then function should return 1 and update the s_UseTool& ChartDrawing
case b) when there is none selected drawing then function should return 0 and NOT update the s_UseTool& ChartDrawing, but in this case unfortunately it throws an exception.
If function cannot find selected drawing then do not throw an exception, just return zero as an indication that there was none selected drawing found.


2. Medium issue is that it automatically changes the position of the drawing in horizontal.
Example: I just want to change ONLY the color of selected drawing to red in chart 1.
and, here is the simple code which do this:
  s_UseTool ChartDrawing;
  if (sc.GetSelectedUserDrawnDrawingFromChart(1, ChartDrawing))
  {
    ChartDrawing.Color = RGB(255, 0, 0);
    sc.UseTool(ChartDrawing);
  }
result:
It changes the selected drawing to color red (which is correct), but unfortunately additionally it moves that drawing to the left by 2hours.
Probably it is an issue related with timezone (this is my guess, maybe I am wrong).
I use only Global timezone in my charts and in my case it is Brussel +2h.
New function GetSelectedUserDrawnDrawingFromChart probably updates s_UseTool& ChartDrawing with SCDateTimeMS BeginDateTime, EndDateTime, ThirdDateTime in UTC timezone instead of ChartNumber's timezone.
If my suspicion is correct, please correct the updating of s_UseTool& ChartDrawing by converting (BeginDateTime, EndDateTime, ThirdDateTime) from UTC timezone to ChartNumber' timezone.



3. Main issue: new function is able to find selected drawings but still ONLY these which belongs to the particular chart. Simple example:
In Chart 1 manually I draw 5 TRIANGLES
In Chart 2 manually I draw 5 RECTANGLES
In Chart 2 I use feature: (Chart Settings -> Chart Drawings -> Copy Chart Drawings From Chart #'s = 1) to copy drawings from Chart 1 to Chart 2
so,
In Chart 1 I see only 5 TRIANGLES
In Chart 2 I see 5 RECTANGLES and additional 5 TRIANGLES which are copied from Chart 1
and now,
case a) If (simply by mouse click) I select TRIANGLE in Chart 1 then the new function GetSelectedUserDrawnDrawingFromChart(1, ChartDrawing) works well. Return 1 and s_UseTool& ChartDrawing is updated with selected TRIANGLE's data.
case b) If (simply by mouse click) I select RECTANGLE in Chart 2 then the new function GetSelectedUserDrawnDrawingFromChart(2, ChartDrawing) works well. Return 1 and s_UseTool& ChartDrawing is updated with selected RECTANGLE's data.
case c) If (simply by mouse click) I select TRIANGLE in Chart 2 then the new function GetSelectedUserDrawnDrawingFromChart(2, ChartDrawing) does NOT work. It should: Return 1 and s_UseTool& ChartDrawing should be updated with selected TRIANGLE's data.
Date Time Of Last Edit: 2024-07-30 13:45:58
[2024-07-28 18:31:36]
Sierra_Chart Engineering - Posts: 16656
The function is GetSelectedUserDrawnDrawingFromChart. There is no function by the name that you gave.

Regarding:
1, 2. This was an oversight and will be fixed in the next release.

3. Yes this is true. It is not going to get copied drawings. This is our understanding of what you required. Should not be a problem to get a copied drawing from a chart.
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
Date Time Of Last Edit: 2024-07-28 18:46:31
[2024-07-30 14:43:57]
User629079 - Posts: 7
Sorry for using wrong name of the function. My mistake.
Already I have edited post #5 with the correct function's name (GetSelectedUserDrawnDrawingFromChart)


3. case c) Yes, this is the main problem. This is the reason why I asked to create new function:
I am not able to get drawing (s_UseTool& ChartDrawing) which
I see in chart (const int ChartNumber) and
in this chart (const int ChartNumber) it is selected but
this drawing originally do not belongs to this chart (const int ChartNumber) because it comes as a copy from another chart.

If this is not difficult to implement in this new function (GetSelectedUserDrawnDrawingFromChart), please implement it. I do not see any other possibilities. I have tried.

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

Login

Login Page - Create Account