Login Page - Create Account

Support Board


Date/Time: Mon, 17 Mar 2025 18:17:49 +0000



[Programming Help] - What happens when an object goes to the end after updating

View Count: 818

[2022-09-16 02:51:26]
JohnR - User831573 - Posts: 320
As I go through the objects, is it safe to assume there are no missing numbers in the sequence? Stated another way can I presume once I get to a failed read attempt, I have read all of the objects of the desired type?

Using Drawing Tools From an Advanced Custom Study: sc.GetUserDrawnChartDrawing()
Also, in the docs it states--> Be aware that when a Chart Drawing is modified, it is put at the end of the list. So in this case if you modify a Chart Drawing, it is going to be put at the end of the list, and be the one that is considered last added.

So, as I am going through the list of drawn objects, if I modify object # 3, and it goes to the end of the list, does that mean that #4 is moved up into the #3 slot? If so, I will I miss looking at #4, as I update the index counter at the end of the loop?

I am looking at the scsf_AdjustUserDrawnDrawingExample in Studies.cpp

int DrawingIndex = 0;
s_UseTool DrawingObject;
while( sc.GetUserDrawnChartDrawing(sc.ChartNumber, DRAWING_HORIZONTAL_RAY , DrawingObject, DrawingIndex) )
{
  DrawingObject.Color =sc.Input[0].GetColor();
  DrawingObject.LineWidth = 10;
  int BarIndex = sc.GetNearestMatchForSCDateTime(sc.ChartNumber, DrawingObject.BeginDateTime.GetAsDouble());
  DrawingObject.BeginDateTime = sc.BaseDateTimeIn[BarIndex -1];
  DrawingObject.AddMethod = UTAM_ADD_OR_ADJUST;
  sc.UseTool(DrawingObject);
  DrawingIndex++;  
}

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

Login

Login Page - Create Account