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
    Chris L.NinjaTrader Customer Service

    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
        Chris L.NinjaTrader Customer Service

        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:


            Chris L.NinjaTrader Customer Service

            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 andrewtrades, Today, 04:57 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              6 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              7 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X