Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Plotting Net Profit in Multi Instrument Strategy?

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

    Plotting Net Profit in Multi Instrument Strategy?

    Hello,

    I have a multi-Instrument strategy (up to 26 bars objects) and would like to plot overall net profit for all instruments simultaneously. However the existing net profit calculation appears to be based on the primary bars object or instrument rather than the profit of all instruments together.

    I would like to create a plot of net profit for all instruments together. I would also like to keep a running tab of how many open positions there are in this multi instrument strategy. Any idea on how to do this? Thank you in advance.


    Mr Lee

    #2
    Hello Mr Lee,

    All trades for all instruments will be collected in the Performance.AllTrades collection.

    Below is a publicly available link to the help guide on the Performance collection.


    Open positions for each instrument will be in the Positions[barsInProgress index] collection.


    You can loop through these and add the performances up in any way you would like in your logic.

    Below is a link to an example that uses the Performance collection and does calculations.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you ChelseaB. I'll take a look.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NRITV, Today, 01:15 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by maybeimnotrader, Yesterday, 05:46 PM
      5 responses
      24 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by quantismo, Yesterday, 05:13 PM
      2 responses
      16 views
      0 likes
      Last Post quantismo  
      Started by frankthearm, Today, 09:08 AM
      7 responses
      27 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by adeelshahzad, Today, 03:54 AM
      5 responses
      33 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X