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

Recording the difference in P&L of 2 positions

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

    Recording the difference in P&L of 2 positions

    Is there a simple way to keep track of the net P&L of 2 or more open positions every minute?

    I want to have the net P&L per min stored and recorded over the length of a trading week (5 days for the entire 24 hours each day).

    It can be an actual number stored or simply an indicator on the chart.

    Thanks

    #2
    Originally posted by jim380 View Post
    Is there a simple way to keep track of the net P&L of 2 or more open positions every minute?

    I want to have the net P&L per min stored and recorded over the length of a trading week (5 days for the entire 24 hours each day).

    It can be an actual number stored or simply an indicator on the chart.

    Thanks
    That depends on what you mean by the word "simple". The neatest way would be to use the Trade Collection class.

    Comment


      #3
      Originally posted by koganam View Post
      That depends on what you mean by the word "simple". The neatest way would be to use the Trade Collection class.
      I did read about Trade Collection when I was searching on this. But I have no experience with NT programming, so I'm not quite sure how to use it at this point.

      But isn't trade collection used only for closed position?

      Are there ways to feed/write the information in the position tab into a text file or excel on a regular time period?
      Last edited by jim380; 08-03-2013, 07:59 AM.

      Comment


        #4
        Hello jim380,

        That is correct, the TradeCollection is going to be trades that have been closed. If you use the Strategy Analyzer you will be able to view all of the Trades and Executions and Export them to an Excel file, but if you would like to write to the files manually inside of your Automated Strategy, you would have to add some additional code.

        Here is a link to a thread that goes over how to use the System.IO that you may view to write text to a text file.


        Otherwise, for Unrealized PnL you may use the GetProfitLoss() method.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kevinenergy, 02-17-2023, 12:42 PM
        117 responses
        2,764 views
        1 like
        Last Post jculp
        by jculp
         
        Started by Mongo, Today, 11:05 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by SightCareAubetter, Today, 12:55 PM
        0 responses
        3 views
        0 likes
        Last Post SightCareAubetter  
        Started by traderqz, Today, 12:06 AM
        8 responses
        16 views
        0 likes
        Last Post traderqz  
        Started by SightCareAubetter, Today, 12:50 PM
        0 responses
        1 view
        0 likes
        Last Post SightCareAubetter  
        Working...
        X