Login Page - Create Account

Support Board


Date/Time: Fri, 13 Jun 2025 07:43:04 +0000



Post From: Programming Help ACSIL

[2022-11-07 00:36:46]
User183724 - Posts: 194
working though the ACSIL examples on SC website

Using Drawing Tools From an Advanced Custom Study

// Marker example

copied and pasted to NPP ... added #include "sierrachart.h" ... added SCDLLName("Marker example")

I received a list of errors when i attempted to Remote Build.

thanks


code starts below
-----------------------------------------------------------------------------------------------------------------------------
#include "sierrachart.h"

// Name of the custom study.
SCDLLName("Marker example")

// Marker example
s_UseTool Tool;
int UniqueLineNumber = 74191;//any random number.

Tool.Clear(); // Reset tool structure. Good practice but unnecessary in this case.
Tool.ChartNumber = sc.ChartNumber;

Tool.DrawingType = DRAWING_MARKER;
Tool.LineNumber = UniqueLineNumber +1;

BarIndex = max(0, sc.ArraySize - 35);

Tool.BeginDateTime = sc.BaseDateTimeIn[BarIndex];
Tool.BeginValue = sc.High[BarIndex];

Tool.Color = RGB(0,200,200);
Tool.AddMethod = UTAM_ADD_OR_ADJUST;

Tool.MarkerType = MARKER_X;
Tool.MarkerSize = 8;

Tool.LineWidth = 5;

sc.UseTool(Tool);

compiler errors start below
-----------------------------------------------------------------------------------------------------------------------

-- Starting remote build of Custom Studies Source files: Markerexample.cpp. 64-bit -- 18:21:30

Allow time for the server to compile the files and build the DLL.

The remote build did not succeed. Result:

Markerexample.cpp:10:1: error: 'Tool' does not name a type
10 | Tool.Clear(); // Reset tool structure. Good practice but unnecessary in this case.
| ^~~~
Markerexample.cpp:11:1: error: 'Tool' does not name a type
11 | Tool.ChartNumber = sc.ChartNumber;
| ^~~~
Markerexample.cpp:13:1: error: 'Tool' does not name a type
13 | Tool.DrawingType = DRAWING_MARKER;
| ^~~~
Markerexample.cpp:14:1: error: 'Tool' does not name a type
14 | Tool.LineNumber = UniqueLineNumber +1;
| ^~~~
Markerexample.cpp:16:1: error: 'BarIndex' does not name a type
16 | BarIndex = max(0, sc.ArraySize - 35);
| ^~~~~~~~
Markerexample.cpp:18:1: error: 'Tool' does not name a type
18 | Tool.BeginDateTime = sc.BaseDateTimeIn[BarIndex];
| ^~~~
Markerexample.cpp:19:1: error: 'Tool' does not name a type
19 | Tool.BeginValue = sc.High[BarIndex];
| ^~~~
Markerexample.cpp:21:1: error: 'Tool' does not name a type
21 | Tool.Color = RGB(0,200,200);
| ^~~~
Markerexample.cpp:22:1: error: 'Tool' does not name a type
22 | Tool.AddMethod = UTAM_ADD_OR_ADJUST;
| ^~~~
Markerexample.cpp:24:1: error: 'Tool' does not name a type
24 | Tool.MarkerType = MARKER_X;
| ^~~~
Markerexample.cpp:25:1: error: 'Tool' does not name a type
25 | Tool.MarkerSize = 8;
| ^~~~
Markerexample.cpp:27:1: error: 'Tool' does not name a type
27 | Tool.LineWidth = 5;
| ^~~~
Markerexample.cpp:29:1: error: 'sc' does not name a type; did you mean 's_sc'?
29 | sc.UseTool(Tool);
| ^~
| s_sc

-- End of Build -- 18:21:36