Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

bug - Cash value is not correct

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

    bug - Cash value is not correct

    Hi there,

    this is still NT8 B06 version.
    Connection Rithmic.

    While Rithmic and NT 7 showing the same values NT 8 does not.

    see attached from yesterday and today...

    Hope this helps,

    atata
    Attached Files

    #2
    another example from this morning

    Here is another example from today... see attached. Cash value shall match the brokers Account balance I'd think. Please focus on the values at $50,248, $51,765 and $52,312. NT7 Cash Value matches with broker's account balance while NT 8 is off and it seems not reading the broker's data rather calculating gains/losses via tick base without commissions or something like that.

    Hope this helps.

    atata
    Attached Files

    Comment


      #3
      With NT8 we changed the Cash Value calculation to be:

      Rithmic CashOnHand + ClosedPnL.

      Therefor where NT7 would not not take into account Realized PnL for the day NT8 will.

      You could be able to confirm by taking a look at your ClosedPnL column in RTrader and adding that to your Account Balance.

      If you are still off then the last thing to check is to right click on the Account in NinjaTrader and select Edit. Is there a commission template applied?

      If no then please let me know if it still not adding up I would want to contact you so I could research further since I don't expect what you are seeing.

      Comment


        #4
        why Cash Value excluding commissions?

        Originally posted by NinjaTrader_Brett View Post
        With NT8 we changed the Cash Value calculation to be:

        Rithmic CashOnHand + ClosedPnL.

        Therefor where NT7 would not not take into account Realized PnL for the day NT8 will.

        You could be able to confirm by taking a look at your ClosedPnL column in RTrader and adding that to your Account Balance.

        If you are still off then the last thing to check is to right click on the Account in NinjaTrader and select Edit. Is there a commission template applied?

        If no then please let me know if it still not adding up I would want to contact you so I could research further since I don't expect what you are seeing.
        Brett, thanks for your response!

        Isn't the cash value shall show how much cash is available to trade, meaning gains/losses - commissions?

        Why is not the formula below was applied as it is in NT 7? Why is the change in NT8?
        Cash Value = CashOnHand + PNL - I'd think shall be the preferred solution as per Rithmic accounts rather than the currently implemented formula in your comment above.

        Closed PnL is excluding commissions.
        NT 8 Realized PnL is quite close $660.48 right now however Rithmic Pnl is $658.64...
        Not sure where this discrepancy is coming from...

        The current situation is the only way to have the correct info as it is at the broker to look at the report at the broker... using NT 7 I could look at cash value only for the same info...

        Thanks,

        atata

        Comment


          #5
          Now after hours the NT8 Cash Value the same as the NT 7 Cash Value...

          Comment


            #6
            screenshot attached

            As stated on previous response... they are the same now... see attached, I guess because of your prev formula Rithmic "Closed PnL" is 0....
            Attached Files

            Comment


              #7
              What I've meant "NT 8 Realized PnL is quite close $660.48 right now however Rithmic Pnl is $658.64...
              Not sure where this discrepancy is coming from...

              The current situation is the only way to have the correct info as it is at the broker to look at the report at the broker... using NT 7 I could look at cash value only for the same info..."

              I could use Relazied PnL however while it is close not the same exact value...

              Comment


                #8
                Atata,

                Sorry we're not on the same page and your multiple replies leaves me confused. We needed to resync.

                Here's the expectation:

                Cash Value displayed in NinjaTrader for rithmic accounts is the rithmic Cash On Hand + any Closed/Realized PnL. These are all values provided by the brokerage and rithmic API and you should be able to see that number match. If you don't then there is a bug. I believe we are on the same page here but your reply leaves me unsure since you restate as a question exactly how I described it works in NT8.

                If you would like commissions removed then you can do this with NinjaTrader. Its done client side by NinjaTrader by right clicking on the account in the control center > account grid and selecting edit account. It is here you can apply a commission template. Here you will see the balue Net Liquidation Value be reflective of commissions once applied.

                If we are chasing a bug here then I would need more info. Which can be provided by taking a larger screenshot of both NT account grid and rithmic account grid to show both the Cash value in NT, and cash on hand field in RTrader and Realized PnL fields in both platforms.

                Comment


                  #9
                  PnL, commission calculation still buggy...

                  Originally posted by NinjaTrader_Brett View Post
                  Atata,

                  Sorry we're not on the same page and your multiple replies leaves me confused. We needed to resync.

                  Here's the expectation:

                  Cash Value displayed in NinjaTrader for rithmic accounts is the rithmic Cash On Hand + any Closed/Realized PnL. These are all values provided by the brokerage and rithmic API and you should be able to see that number match. If you don't then there is a bug. I believe we are on the same page here but your reply leaves me unsure since you restate as a question exactly how I described it works in NT8.

                  If you would like commissions removed then you can do this with NinjaTrader. Its done client side by NinjaTrader by right clicking on the account in the control center > account grid and selecting edit account. It is here you can apply a commission template. Here you will see the balue Net Liquidation Value be reflective of commissions once applied.

                  If we are chasing a bug here then I would need more info. Which can be provided by taking a larger screenshot of both NT account grid and rithmic account grid to show both the Cash value in NT, and cash on hand field in RTrader and Realized PnL fields in both platforms.
                  Ok Brett, since you guys changed the "Cash Value" assignment so be it. Ok not a bug it is a "bug" by design...
                  Now I have more substance to respond with... here you go.

                  I've analyzed a bit 2 different brokers /Rithmic and IB/ as per PnL account stuff goes:
                  env: NT 8 B07, Win 8.1 enterprise

                  Rithmic works relative well however from whatever reason their is some bug in PnL calculation.
                  ISSUE #1.:
                  step 1/ Rithmic Closed Profit/Loss - PNL - $780 - $721.12 = $58.88
                  This is calculated correct in NT 8 since "Total commissions" = $58.88

                  bug: The "Realized PnL" and the "Total PnL" as per NT 8 = $724.80
                  This number shall match the Rithmic "PNL" $721.12 number I assume?! yet is off by $3.68. It is always off and with a small amount.

                  ISSUE #2:
                  The "Unrealized PnL" field does nothing... always 0 in trade out of trade does not matter. I assume this field shall show the PnL for an actual trade while in the trade.

                  ISSUE #3:
                  The "Total PnL" is always the same number as "Realized PnL" and I assume shall be a running number while in trade. Probably related to ISSUE #2

                  ISSUE #4:
                  At the end of the session NT 7 resets everything including commissions without restart. NT 8 on the other will only reset Rithmic account commission after restart. NT 8 will calculate PnL with previous day commissions if not restarted.

                  ISSUE #5:
                  The following fields on the "Accounts" tab are always 0 /maybe by design have to fill some data.../ "Buying Power", "Intraday margin", "Initial Margin", "Look ahead maintenance", "Unrealized PnL"

                  IB accounts
                  This is a paper IB account since can't connect to live account... have a thread running on that one.

                  ISSUE #1.:
                  I have to assume similar issue might exist as per Rithmic however IB commissions did not reset after restart NT8 B07 therefore still yesterdays commission with today's commission is displayed.

                  ISSUE #2:
                  The "Unrealized PnL" field does nothing... always 0 in trade out of trade does not matter.
                  Same as Rithmic. I assume this field shall show the PnL for an actual trade while in the trade.

                  ISSUE #3:
                  The "Total PnL" is always the same number as "Realized PnL" and I assume shall be a running number while in trade. Probably related to ISSUE #2
                  Same as Rithmic.

                  ISSUE #4:
                  At the end of the session NT 7 resets everything including commissions without restart. NT 8 did not reset IB commissions after restart.

                  ISSUE #5:
                  Trade Performance:
                  a/ Good. Commissions added up are the same amount as per IB "Summary" report "Commission" field.
                  b/ Bad. IB "Net Total" field does not match any of the NT8 "Accounts" tab fields or any of the "Trade Performance" reports fields including "Summary", "Analysis", "Trades"
                  c/ IB "Net Incl. Comm" field does not match any of the NT8 fields.

                  ISSUE #6
                  The following fields on the "Accounts" tab are always 0 "Buying Power", "Cash Value", "Excess intraday margin", "Excess initial margin", "Intraday margin", "Initial Margin", "Look ahead maintenance", "Excess maintenance margin", " Net liquidation", "Unrealized PnL"

                  hope this helps,

                  atata

                  Comment


                    #10
                    Rithmic works relative well however from whatever reason their is some bug in PnL calculation.
                    ISSUE #1.:
                    step 1/ Rithmic Closed Profit/Loss - PNL - $780 - $721.12 = $58.88
                    This is calculated correct in NT 8 since "Total commissions" = $58.88

                    bug: The "Realized PnL" and the "Total PnL" as per NT 8 = $724.80
                    This number shall match the Rithmic "PNL" $721.12 number I assume?! yet is off by $3.68. It is always off and with a small amount.

                    ISSUE #2:
                    The "Unrealized PnL" field does nothing... always 0 in trade out of trade does not matter. I assume this field shall show the PnL for an actual trade while in the trade.
                    [Brett] Unrealized PnL not supported by the NT Rithmic adapter. Therefor we don't display it.

                    ISSUE #3:
                    The "Total PnL" is always the same number as "Realized PnL" and I assume shall be a running number while in trade. Probably related to ISSUE #2
                    [Brett] Correct related to issue #2.

                    ISSUE #4:
                    At the end of the session NT 7 resets everything including commissions without restart. NT 8 on the other will only reset Rithmic account commission after restart. NT 8 will calculate PnL with previous day commissions if not restarted.
                    [Brett] We only support these items from the Rithmic API. We do not handle commissions. Therefor are you using NT commissions on the account by right click account > edit account and setting a commission template? If your saying that cash value and gross realized profit loss is not reset for the next day then I will look into.

                    Cbi.AccountItem.CashValue,
                    Cbi.AccountItem.GrossRealizedProfitLoss,

                    ISSUE #5:
                    The following fields on the "Accounts" tab are always 0 /maybe by design have to fill some data.../ "Buying Power", "Intraday margin", "Initial Margin", "Look ahead maintenance", "Unrealized PnL"]
                    [Brett] Per above we only support the 2 account items in the Rithmic adapter. Not all providers support all fields and fields like Buying Power is only relevant for stocks.

                    IB accounts
                    This is a paper IB account since can't connect to live account... have a thread running on that one.
                    [Brett] Can you link the tread so I could cross check?

                    ISSUE #1.:
                    I have to assume similar issue might exist as per Rithmic however IB commissions did not reset after restart NT8 B07 therefore still yesterdays commission with today's commission is displayed.
                    [Brett] These are the account values we support with IB:

                    Cbi.AccountItem.BuyingPower
                    Cbi.AccountItem.CashValue
                    Cbi.AccountItem.ExcessIntradayMargin
                    Cbi.AccountItem.GrossRealizedProfitLoss
                    Cbi.AccountItem.IntradayMargin
                    Cbi.AccountItem.InitialMargin
                    Cbi.AccountItem.MaintenanceMargin
                    Cbi.AccountItem.NetLiquidationByCurrency
                    Cbi.AccountItem.TotalCashBalance

                    If your reporting an issue on Commissions, this likely is the NT internally calculated commissions you are using and not provided by IB. This commissions get reset after 4:15 EST for the next day. What time are you restarting?

                    ISSUE #2:
                    The "Unrealized PnL" field does nothing... always 0 in trade out of trade does not matter.
                    Same as Rithmic. I assume this field shall show the PnL for an actual trade while in the trade.
                    [Brett] See Item 1 above, the IB adapter does not support reporting that value so its not reported.

                    ISSUE #3:
                    The "Total PnL" is always the same number as "Realized PnL" and I assume shall be a running number while in trade. Probably related to ISSUE #2
                    Same as Rithmic.

                    [Brett] Same as above in 1.

                    ISSUE #4:
                    At the end of the session NT 7 resets everything including commissions without restart. NT 8 did not reset IB commissions after restart.
                    [Brett] As mentioned in 2. Commissions are internally calculated by NT and expected to reset after 4:15 the next day. If your not seeing that please let me know.

                    ISSUE #5:
                    Trade Performance:
                    a/ Good. Commissions added up are the same amount as per IB "Summary" report "Commission" field.
                    b/ Bad. IB "Net Total" field does not match any of the NT8 "Accounts" tab fields or any of the "Trade Performance" reports fields including "Summary", "Analysis", "Trades"
                    [Brett] Likely due to the commissions being added in. How far are we off. Is there any 'method to the madness' you can see that would be able to help me track it down.
                    c/ IB "Net Incl. Comm" field does not match any of the NT8 fields.
                    [Brett] Expected since commissions is not factored into the data provided directly from IB.

                    ISSUE #6
                    The following fields on the "Accounts" tab are always 0 "Buying Power", "Cash Value", "Excess intraday margin", "Excess initial margin", "Intraday margin", "Initial Margin", "Look ahead maintenance", "Excess maintenance margin", " Net liquidation", "Unrealized PnL"
                    [Brett] Items on the list in issue 1 should update. If your not seeing that then I may as you to email your paper account credentials to [email protected] and reference this forum post so I could test.

                    After running through the issues seems majority of the issues are because you did not understand what data comes from IB/Rithmic and what does not. I will look at addressing that by adding something to the help guide.

                    Comment


                      #11
                      my response

                      Originally posted by NinjaTrader_Brett View Post
                      Rithmic works relative well however from whatever reason their is some bug in PnL calculation.
                      ISSUE #1.:
                      step 1/ Rithmic Closed Profit/Loss - PNL - $780 - $721.12 = $58.88
                      This is calculated correct in NT 8 since "Total commissions" = $58.88

                      bug: The "Realized PnL" and the "Total PnL" as per NT 8 = $724.80
                      This number shall match the Rithmic "PNL" $721.12 number I assume?! yet is off by $3.68. It is always off and with a small amount.
                      Brett did not see any response on this issue.
                      ISSUE #2:
                      The "Unrealized PnL" field does nothing... always 0 in trade out of trade does not matter. I assume this field shall show the PnL for an actual trade while in the trade.
                      [Brett] Unrealized PnL not supported by the NT Rithmic adapter. Therefor we don't display it.
                      Open Profit/Loss is not accessible? I assume that would be the unrealized PnL

                      ISSUE #3:
                      The "Total PnL" is always the same number as "Realized PnL" and I assume shall be a running number while in trade. Probably related to ISSUE #2
                      [Brett] Correct related to issue #2.
                      Ko
                      ISSUE #4:
                      At the end of the session NT 7 resets everything including commissions without restart. NT 8 on the other will only reset Rithmic account commission after restart. NT 8 will calculate PnL with previous day commissions if not restarted.
                      [Brett] We only support these items from the Rithmic API. We do not handle commissions. Therefor are you using NT commissions on the account by right click account > edit account and setting a commission template? If your saying that cash value and gross realized profit loss is not reset for the next day then I will look into.
                      That is what I am saying... I've setup the commissions on NT8 calculation is off everyday as per Issue #1 and won't reset at the end of the day at 161500 EST

                      Cbi.AccountItem.CashValue,
                      Cbi.AccountItem.GrossRealizedProfitLoss,

                      ISSUE #5:
                      The following fields on the "Accounts" tab are always 0 /maybe by design have to fill some data.../ "Buying Power", "Intraday margin", "Initial Margin", "Look ahead maintenance", "Unrealized PnL"]
                      [Brett] Per above we only support the 2 account items in the Rithmic adapter. Not all providers support all fields and fields like Buying Power is only relevant for stocks.
                      clear just wanted to let you know since I was already on it, agreed help update would surely clear most of the items I addressed here and some of them migh already addressed, just was too lazy to look

                      IB accounts
                      This is a paper IB account since can't connect to live account... have a thread running on that one.
                      [Brett] Can you link the tread so I could cross check?

                      2 threads addressing the same IB connectivity issue are below
                      http://ninjatrader.com/support/forum...ad.php?t=79993

                      http://ninjatrader.com/support/forum...ad.php?t=78869

                      ISSUE #1.:
                      I have to assume similar issue might exist as per Rithmic however IB commissions did not reset after restart NT8 B07 therefore still yesterdays commission with today's commission is displayed.
                      [Brett] These are the account values we support with IB:

                      Cbi.AccountItem.BuyingPower
                      Cbi.AccountItem.CashValue
                      Cbi.AccountItem.ExcessIntradayMargin
                      Cbi.AccountItem.GrossRealizedProfitLoss
                      Cbi.AccountItem.IntradayMargin
                      Cbi.AccountItem.InitialMargin
                      Cbi.AccountItem.MaintenanceMargin
                      Cbi.AccountItem.NetLiquidationByCurrency
                      Cbi.AccountItem.TotalCashBalance

                      If your reporting an issue on Commissions, this likely is the NT internally calculated commissions you are using and not provided by IB. This commissions get reset after 4:15 EST for the next day. What time are you restarting?
                      Restart of NT8 is either at late night or early in the morning meaning way beyond 4:15 EST
                      ISSUE #2:
                      The "Unrealized PnL" field does nothing... always 0 in trade out of trade does not matter.
                      Same as Rithmic. I assume this field shall show the PnL for an actual trade while in the trade.
                      [Brett] See Item 1 above, the IB adapter does not support reporting that value so its not reported.
                      ko

                      ISSUE #3:
                      The "Total PnL" is always the same number as "Realized PnL" and I assume shall be a running number while in trade. Probably related to ISSUE #2
                      Same as Rithmic.

                      [Brett] Same as above in 1.
                      ko

                      ISSUE #4:
                      At the end of the session NT 7 resets everything including commissions without restart. NT 8 did not reset IB commissions after restart.
                      [Brett] As mentioned in 2. Commissions are internally calculated by NT and expected to reset after 4:15 the next day. If your not seeing that please let me know.

                      weird enough this morning after NT8 restart the commissions were reset for IB as well I'll keep an eye on it everyday see how it goes

                      ISSUE #5:
                      Trade Performance:
                      a/ Good. Commissions added up are the same amount as per IB "Summary" report "Commission" field.
                      b/ Bad. IB "Net Total" field does not match any of the NT8 "Accounts" tab fields or any of the "Trade Performance" reports fields including "Summary", "Analysis", "Trades"
                      [Brett] Likely due to the commissions being added in. How far are we off. Is there any 'method to the madness' you can see that would be able to help me track it down.

                      I'll see if I can see a pattern... however whoever is taking care of that piece of the code shall see it pretty quickly that something is messed up in the logic... there was a fix provided in this release and the "madness" was addressed, meaning I think we are a lot closer to the real value than we were on previous releases

                      c/ IB "Net Incl. Comm" field does not match any of the NT8 fields.
                      [Brett] Expected since commissions is not factored into the data provided directly from IB.
                      ko

                      ISSUE #6
                      The following fields on the "Accounts" tab are always 0 "Buying Power", "Cash Value", "Excess intraday margin", "Excess initial margin", "Intraday margin", "Initial Margin", "Look ahead maintenance", "Excess maintenance margin", " Net liquidation", "Unrealized PnL"
                      [Brett] Items on the list in issue 1 should update. If your not seeing that then I may as you to email your paper account credentials to [email protected] and reference this forum post so I could test.
                      well the answer is no for now...

                      After running through the issues seems majority of the issues are because you did not understand what data comes from IB/Rithmic and what does not. I will look at addressing that by adding something to the help guide.
                      a/ Brett, you shall be more polite with you wording... I did understand that some of the issues are not really issues, yet since I am spending some of my time to test this for you /doing QA work for NT with no pay/, for everyone's benefit. The reason I am doing this that I hope at the end of this development cycle we all shall have a nice bug free, well documented product. I felt I shall address all items for your attention and than your team can either fix it or just document it...

                      Comment


                        #12
                        PnL calculation Rithmic

                        I donno what is going on...
                        This morning the first time ever for me Rithmic PNL is matching NT 8 calculated "Realized PnL" on the Account Tab.

                        still a BUG: The NT 8 "Realized PnL" does not match the "Trade Performance" "Trades ($)" report "Cum. net Profit" column...

                        Realized PnL = $816.88
                        Cum. net Profit = $813.20

                        The delta is equal to one round trip... $3.68
                        This seems to be the pattern here 1 round trip difference to the real value. As per my update yesterday had the same thing.

                        Hope this helps to narrow down to the problem...

                        atata

                        Comment


                          #13
                          IB PnL calculation

                          Commissions as per IB template I've setup are calculated correctly.
                          IB commissions 2.31 per side 4.62 per round trip.

                          IB summary report:
                          Net Total: $1,290.00
                          Commission: 69.30
                          Net Incl. Comm: $1,220.70

                          NT 8 Account Tab:
                          Total Commissions: $69.30
                          Gross Realized PnL: $1,685.00 NOT GOOD, no idea where this number is coming from...
                          Realized PnL: $1,615.70 NOT GOOD however this is most likely derived from the value above

                          NT 8 Trade Performance Summary ($) report
                          Total net profit: $1,206.84 I'd assume this shall match the "IB Net Incl. Comm" field on the IB Summary report
                          Gross Profit: $1,220.70 I'd assume this shall rather match the "IB Net Total" field yet it is matching the "Net Incl. Comm" field

                          NT 8 Trade Performance Trades ($) report
                          Cum. net profit: $1,206.84 this is less by $13.86... it might matches basically 1 round trip if I take that I was trading 3 contracts at a time on this account, hope that makes sense

                          kind regards,

                          atata

                          Comment


                            #14
                            Atata,

                            Thanks for responding and looking into issue. For sure appreciate your feedback and willingness to test!

                            I needed to break down the remaining items individually so I could make some progress.

                            The rithmic account values I'm considering mostly good to go, I get the idea that there is issue with IB Gross Realized PnL and we are seeing Trade Performance value be off marginally by about one commission round trip.

                            I'll look into this on my side and get update you as I find something.

                            Comment


                              #15
                              Brett,

                              here is a screenshot from last night way after 4:15 EST... while the rest of the fields were reset commissions were not. I had to restart NT 8 B07 to have the commissions fields reset.
                              IB commissions were reset as well so not sure a couple of days ago why that was any different.

                              atata
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by adeelshahzad, Today, 03:54 AM
                              5 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by stafe, 04-15-2024, 08:34 PM
                              7 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by merzo, 06-25-2023, 02:19 AM
                              10 responses
                              823 views
                              1 like
                              Last Post NinjaTrader_ChristopherJ  
                              Started by frankthearm, Today, 09:08 AM
                              5 responses
                              21 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              43 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X