Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market position not uptodate after order filled

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

    Market position not uptodate after order filled

    Hi,

    I see that in rare occasions the market position of the strategy is not uptodate. For example, what that I see is that the order has been filled on tick #1000 (I check that during Onorderupdate) but the market position is updated 10 ticks later (tick #1010). Is there way to get the position to be updated when the order is filled?

    Thanks!

    Juan


    #2
    Hello Aquatrade,

    Thank you for your reply.

    Who is your data provider?

    You could certainly use the unmanaged approach and calculate the position internally to the strategy. The strategy could then rely on it's own calculated position in lieu of relying on position updates from the broker. I've attached an example of this below.

    An overview of using the unmanaged approach may be found in our help guide here:



    Please let us know if we may be of further assistance to you.
    Attached Files

    Comment


      #3
      Thanks,

      My data provider is CQG. The example is very useful, I'll try to use some of the ideas in your code for my strategy.

      Thanks one more time

      Juan

      Comment


        #4
        I have an additional question. In the code you provide I see:
        Code:
        if (shortEntry != null && shortEntry == order)
        {
        // Reset the shortEntry Order object to null if order was cancelled without any fill
        if (order.OrderState == OrderState.Cancelled && order.Filled == 0)
        {
        shortEntry = null;
        }
        }
        what is the difference between:

        order.OrderState == OrderState.Cancelled && order.Filled == 0

        and

        order.OrderState == OrderState.Cancelled


        In other words, why checking for number of orders filled? is it because of partial fill?

        Thanks!

        Comment


          #5
          Hello Aquatrade,

          Thank you for your reply.

          Yes, that's exactly right, because if the order is partially filled but not fully filled we would want to handle that differently than simply just setting that reference back to null immediately.

          Please let us know if we may be of further assistance to you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          88 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          134 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          118 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          67 views
          0 likes
          Last Post PaulMohn  
          Working...
          X