Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 03:33:51 +0000



Post From: Volume At Price data not available for Historical Chart

[2025-02-12 17:39:56]
skalaydzhiyski - Posts: 71
Hello SC,

I am trying to build an indicator that determines Day Types (P-shaped, b-shaped, balanced, Double Distribution, etc..) based on the volume at price data you usually have available for intraday charts. The code I am using to interrogate the VolumeAtPriceForBars structure is below:


SCSFExport scsf_Indicator_DayType(SCStudyInterfaceRef sc)
{
namespace pth = phitech::helpers;

if (sc.SetDefaults)
{
sc.GraphName = "Indicator_DayType";
sc.StudyDescription = "Phi Technologies study for Sierra.";
sc.AutoLoop = 1;
sc.GraphRegion = 0;

sc.MaintainVolumeAtPriceData = 1;
return;
}

if (sc.IsFullRecalculation)
return;

pth::print(sc, "number of bars of volume by price -> %d", sc.VolumeAtPriceForBars->GetNumberOfBars());
// this prints 0 in the console when applied to historical charts
// and X (where X is a valid value) when applied to intraday charts.
}

Am I doing something wrong here ?

Workarounds are also welcome..

All the best,