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

Strategy Position

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

    Strategy Position

    Hi,

    I have a problem with strategy position update. When i run strategy on real time sim account or backtest everything works fine. But when i run it on real account my strategy position lags behind acct.position for one execution. It shows my strategy position like it was one execution back. Below i posted a picture first one is in sync that runs real time sim account, second runs on my real account.

    I cant get my strategy position in sync

    my script uses OnBarUpdate calculation

    please help

    #2

    Comment


      #3
      Hello Radovan55,

      Thank you for the post.

      The image shows two strategy rows, are these both on the same account/instrument or is that a sim vs live comparison?

      The sync column will only show true of the strategy is truly in sync, from the given image it appears that the strategy did not place an order which would match the account position. Are you seeing that the orders in the strategy performance report match the orders placed to the account in the orders tab for the realtime trades?

      I look forward to being of further assistance.

      JesseNinjaTrader Customer Service

      Comment


        #4
        Hi,

        Upper row is on sim account and bottom one is on my real account. (same strategy)

        They both run on same instrument real time.

        They both work correctly(orders get executed like they should) only that on my real account strategy position is lagging for one exsecution. (113.000 instead of 128.000)

        (real account) - In Orders tab everything is fine(orders get executed) and Executions tab is fine and i get a fill on my real account. Just strategy position doesnt update position correctly



        Comment


          #5
          Hello Radovan55,

          What broker are you currently using and what version of the platform do you have?

          You can locate the version in the help -> about menu.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            8.0.22.2 64-bit

            Comment


              #7
              Hello Radovan55,

              Thanks for that, can you also tell me what broker you are connected to and placing orders to?

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Rithmic.

                I dont understand how strategy position can be wrong if it executes correctly.

                Comment


                  #9
                  I taught that strategy position doesnt have anything to do with broker connection.
                  Only acct.position does
                  Is my understanding correct?

                  Thanks

                  Comment


                    #10
                    Hello Radovan55,

                    I reviewed this further and see that we currently have a issue tracked surrounding strategy reporting in the control center and Rithmic (NTEIGHT-13447).

                    The Rithmic API can submit position events ahead of related order and execution update events. As a result, it is a limitation with NinjaTrader when using Rithmic that the strategy position displayed on the UI might not match the actual strategy position contained in the StrategyBase.Position object. I have added your vote to the feature request SFT-3467 to improve ordering of Position Update events with Rithmic connections

                    I taught that strategy position doesnt have anything to do with broker connection.
                    The strategy position is representative of what the strategies virtual position is or what it is paying attention to. The Account position can be in sync when using a single strategy in normal use cases however in this situation it can display false due to the missing position updates to the UI.


                    Please let me know if you have any additional questions on this matter.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Jesse!

                      Do you maybe have some suggestion how could i code it myself to match strategy position?

                      Comment


                        #12
                        Hello Radovan55,

                        Are you referring to changing the UI in the control center? That would not be able to be changed by NinjaScript coding, that is a limitation of the position updates the Rithmic adapter is sending out. If the strategy is otherwise working normally and you can see that on the account position/broker report you can instead refer to the account position in the control center to know its current position. Assuming you are running a single strategy per instrument then it should match the account position.

                        I look forward to being of further assistance.
                        JesseNinjaTrader Customer Service

                        Comment


                          #13
                          Thank you!

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by cls71, Today, 04:45 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post cls71
                          by cls71
                           
                          Started by mjairg, 07-20-2023, 11:57 PM
                          3 responses
                          213 views
                          1 like
                          Last Post PaulMohn  
                          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                          4 responses
                          544 views
                          0 likes
                          Last Post PaulMohn  
                          Started by GLFX005, Today, 03:23 AM
                          0 responses
                          3 views
                          0 likes
                          Last Post GLFX005
                          by GLFX005
                           
                          Started by XXtrader, Yesterday, 11:30 PM
                          2 responses
                          12 views
                          0 likes
                          Last Post XXtrader  
                          Working...
                          X