PDA

View Full Version : Write my Backtest Result on the Output window


adelvalle
09-10-2008, 02:15 PM
Hi, I would like to know how I could write the piece of the code where I could write afew things on the output window once my Backtest has finalized.

This is so that when I run an optimization with a few hundred thousand simulations I wanna see all parameters from all simulations and its results so I can export it and anylize them on Matlab. The problem with NinjaTrader is that it can only store up to the best 400 data points from my optimization and I need them all actually.

Is there some sort of function OnBackTestFinalizationWrite( ), this would work awsome :)

Thanks for your help.

NinjaTrader_Josh
09-10-2008, 03:01 PM
adelvalle,

You can figure out the last bar that will be in your backtest time frame and then do a Print() from there.

if (ToDay(Time[0]) == 20080910 && ToTime(Time[0]) == 160000)
Print("some message");

terenyi
12-04-2008, 11:01 PM
If you want to print the stats at the last bar you can do something like


if(CurrentBar == Bars.Count)
{
PrintStats();
}


or


if(CurrentBar == Bars.Count-1)
{
PrintStats();
}


depending on if CalculateOnBarClose is true or false.