Sierra Chart | Custom DLL

Sierra Chart | The Anatomy of a Sierra Chart Custom Study DLL

Custom studies have a skeleton or structure to them. This structure is the basis of how a custom study fits in with the application itself. The structure can be broken down into four major components.

  1. The “physical” DLL file
  2. The Sierra Chart DLL Name
  3. Study functions
  4. The Study Name

Below you will find a short video and written descriptions of each item, how it is defined in the development environment and how it appears in Sierra Chart. That is to give a better understanding of how the source code ties in with the Sierra Chart application. Apart form understanding what is going on, this sometimes helps when troubleshooting.

http://www.youtube.com/watch?v=as5bgHXE1uU

The Physical dll

Is a file with a dll extension. Is created when we compile our source code. Must reside in the Sierra Chart “Data” folder.

The physical DLL is the output, or end result when we build our solution in Visual Studio. We define the location and name of the dll file in the Visual Studio project properties.

The image below highlights the entries that affect this.

  • Under configuration properties->General
  • Output directory is the folder where Visual Studio creates the dll to
  • Target name is the name of the file. In the example below, the name of the file is also the name of the Visual Studio project
  • Target extension is dll

 sierra-chart-custom-study-dll

As expected, the end result of compiling our project is a file called demo.dll which is written to our Sierra Chart Data folder.

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll

The Sierra Chart DLL Name – SCDLLName

In the code, it is defined in the c++ source file using SCDLLName (see below).

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll

 

In Sierra Chart, under add custom studies, you can see that the name “Demo DLL” appears below highlighted in yellow. You can also see that the actual file name and location is highlighted in yellow.

Also to note is that all the studies in the source file will appear in Sierra Chart under the DLL name. In this example, we have two studies “Demo Study 1” and “Demo Study Persiste Vars”

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll

The study function

The entry point to your study.  Sierra Chart calls this function. Must have the exact signature as below. Name of the function must be unique. Name of function must start with scsf_

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll

 In Sierra Chart, you will see the study function name in the study settings.

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll

 

The Study Name

Defined in ACSIL within each study in the default section using sc.GraphName.

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll

 

Appears in the application under the dll name node.

sierra-chart-custom-study-dll

sierra-chart-custom-study-dll