Hi I am trying to plot total volume for symbols in a watchlist.
The code below works but when a symbol in the watchlist has no data for a date
the total volume is always returned as 0 for the whole watchlist. Please help,
Thanks :)
listnum = Param("Watchlist Number",0,0,100,1);
function GetVolumeForWatchList( listnum )
{
// retrive comma-separated list of symbols in watch list
list = CategoryGetSymbols( categoryWatchlist, listnum );
Vol = 0;
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
f = Foreign( sym, "V" );
Vol = Vol + f;
_TRACE("Vol= " + Vol);
}
return Vol;
}
Plot(GetVolumeForWatchList(listnum), "Total Volume", colorGreen, styleHistogram
);