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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      36 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      23 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      162 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      96 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      152 views
      2 likes
      Last Post CaptainJack  
      Working...
      X