Support Board
Date/Time: Thu, 16 Jan 2025 07:08:00 +0000
Post From: GetACSDrawingByLineNumber not working?
[2017-10-11 09:47:33] |
Sierra Chart Engineering - Posts: 104368 |
We have fixed the problem and this will be out in the next release in a day or two. But this is an example of how to add a user drawn drawing and modify it: SCSFExport scsf_UseToolExampleHorizontalLine(SCStudyInterfaceRef sc)
{ // Set configuration variables if (sc.SetDefaults) { sc.GraphName = "UseTool Example: Horizontal Line"; sc.GraphRegion = 0; sc.FreeDLL = 0; sc.AutoLoop = 0; //No automatic looping return; } int &r_LineNumber = sc.GetPersistentInt(1); if (sc.IsFullRecalculation) { if (r_LineNumber != 0) { sc.DeleteUserDrawnACSDrawing(sc.ChartNumber, r_LineNumber); r_LineNumber = 0; } //Draw horizontal line during full recalculation. s_UseTool Tool; Tool.Clear(); Tool.ChartNumber = sc.ChartNumber; //if (r_LineNumber != 0) //Tool.r_LineNumber = r_LineNumber; Tool.DrawingType = DRAWING_HORIZONTALLINE; Tool.DisplayHorizontalLineValue = 1; int DrawingIndex = sc.ArraySize - 4; Tool.BeginValue = sc.Close[sc.ArraySize - 1]; Tool.Region = 0; Tool.Color = RGB(255, 0, 255); // Magenta Tool.LineWidth = 4; Tool.AddMethod = UTAM_ADD_ALWAYS; Tool.AddAsUserDrawnDrawing = 1; sc.UseTool(Tool); r_LineNumber = Tool.LineNumber; } else if (sc.UpdateStartIndex < sc.ArraySize - 1)//When there is a new bar { //Now move the drawing to the current closing price when a new bar has been added to the chart s_UseTool Tool; ///No need for this //sc.GetUserDrawingByLineNumber(sc.ChartNumber, LineNumber, Tool); Tool.Clear(); Tool.ChartNumber = sc.ChartNumber; Tool.BeginValue = sc.Close[sc.ArraySize - 1]; Tool.AddMethod = UTAM_ADD_OR_ADJUST; Tool.LineNumber = r_LineNumber; Tool.AddAsUserDrawnDrawing = 1; sc.UseTool(Tool); } } 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: 2017-10-11 09:47:59
|