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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          65 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          139 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X