Login Page - Create Account

Support Board


Date/Time: Sun, 06 Jul 2025 17:38:41 +0000



Post From: Demand Index study not displaying

[2024-12-06 20:27:21]
User190501 - Posts: 98
<<Issue with Demand Index Not Displaying on BTCUSD Charts>>
Hi Support Team,

I’ve noticed that the Demand Index is not being displayed on the BTCUSD charts. Upon reviewing the code, I identified a potential issue with the calculation of SmallValue. The code sets:

const float SmallValue = sc.TickSize / 4.0f;


If the TickSize is 5, then SmallValue becomes greater than 1. Since the volume and its average for this symbol are relatively low, the following section of the code causes both BuyPower and SellPower to be set to zero:

sc.MovingAverage(Array_Range, Array_RangeMA, Input_DIMovAvgType.GetMovAvgType(), Input_BSPowerLength.GetInt());
sc.MovingAverage(sc.Volume, Array_VolumeMA, Input_DIMovAvgType.GetMovAvgType(), Input_BSPowerLength.GetInt());

if (sc.Index >= 1)
{
if (Array_VolumeMA[sc.Index] > SmallValue)
{
Array_BuyPower[sc.Index] = sc.Volume[sc.Index] / Array_VolumeMA[sc.Index];
Array_SellPower[sc.Index] = sc.Volume[sc.Index] / Array_VolumeMA[sc.Index];
}
else
{
Array_BuyPower[sc.Index] = 0.0f;
Array_SellPower[sc.Index] = 0.0f;
}
}

This appears to affect instruments where SmallValue > 1 due to the TickSize and limited volume. Could you confirm if this is the expected behavior or if adjustments are needed for such scenarios?

Thank you for your assistance!