Login Page - Create Account

Support Board


Date/Time: Sun, 16 Nov 2025 11:18:56 +0000



Post From: Preventing ghost labels in the ZigZag study

[2025-11-15 16:17:48]
C_Money - Posts: 87
Hi all,

Something I've been struggling with for a long time. I've been using the ZigZag study (and other custom variants of it from other users) and all of them have this "ghost label" issue. My custom study depends on the ZigZag labels when plotting buy/sell signals.

The issue is, when the market moves strongly in one direction without a retracement, my study will plot signals where a ZZ label used to be, but is no longer. In my spreadsheet system, I can still see the values in SG2 (1, 2, 3 or 4 for HH, LL, HL, LL), even though there is no text label to accompany it. Even if I pull the SG2 array directly from the ZigZag study and not the Spreadsheet, it still has ghost labels.

How can I fix this without having to use the Chart Recalculation study (it causes incredible lag, as my system is pretty complex.)

The ZigZag study is in Studies7.cpp and I THINK the solution is somewhere here on line 1654. Even if I remove that if statement and keep the for loop, it doesn't clear anything.

if (PriorLastZZEndpointIndex != -1)
{
// Clear from beginning of chart to end
for (int ZeroIndex = 0; ZeroIndex < sc.ArraySize; ZeroIndex++)
{
Subgraph_TextLabels[ZeroIndex] = 0;
Subgraph_ReversalPrice[ZeroIndex] = 0;
Subgraph_ZigzagLength[ZeroIndex] = 0;
Subgraph_ZigzagNumBars[ZeroIndex] = 0;
}
}

Date Time Of Last Edit: 2025-11-15 16:18:58