I am trying to add daily volumes of some symbols to plot them but those symbols arrays doesn't have the same size so it plots only the size of the smallest on, i need it to add zero if this day isn't available instead of stopping
Here is my code
symlist = CategoryGetSymbols( categoryMarket,2);
//Loop Over market stocks
vol = 0;
TotalTurnOver = 0;
for ( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
//Volume
fc = Foreign( sym, "V" );
vol = vol+fc;
}
Plot(vol,"Volume",colorRed ,style = styleHistogram );
You don't need to do anything special. Foreign automatically pads data to current symbol see documentation http://www.amibroker.com/f?foreign (please read COMMENT part).
The only thing you may need is to convert Null to zero, as missing bars may be Null:
// loop body
fc = Foreign( sym, "V" );
vol += Nz( fc ); // Null to zero function