Login Page - Create Account

Support Board


Date/Time: Fri, 14 Mar 2025 19:20:34 +0000



[Programming Help] - How to retrieve Values for a USERDRAWN chart drawing

View Count: 462

[2022-06-26 12:59:01]
User353369 - Posts: 14
Anyone,
Granted I am a bit of noob but I press on. I am trying to retrieve the values BEGINVALUE ENDVALUE etc. I am able to get the index and lines numbers but not the values.

SCSFExport scsf_Retiever(SCStudyInterfaceRef sc)

{

// Declare SubGraphs and inputs here

if (sc.SetDefaults)

{

sc.GraphName = "Adjust User Drawn Drawing Example";



sc.GraphRegion = 0;





sc.UpdateAlways = 0;

sc.AutoLoop = 0;









//Code in this section

return;

}

// Data processing code

//The following code will get all of the Ray drawings on the chart and make them the 'Line Color ' Input color, change the width to 10, and move the starting point back by one bar. Since this function is continuously called with sc.UpdateAlways, this continuously occurs so you will see the Ray drawings continuously move back.

int DrawingIndex = 0;

s_UseTool DrawingObject;

s_UseTool CurrentDraw;

SCString DataString;



while (sc.GetUserDrawnChartDrawing(sc.ChartNumber, DRAWING_RECTANGLE_EXT_HIGHLIGHT, DrawingObject, DrawingIndex)) //DRAWING_RAY

{

//int BarIndex = sc.GetNearestMatchForSCDateTime(sc.ChartNumber, DrawingObject.BeginDateTime.GetAsDouble());



sc.UseTool(DrawingObject);



DataString.Format("BeginValue: %d, EndValue: %d, BarIndex: %d, Line#: %d ", DrawingObject.BeginValue, DrawingObject.EndValue, DrawingIndex, DrawingObject.LineNumber);

//DrawingObject.BeginDateTime = sc.BaseDateTimeIn[BarIndex - 1];

sc.AddMessageToLog(DataString, 0);

DrawingIndex++;



}

}
What an I missing or not understanding?

Thanks in advance
Skip

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

Login

Login Page - Create Account