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 Brevo, Today, 01:45 AM
      0 responses
      3 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      239 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      6 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X