Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to detect last bar of Strategy analyzer run so I can dump info

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

    How to detect last bar of Strategy analyzer run so I can dump info

    Hi,
    I want to dump some data at the end of a strategy run.
    Currently I am triggering on bar number, or using Bars.GetBar(***)

    Problem is when I change the shape of the bar, I have to fish around to get the last bar number or bar date.

    Is there an easier way to do this?

    #2
    Hello, thanks for your post.

    We have the IsLastBarOfSession property for this:
    https://ninjatrader.com/support/help...rofsession.htm

    If your strategy runs OnPriceChange or OnEachTick, you will need to use the SessionIterator instead:
    https://ninjatrader.com/support/help...oniterator.htm

    Unfortunately, there is nothing pre-made that will tell you when the backtest completes specificaly, your code would need to check for the proper date to gather the information.

    Please let me know if I can assist any further.

    Comment


      #3
      Why not just do that data dumping from State.Terminated?

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X