Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accepted & Working

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

    #16
    Thank you Chelsea for your reply. I need further clarification.
    Are you saying that trading with Rithmic, the 'account.Positions' or the Positions that I get with 'OnPositionsUpdate' cannot never be relied upon? Not even to double check that I am flat?

    Ultimately, what I am seeking is only to double check that sumFilledLong1 is coherent with an alternative method so I can confirm that I am flat.

    In other words, is there an alternative method to sumFilledLong1 with Rithmic, regardless of speed?
    I don't need speed for this test since I will be making sure that I have few flat bars between trades.

    Best
    Gio​

    Comment


      #17
      Hello Gio​,

      The position update from rithmic sometimes is delayed or doesn't come at all.

      It's better to rely on the execution only from OnExecutionUpdate() or the order only from OnOrderUpdate().

      Yes, the sumFilled variables would track the part fills from OnExecutionUpdate() as the execution.Order.Filled may be incorrect until OnOrderUpdate() runs.

      "In other words, is there an alternative method to sumFilledLong1 with Rithmic, regardless of speed?"

      The issue isn't speed. The issue is the sequence the order, execution, and position update is received from the brokerage.

      I'm not aware of another workaround.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Thank you so much Chelsea for this clarity and for saying that you are not aware of a workaround. It allows me to work the problem correctly.

        I will use the sumFilled as most reliable information.

        I may still have a last point of confusion and truly appreciate your patience.

        I assume that the Position Tab of the platform mostly reports the open positions correctly at the account level.

        Maybe the most important thing for me is to know if the following method reliably reads what I see on the Platform's Positions Tab. Does it?

        Code:
                private int GetAccountPosition()
                {
                    if (submissionAccount.Positions.Where(o => o.Instrument == Instrument).Count() > 0)
                    {
                        accountPosition = submissionAccount.Positions.Where(o => o.Instrument == Instrument).Last();
                        qq = accountPosition.Quantity;
                    }
                    else
                    {
                        qq = 0;
                    }
        
                    return qq;
        ​​        }
        If yes, maybe accepting that it may be a delayed information and accepting that I may run only one strategy on the entire account, could this good information to check for prolonged discrepancies and could give me an alert. What is your opinion on this?

        Thank you again!
        Gio

        Comment


          #19
          Hello Gio,

          "I assume that the Position Tab of the platform mostly reports the open positions correctly at the account level."

          This entirely depends on if the brokerage sends the instrument update in a timely manner or at all.

          "Maybe the most important thing for me is to know if the following method reliably reads what I see on the Platform's Positions Tab. Does it?"

          Yes, that code would retrieve the account position which is the same value shown on the Control Center.

          "If yes, maybe accepting that it may be a delayed information and accepting that I may run only one strategy on the entire account, could this good information to check for prolonged discrepancies and could give me an alert."

          I'm not entire sure what you are asking. I've advised that if you are looking for part fills, you track this to a sumFilled variable in OnExecutionUpdate().
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            If understand you correctly, what your are saying is that one cannot fully rely on the account position tab information even when one trades manually.

            Does this mean that one must make a mental note of how many position were opened and how may were closed?.

            Thank you for bearing with my long line of questions.
            I appreciate your attention and patience.
            Gio
            Last edited by giogio1; 12-19-2024, 04:15 AM.

            Comment


              #21
              Hi Chelsea,
              is the synthesis and my assumptions below correct?
              - OnOrderUpdate() is the fastest to update with a sort of notification thread from the broker/exchange.
              -OnExecutionUpdate() is adjourned by my machine based on OnOrderUpdate() rather than a separate notification thread from the broker/exchange.
              - OnPositionsUpdate() is the slowest to update with a sort of notification thread from the broker/exchange.
              ​Thank you
              Gio

              Comment


                #22
                Hello Gio,

                "OnOrderUpdate() is the fastest to update with a sort of notification thread from the broker/exchange."

                No, you cannot make this assumption. Noted in posts 2, 4, 8, and 15, the order update may not be received first or in the correct sequence.

                OnOrderUpdate() updates when the order update message is received from the connected brokerage.
                OnExecutionUpdate() updates when the execution update message is received from the connected brokerage.
                OnPositionUpdate() updates when the instrument update message is received from the connected brokerage.

                These may not be in sequence from some brokerages (meaning Rithmic and Interactive Brokerage connections). The execution update might be received before the order update and could delayed by several seconds. The order update might be received before the execution update and could be delayed by several seconds.

                This means no method would be the fastest, as they would be updating independently when the brokerage sends that information.

                "OnExecutionUpdate() is adjourned by my machine based on OnOrderUpdate() rather than a separate notification thread from the broker/exchange."

                The OnExecutionUpdate() method updates when the execution message is received from the brokerage.

                "OnPositionsUpdate() is the slowest to update with a sort of notification thread from the broker/exchange."

                The instrument (position) update might be received before or after the order and execution updates and could delayed by several seconds.


                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Thank you so much Chelsea, have good holidays. This is perfect for me and probably conclusive. Feel free to change the subject of this thread so people can easily find all this information. Hope all this effort of yours is beneficial to everyone.. I am definitely getting where I need to be on this topic.
                  Gio

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  85 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  47 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  29 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  32 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  67 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X