Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Questions about exporting data to Excel

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

    Questions about exporting data to Excel

    Hi,

    I'm trying to make a strategy analyzer that is more suitable for the current strategy I'm running. However I have a couple of problems that I was hoping someone could help me with.

    Basically I'm exporting data from NT to Excel and I am having a very hard time trying to find the right way of finding certain values:

    - Cumulative profit by period, like the values you see under the "Periods" tab in Strategy Analyzer.

    - Entry price of first trade

    - Exit price of last trade

    Also I have a question regarding how NT runs a backtest when I test multiple instruments. Does it run through one instrument at a time, or does it run through all of them at the same time bar by bar? I'm guessing its the first one, but I just have to be sure.

    Is there any way to differentiate between the different instruments while it is backtesting? I'm asking because if I don't manage to differentiate between the instruments I will just see the last instrument NT tested in Excel.

    Hope I made the questions understandable.

    - Stoop

    #2
    Hello Stoop,
    You can use the TradeCollection class to find the trades. To get the first and last trade please use the below code snippet.

    Code:
    Trade t = this.Performance.AllTrades[0];
    Trade t1 this.Performance.AllTrades[this.Performance.AllTrades.Count - 1]


    Yes, NinjaTrader runs one instrument at a time if you are backtesting a list of instruments.

    You can use the Instrument class to do it. Please refer to our help guide to know more
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thank you very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      572 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      331 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      549 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      550 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X