Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Write my Backtest Result on the Output window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Write my Backtest Result on the Output window

    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.

    #2
    adelvalle,

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

    Code:
    if (ToDay(Time[0]) == 20080910 && ToTime(Time[0]) == 160000)
         Print("some message");
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      If you want to print the stats at the last bar you can do something like

      Code:
      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]if(CurrentBar == Bars.Count)[/SIZE][/FONT]
      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
      [SIZE=2][FONT=Courier New]PrintStats();[/FONT][/SIZE]
      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
      [/SIZE][/FONT]
      or

      Code:
      if(CurrentBar == Bars.Count-1)
      {
       PrintStats();
      }
      depending on if CalculateOnBarClose is true or false.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      307 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      348 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      178 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X