@orshk, usually to verify array contents it is better to use explorations and/or (for limited size arrays) the debugger.
If you truly want to use _TRACE you need to change your code to loop over bars and use a _TRACE() for each bar as per the @codejunkie example.
Or maybe you could write something along these lines (not very useful IMHO - maybe you could devise something better passing multiple arrays to a custom function) :
function dumpNumericArray( a )
{
local s, i;
s = "\n";
for( i = 0; i < BarCount; i++ )
{
s = s = s + NumToStr( i, 1.0 ) + " " + a[i] + "\n";
}
return s;
}
function dumpDateArray( dt )
{
local s, i;
s = "\n";
for( i = 0; i < BarCount; i++ )
{
s = s + NumToStr( i, 1.0 ) + " " + DateTimeToStr( dt[i] ) + "\n";
}
return s;
}
_TRACE( "Close: " + dumpNumericArray( C ) );
_TRACE( "Date: " + dumpDateArray( DateTime() ) );
Thanks for the replies, I'll also try working with explorations and see what's more convenient. It just that coming from other trading platforms it's seems strange to me that there isn't an easy log functionality.
@orshk: Coming from another platform may take a bit of getting used to, but once you "get" the power of AmiBroker, I doubt you will ever look back.
I use _Trace to follow the Logic of my program and Exploration to see the values of the calculations. Just make sure you know that the Exploration is INDEPENDENT of the Chart. You have to set all the parameters and system variables for the Exploration, separate from the Chart.