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 rocketman7, Today, 02:12 AM
        7 responses
        28 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by guillembm, Yesterday, 11:25 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by junkone, 04-21-2024, 07:17 AM
        10 responses
        148 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tsantospinto, 04-12-2024, 07:04 PM
        6 responses
        101 views
        0 likes
        Last Post tsantospinto  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        7 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X