Login Page - Create Account

Support Board


Date/Time: Sat, 28 Feb 2026 00:56:55 +0000



Post From: Footprint alert example 30x600

[2026-01-13 10:06:04]
rebeccaemme - Posts: 38
Is a full day that I try to setup it and is not working. I would like to receive the allert and the bar color when bid is actually 750 and ask is 0 but is not working.


#include "sierrachart.h"

SCDLLName("VolumeAtPriceAnalysis")

SCSFExport scsf_BidAskVolumeAlert(SCStudyInterfaceRef sc)
{
// Sezione 1: Configurazione dei parametri e impostazioni predefinite
if (sc.SetDefaults)
{
sc.GraphName = "Bid-Ask Specific Volume Alert";
sc.AutoLoop = 1;
sc.GraphRegion = 0;

// Obbligatorio per accedere ai dati Volume at Price
sc.MaintainAdditionalChartData = 1;

sc.Input[0].Name = "Minimum Bid Volume";
sc.Input[0].SetInt(750);

sc.Input[1].Name = "Maximum Ask Volume";
sc.Input[1].SetInt(0);

sc.Input[2].Name = "Alert Number (1-64)";
sc.Input[2].SetInt(1);

return;
}

// Sezione 2: Elaborazione dati per la barra corrente
const int BarIndex = sc.Index;

// Accesso al numero di livelli di prezzo (ticks) nella barra
int NumLevels = sc.VolumeAtPriceForBars->GetSizeAtBarIndex(BarIndex);
if (NumLevels == 0) return;

bool ConditionMet = false;

// Iterazione attraverso tutti i livelli di prezzo della barra
for (int i = 0; i < NumLevels; i++)
{
s_VolumeAtPriceV2* p_VAP = NULL;

// Recupero dei dati Volume at Price per il livello i
if (!sc.VolumeAtPriceForBars->GetVAPElementAtIndex(BarIndex, i, &p_VAP))
continue;

// Logica di confronto bid/ask
if (p_VAP->BidVolume >= (unsigned int)sc.Input[0].GetInt() &&
p_VAP->AskVolume <= (unsigned int)sc.Input[1].GetInt())
{
ConditionMet = true;
break; // Esci dal ciclo se la condizione รจ soddisfatta in almeno un livello
}
}

// Sezione 3: Esecuzione Alert ed Evidenziazione
if (ConditionMet)
{
// Colora la barra sul grafico (Giallo)
sc.ColorBar[BarIndex] = RGB(255, 255, 0);

// Attivazione dell'alert configurato
s_UseControlBarAlert AlertSettings;
AlertSettings.AlertNumber = sc.Input[2].GetInt();
AlertSettings.SetInThisFunction = true;
sc.SetAlert(AlertSettings, "Soglia Bid/Ask Rilevata");
}
}