Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with realized PnL of real account in IB

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

    Problem with realized PnL of real account in IB

    Hi ninjas,

    I put the Algo to work as always from 17:15 Sunday,it did 2 trades with a positive realized PnL in my real account. This realized PnL is well calculated and shown in the Strategies tab of the control center, but it failed to do the same in the Accounts tab, where simply there's no any realized profit, just the an increased account value, I mean: my account equity is bigger than it was initiated but the realized PnL comes zero; so:

    - Why does this happen and how can I solve it?

    I got all platform software updated:
    - IB TWS : Version 938.1e from April-22
    - NT: Version 7.0.1000.16 from last week

    The trace file is more than 1 Mg, so I can't upload it, I'll try the mail
    Attached Files
    Last edited by pstrusi; 10-14-2013, 02:49 AM.

    #2
    pstrusi, are you aware of any connection losses seen in the traded period? What would the realized pnl at IB directly show? Would you mind sending us your trace and logs file to support for review of the events seen?

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand, the trace file is more than 1 MB, so I must be sent by direct mail. So, how should I identify this mail to you?

      Comment


        #4
        No worries, please just use Help > Mail to Support then or submit to support at ninjatrader dot com to my Attn.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi Bertrand,

          Since I'm about to run live scripts again, I'd like to ask you, if this issue ( NT doesn't pull correctly the Account realized PnL through the "GetAccountValue(AccountItem.RealizedProfitLos s)" ) has been solved already.

          Thanks

          Comment


            #6
            Hi Ninjas,

            Doing more testing of the Script, it seems that there's a little issue regarding the RealizedProfitLoss. It's simple: the Script has a module which makes me know when it changes the market position, quantity and the actual realized Profit/Loss of the account; this last info is very important to me cause I have a condition in the Script that basically let the Script runs UNTIL a certain profit or loss is achieved. The issue is that I always get ( by email ) the previous RealizedProfitLoss and not the actual one, which is clearly shown in the NT's tab Strategy and Accounts. What I'm afraid of is that value is not taking properly actualized in the condition if the Script must continue or stop. How can I be sure that this value is properly taken? The snippet below:

            Code:
            protected override void OnPositionUpdate(IPosition position)
            		{
            			if (position.MarketPosition != MarketPosition.Flat)
            			{
            				SendMail ("[email protected]", "[email protected]", "Algo Summary ", Position.MarketPosition.ToString() + ".  P/L " + GetAccountValue(AccountItem.RealizedProfitLoss).ToString());
            			}
            		}
            Thanks

            Comment


              #7
              Hi pstrusi,

              I gave this a test and was able to confirm this behavior.

              I believe the issue here is that the account realized pnl is not being updated for a few milliseconds. I've tested this in OnExecution, OnPositionUpdate, and OnOrderUpdate but all of these seem to happen before the account realized is updated.

              I am testing this with the Sim101 account and the simulated data feed and I am still able to reproduce this behavior.

              If I add the print to OnMarketData and wait for even a single tick to pass the realized pnl is updated. You may try using a bool that is flipped after the position update that waits for OnMarketData to run at least once. That worked for me, however, as I mentioned I am using the Sim101 account and 1 tick seems to be long enough for a wait to get the correct pnl. It may take longer on a real account.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thanks a lot Chelsea for this help and your effort in taking these test to confirm. Your suggestions will definitively be helpful. I'll try to do my best with it.

                Best regards and a Merry Christmas

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by yertle, Yesterday, 08:38 AM
                7 responses
                28 views
                0 likes
                Last Post yertle
                by yertle
                 
                Started by bmartz, 03-12-2024, 06:12 AM
                2 responses
                21 views
                0 likes
                Last Post bmartz
                by bmartz
                 
                Started by funk10101, Today, 12:02 AM
                0 responses
                4 views
                0 likes
                Last Post funk10101  
                Started by gravdigaz6, Yesterday, 11:40 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by MarianApalaghiei, Yesterday, 10:49 PM
                3 responses
                11 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X