Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy sync is false the moment a trade is entered (Topstep account)

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

    Strategy sync is false the moment a trade is entered (Topstep account)

    Hi,

    I'm experiencing an issue with a strategy trading a Topstep account where the moment a trade is taken, sync goes from true to false. When the strategy enters a trade, Topstep and NinjaTrader positions seem to match perfectly.

    However, when the position is eventually closed, NinjaTrader shows that the position is still open and proceeds to trade as if that position is open. I'm only running one strategy, and I'm not manually placing any orders that would cause sync to be false. Any idea why this would be?

    Thanks!

    #2
    Hi irochester, thanks for posting. The Rithmic/Topstep connection has a caveat when working with NinjaScript strateges where the OnOrderUpdate, OnExecution, and OnPositionUpdate can be called out of order and cause issues in strategies that make trading decisions based on these updates. The strategies Position object is updated based on Executions, so there should be proper execution information on the Executions tab of the Control center for this strategy. If your strategy is reading the Position object and making trading decisions based on this the order of these update calls must be taken into consideration. I attached an example that properly handles this caveat with TopStep connections.

    Kind regards,
    -ChrisL
    Attached Files

    Comment


      #3
      Hi Chris,

      Thanks for the response. Of the event methods you mentioned, we are only using OnExecution, so there's no issue there. Also, we are not using the Position object to make any of our trade decisions, and we are pinpointing our entry orders in OnExecution by signal name. Any other ideas?

      Comment


        #4
        Hi, thanks for the follow up. Please study the script that I posted. This is designed to work properly with Rithmic/Interactive Brokers connections so that the strategy does not rely on the default ordering up the positions and execution updates.

        Kind regards,
        -ChrisL

        Comment


          #5
          Hi Chris,

          We have studied your script closely and even tried some other fixes to no avail. Sim101 is always in sync but Rithmic accounts go out of sync almost immediately upon trading. If it's of any help, we noticed that our entry order quantities are correct, but exit order quantities do not match. This seems to be what is causing it to go out of sync. If there's any more information I can provide that would help, please let me know.

          Comment


            #6
            Hi irochester, The Rithmic connection will not display the position information on the Strategies tab correctly because the OnExecution/OnPosition update events come out of order. Please use Draw.TextFixed from the OnPositionUpdate method to draw the position information on the chart instead:


            Comment


              #7
              Hi Chris,

              It appears as though the position information is being displayed correctly. When I open RTrader to view the actual orders that were placed and executed, they match what is being shown in the Strategies tab. Most recently, a long entry was executed for 10 lots while exits were each placed for 1 lot. Very strange...

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              60 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              39 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              21 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              23 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              51 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X