Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

incorrect PnL

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

    incorrect PnL

    Hello,

    I am testing with three IB TWS accounts. Basically when I enter a position, one contract is bought or sold in each of these accounts at the same time and each position in each account has its own OCO order pair entered. I just found out for some reason, the PnL shown in NT Positions window became not correct for one IB account, but the other two still match with that in IB TWS. I think there might be a potential bug in NT causing this.

    Also it seems the AvgPrice column in Positions window shows the average price for that instrument since the beginning of the trading day including all closed or active long position and short position. This value is of little meaning. I think once the position reached zero, those closed transactions should not be included in the future calculation. That is to say, only a fresh new position and further scaled in trades should be used to calculate AvgPrice and scale-out trades should not change the AvgPrice. Once all "inventory" have been cleaned up, AvgPrice is reset.

    - Clearpicks

    #2
    If you are connecting more than once instance of TWS to NT then this is not supported.
    RayNinjaTrader Customer Service

    Comment


      #3
      It seems the incorrect PnL was caused by the PnL cell for one of three accounts stoped updating. Please see the attached screenshot (PnL1.png). All three accounts took same position at the same time, so the entry prices were almost the same. However somehow after a while, the PnL of the first account in the position window ( which was the last account taking position according to the ordering in my EFS code ) stoped updating (the cell with value $-2.75).
      When I click "Flat" button in my EFS to close positions of all three accounts one by one, the position of that account with freezing PnL cell was also closed just as the other two accounts did and the Positions window in NT became entry. However if I click any trade button in my EFS to trade again, the PnL cell corresponding to that problematic account got frozen right after the position was taken. (see the attached screenshot PnL2.png, the cell with value $427.25).

      Moreover because in the first roundtrip trade, the problematic account is less profitable than the other two. When the second roundtrip trade was entered, the problematic account should never have a PnL value higher than the other two accounts. While in the screenshot, it is $427.25 vs. $27.25, it just does not make sense. So it is obviously something wrong in NT.

      The unrealized PnL column in IB TWS always showed the correct values although sometimes it might updated a little bit slow than the last bid and ask prices.

      - Clearpicks
      Attached Files
      Last edited by clearpicks; 05-30-2008, 10:54 AM.

      Comment


        #4
        Multiple instances are not supported which is clearly the case in this situation as per your screen shot. We do not guarantee behaviour in this type of set up.
        RayNinjaTrader Customer Service

        Comment


          #5
          In the case of multiple IB TWS connections, what are supported and waht are not? I think at least those order sending APIs in NT DLL should be of no problem, right?

          Comment


            #6
            It means that any issues that arise when having more than one TWS connected is not acknowledged by us as an issue. It may or may not work.
            RayNinjaTrader Customer Service

            Comment


              #7
              If multiple broker accounts are connected to NT at the same time, but only one of them is IB TWS, others are from different other companies, is this scenario supported? Thanks.

              - Clearpicks

              Comment


                #8
                Yes, that is supported with our multi-broker version.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  Does the multiple broker version support multiple tws connections?


                  - Clearpicks

                  Comment


                    #10
                    Multiple TWS are not supported.
                    RayNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by yertle, Today, 08:38 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post yertle
                    by yertle
                     
                    Started by Mestor, 03-10-2023, 01:50 AM
                    15 responses
                    378 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by samish18, Yesterday, 08:57 AM
                    10 responses
                    27 views
                    0 likes
                    Last Post samish18  
                    Started by matty89, 03-02-2020, 08:31 AM
                    34 responses
                    3,039 views
                    1 like
                    Last Post NinjaTrader_BrandonH  
                    Started by kujista, Today, 05:44 AM
                    3 responses
                    14 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X