Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to export all Trades from Strategy Analyzer

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

    How to export all Trades from Strategy Analyzer

    After the Execution of Back Test I want to export all the cumulative Trades into excel how can I do that ?

    #2
    Hello,

    Thank you for your post.

    Glad to assist. To export, please right click in the report grid > select Export...

    Let us know if we may assist further.
    Eric B.NinjaTrader Customer Service

    Comment


      #3
      Eric the above method you suggested will only export the trades for the selected Instrument only. My simulation is across the Instrument List and I want to export all Trades across all Instruments in the Simulation.
      So I adopted the following . The problem is Time[CurrentBar] is always returning me second day from the start of simulation. Is there a way for me to get the TimeStamp of CurrentBar, so I can compare that with Current time and print all cumulative trades from SystemPerformance

      // Print out Simulation Results to Output Window at the end of Simulation
      if (DateTime.Now.Subtract(Time[CurrentBar]).Days<1 && this.SimulationMode)
      {
      for(int i=0; i<SystemPerformance.AllTrades.Count; i++)
      {
      Trade lastTrade = SystemPerformance.AllTrades[i];
      NinjaTrader.Code.Output.Process(Account.Name+" - "+Instrument.FullName + " - " + (lastTrade.Entry.MarketPosition.Equals(MarketPosit ion.Long)?"BUY":"SELL")+" - "+ lastTrade.Entry.Name+" - "+lastTrade.Entry.Time + " - " + lastTrade.Exit.Time+" - "+lastTrade.Exit.Price + " - " +lastTrade.Entry.Price, PrintTo.OutputTab1 );
      }

      Comment


        #4
        Hello vivekniwas,

        Thank you for the post.

        The DateTime.Now would hold no relation toward historical data so I would not suggest using this in your development. This would also hold no relation to any of the times the platform uses, this is specifically your PC clock time.

        To find the time of the current bar, you would use Time[0]. CurrentBar represents the index of the bar being processed, Time[0] represents the time for that bar, zero bars ago from the CurrentBar.

        Using Time[CurrentBar] you are saying "get the time of the bar using CurrentBar as the BarsAgo ago". Assuming you were on CurrentBar 1000, that would be 1000 BarsAgo from now. This would be the beginning of the chart.

        When processing you will always use the BarsAgo inside the brackets like Time[BarsAgo] for the bar you want to reference. if you want the time of now or the currently processing bar you will always use 0 BarsAgo or Time[0].

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        383 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        1 view
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Working...
        X