Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetProfitLoss for manual trades

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

    GetProfitLoss for manual trades

    in MR

    if I make an atmstrat trade from my strat, I can pick up unrealized and realized (and totalpnl when NT adds it asap)

    if I make a non-atm trade from a strat, I can pick up unrealized with GetProfitLoss

    if I make a manual trade, I can not pick up unrealized from code. Correct?

    If correct, why not....i.e. can you add asap?

    If incorrrect, how?

    Thanks.

    #2
    This is not allowed. Strategies are not meant to interact with any manual trades or any trades from other strategies not part of it.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      post edited to another thread
      Last edited by ATI user; 02-06-2010, 01:53 PM.

      Comment


        #4
        Incorrect. Strategies is not supported to have access to information of trades done manually. Each strategy is only aware of the trades it makes itself. It does not recognize anything done anywhere else.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Request - Global Risk Management

          post edited to another thread
          Last edited by ATI user; 02-06-2010, 01:53 PM.

          Comment


            #6
            - using non-AtmStrategyCreate code users have access to Realized PnL only. Fine if it is a small position held for a short period of time...i.e. the unrealized PnL is negligible. When unrealized becomes 10 or 20 times the realized, then realized is useless....especially if unrealized is a large loss and you want to exit automatically for the day.
            Position.GetProfitLoss() gives you the unrealized PnL.

            1. Not true. Though the MA may show you everything in relation to your account, strategy code is only for the strategy. This is why there is the whole thing about strategy position versus account position.

            2. Correct. Position.GetProfitLoss() gets you the unrealized PnL for the NinjaScript managed position.

            3. Instead of flooding the language with unnecessary methods, especially for something that just requires something as trivial as adding two double values together, we find it is better done this way.

            Please note that your understanding of Position.GetProfitLoss() = realized PnL is inaccurate. It gives you the unrealized PnL of your strategy position.

            I have added your request for unrealized PnL for the account position to our list of considerations.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              post edited to another thread
              Last edited by ATI user; 02-06-2010, 01:54 PM.

              Comment


                #8
                Originally posted by NinjaTrader_Josh View Post

                Please note that your understanding of Position.GetProfitLoss() = realized PnL is inaccurate. It gives you the unrealized PnL of your strategy position.
                yes ...my typo...have corrected above...point being we need both

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  I have added your request for unrealized PnL for the account position to our list of considerations.
                  hope you mean you added Realized to list?

                  Comment


                    #10
                    Not following you. From a NinjaScript strategy you have access to everything in terms of PnL for the strategy. You have realized and unrealized. For realized, just go through the Performance class to grab it out. For unrealized, use GetProfitLoss().

                    Hedging makes no difference. Each ATM strategy you create is its own entity with its own realized/unrealized with GetAtmStrategyRealizedProfitLoss() and GetAtmStrategyUnrealizedProfitLoss(). If you are hedging with multiple strategies just run the method on the multiple ATM strategy IDs.

                    I.e. ATM strategy A = long; ATM strategy B = short.
                    Total PnL of A and B = GetAtmStrategyRealizedProfitLoss(strategyA) + GetAtmStrategyUnrealizedProfitLoss(strategyA) + GetAtmStrategyRealizedProfitLoss(strategyB) + GetAtmStrategyUnrealizedProfitLoss(strategyB)

                    This is very basic arithmetic that does not warrant providing an extra method. If you really want this you can just as easily make your own method. You have the components to calculate what you want easily accessible.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      post edited to another thread
                      Last edited by ATI user; 02-06-2010, 01:54 PM.

                      Comment


                        #12
                        RE: GetProfitLoss for manual trades

                        I also see the need for having an 'all inclusive' risk management system. Like many traders I am sure, I have trouble from time-to-time with overtrading, but with something like this in place (an account risk management, essentially), whether auto-trading or manual trading, I would have something to 'remind' me to stop trading, and that stops the trading based on certain risk parameters. Being able to contol risk at this level would be beneficial to all I believe.

                        My 2 cents,
                        Peter

                        Comment


                          #13
                          post edited to another thread
                          Last edited by ATI user; 02-06-2010, 01:54 PM.

                          Comment


                            #14
                            As mentioned, this is not supported and has already been added to our feedback list.
                            Josh P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            599 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            344 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            103 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            558 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            557 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X