• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live stop/target order behavior different than sim behavior

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

    Live stop/target order behavior different than sim behavior

    I'm developing a strategy that keeps track of 3 private orders, an entry order, stop order, and target order. When using a sim account, submission, cancellation, fills, and OCO all work as expected. However, when I use this same strategy on a live account, the stop and target orders only submit in the quantity of the first order fill (one full fill or first partial fill). For example, if the entry quantity is 10 and one order fills all 10, the stop and target will submit for 10. If the entry quantity is 10 and I receive partial fills of 3, 5, and 2, the stop and target only submit for 3. I have the strategy code and log output from an example execution...looking for someone at NT to take a look. Again, everything works as designed when using a sim account, the issue only appears when using a live account.

    Thanks - Brandon

    #2
    Hello brohnhdon,

    Thank you for the post.

    By the description it sounds like in realtime, it is working as expected except for when a partial fill occurs is this correct?

    If so, you will very likely need to add additional checking into OnExecutionUpdate to handle Partial fills instead of just submitting the targets immediately.

    You could check the "Filled" property to get the quantity that was actually filled and check it against the Total target quantity to ensure a full fill had happened before submitting the targets. You can also check if the OrderState was PartFilled to do other logic besides submitting the targets.

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

    Comment


      #3
      Yes that is correct. However I don't understand why the exact same logic works when I receive partial fills in sim. Am I able to email you my OnOrderUpdate(), OnExecutionUpdate() methods and log file for a closer look?

      Comment


        #4
        Hello brohnhdon,

        Thank you for the reply.

        Yes, you can send in specific samples to our platform support [at] ninjatrader.com address or attach them to your forum posts. I would like to note that we are unable to directly debug your script so you would need to make a reduced sample that demonstrates the problem directly. If you have a large strategy currently, please ensure to make a sample of only the logic surrounding the failing situation for clarity.

        Most likely you would need to further debug the situation further to find what specifically is happening differently between the two tests. I would suggest also adding Prints into the OnExecutionUpdate override and surrounding the logic controlling the targets to see if it is happening identically in both tests.

        This could additionally be caused by the StopTargetHandling property, this property would also affect the outcome in this situation. There is a note about partial fills and this property here: https://ninjatrader.com/support/help...partial%2Bfill



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

        Comment


          #5
          I'll go ahead and change the StopTargetHandling property and see if that resolves the issue. If not, I'll trim down the code and send it to platform support.

          I appreciate the help, thank you - Brandon

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by PLeary, Today, 06:25 AM
          0 responses
          3 views
          0 likes
          Last Post PLeary
          by PLeary
           
          Started by sergey_z, Today, 06:17 AM
          0 responses
          1 view
          0 likes
          Last Post sergey_z  
          Started by nikkk, Today, 06:14 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Started by chazyang, Today, 02:01 AM
          2 responses
          10 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Started by tonynt, Today, 01:20 AM
          1 response
          22 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X