Hello,
I have an error message while testing my strategy. I am computing the PriceVolDistribution for every point as part of my strategy. Here is below the code used, based on this post Volume at Price --> Explore Possible?
l
//Volume line
priceH = IIf( H == L, H + 1e-2, H); // to avoid error if H = L ,
Lookback = 63;
if(BarCount >=100)
{
for ( i = 0; i < BarCount; i++ )
{
if (i < lookback+1)
{
vol_line[i] = 0;
}
else
{
//Compute VAP
_TRACE( "Hello world");
mx = PriceVolDistribution( priceH, L, V, bins = 100, true, i-lookback, i );
mat_sort = MxSortRows(mx, False, 1);
vol_line[i] = mat_sort[0][0];
}
}
I have an error message stating that priceH cannot be lower than priceL. The message is self explanatory, I just do not understand why this is happening.
I do not find a way to return on which ticker the error is occuring, so that I can check the raw data. I have tried using _TRACE to return some text (starting with just a simple Hello World as a starter), with no success (no info in the log window).
Is the_TRACE function the correct solution?
PS: I have added the if(BarCount >=100) because I think I have some empty tickers. Not sure this is the smartest way of checking this. Any advice would be welcomed