Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      26 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, Yesterday, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      192 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,234 views
      0 likes
      Last Post xiinteractive  
      Working...
      X