Login Page - Create Account

Support Board


Date/Time: Tue, 26 Aug 2025 10:27:46 +0000



Build advance custom study indicator

View Count: 234

[2025-07-19 17:11:58]
User203340 - Posts: 15
I have build build advance custom study indicator it's showing in data folder but not showing up in user custom study.
Date Time Of Last Edit: 2025-07-19 22:49:29
Attachment Deleted.
Private File
imageIMG_20250719_152941.jpg / V - Attached On 2025-07-19 22:43:09 UTC - Size: 1.87 MB - 52 views
[2025-07-21 15:54:17]
John - SC Support - Posts: 41464
You have something wrong with your code from which the .dll was created. Refer to the information here:
Advanced Custom Study Interface and Language (ACSIL): Step-By-Step Instructions to Create an Advanced Custom Study Function
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-07-21 16:01:02]
cmet - Posts: 719
You're study is missing basic required entries. Hard for anyone to help you without seeing the code.
[2025-07-21 17:04:38]
User203340 - Posts: 15
Here is the code of the indicator

#include "sierrachart.h"
SCDLLName("Cum Delta Histogram")

// ─── Input indices ───────────────────────────────────────────
const int IDX_MODE = 0; // 0 = Trades, 1 = BidAsk
const int IDX_PLOTTYPE = 1; // 0 = Histogram, 1 = Line
const int IDX_POSCOLOR = 2;
const int IDX_NEGCOLOR = 3;
const int IDX_ZEROCOLOR = 4;

// ─── Study Function ──────────────────────────────────────────
SCSFExport scsf_CumDeltaHistogram(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "Cumulative Delta Histogram";
sc.GraphRegion = 1; // own sub‑pane
sc.AutoLoop = 1;

/* Inputs */
sc.Input[IDX_MODE].Name = "Delta Source";
sc.Input[IDX_MODE].SetCustomInputStrings("Trades;BidAsk");
sc.Input[IDX_MODE].SetInt(1); // default BidAsk

sc.Input[IDX_PLOTTYPE].Name = "Plot Style";
sc.Input[IDX_PLOTTYPE].SetCustomInputStrings("Histogram;Line");
sc.Input[IDX_PLOTTYPE].SetInt(0); // default Histogram

sc.Input[IDX_POSCOLOR].Name = "Positive Color";
sc.Input[IDX_POSCOLOR].SetColor(RGB(0,200,0));
sc.Input[IDX_NEGCOLOR].Name = "Negative Color";
sc.Input[IDX_NEGCOLOR].SetColor(RGB(220,0,0));
sc.Input[IDX_ZEROCOLOR].Name = "Zero‑line Color";
sc.Input[IDX_ZEROCOLOR].SetColor(RGB(160,160,160));

/* Subgraphs */
sc.Subgraph[0].Name = "CumDelta";
sc.Subgraph[0].DrawStyle = DRAWSTYLE_BAR;
sc.Subgraph[1].Name = "Zero";
sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[1].PrimaryColor= sc.Input[IDX_ZEROCOLOR].GetColor();
return;
}

/* Style switch: bar or line */
sc.Subgraph[0].DrawStyle = (sc.Input[IDX_PLOTTYPE].GetInt() == 0 ? DRAWSTYLE_BAR : DRAWSTYLE_LINE);

/* Per‑bar delta */
double barDelta;
if (sc.Input[IDX_MODE].GetInt() == 0) // Trades up/down tick
barDelta = sc.Volume[sc.Index] * (sc.Close[sc.Index] > sc.Open[sc.Index] ? 1.0 : -1.0);
else // Bid‑Ask aggressive volume
barDelta = sc.AskVolume[sc.Index] - sc.BidVolume[sc.Index];

/* Cumulative sum */
double cum = (sc.Index == 0 ? barDelta : sc.Subgraph[0][sc.Index - 1] + barDelta);
sc.Subgraph[0][sc.Index] = cum;

/* Colour */
COLORREF posCol = sc.Input[IDX_POSCOLOR].GetColor();
COLORREF negCol = sc.Input[IDX_NEGCOLOR].GetColor();
sc.Subgraph[0].DataColor[sc.Index] = (cum >= 0 ? posCol : negCol);

/* Zero line */
sc.Subgraph[1][sc.Index] = 0;
}
[2025-07-21 17:55:34]
cmet - Posts: 719
Looks good to me. Did you compile this in Sierra?

Do you not see an entry for "Cum Delta Histogram" in Studies > Add Custom Study?
[2025-07-21 18:09:55]
ForgivingComputers.com - Posts: 1105
I compiled it and it showed up.
imageCumDeltaHistogram.png / V - Attached On 2025-07-21 18:09:48 UTC - Size: 9.02 KB - 48 views

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

Login

Login Page - Create Account