• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 swcooke, Today, 02:01 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by guidoisot, Today, 01:11 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by martyn73, Today, 12:26 PM
        0 responses
        11 views
        0 likes
        Last Post martyn73  
        Started by uday12, Today, 09:45 AM
        0 responses
        9 views
        0 likes
        Last Post uday12
        by uday12
         
        Started by uday12, Today, 08:25 AM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X