Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buys and Sells not matching in number

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

    Buys and Sells not matching in number

    I am working on a strategy that averages down. I am running into a problem. For some reason, after it averages down more than two times it seems or it could be that the fill executions are greater than the original number of orders, the number of contracts in the target are greater than the number of contracts in the position. Can anyone shed some light on why this is happening and what to do to resolve it?

    #2
    richwaters, are you receiving any overfill warning by NinjaTrader as this happens? It would be helpfult to debug the order behavior seen with the TraceOrders feature - http://www.ninjatrader.com/support/f...ead.php?t=3627

    Lastly, are you sure the account position is in sync to the strategy position?

    Comment


      #3
      I don't seem to be getting any overfill warnings. I also tried setting the Sync Account Position = True, but it didn't make any difference.

      Could this be the problem? When the condition for long entry is true, 12 orders are set up at once at different intervals. Frequently, just after the entry signal is triggered, and even after some fills, the condition is no longer true and the orders are cleared. Then, the condition becomes true again and the orders are back, but those that have already been placed are ignored. Could this setting up of the orders, removing the unfilled orders, and then putting them back cause the buys and sell targets to get out of whack? If so, can someone point me in the right direction as to how to handle the orders properly if this is not the best way?

      Comment


        #4
        richwaters, the SyncAccountPosition is ok - to understand what is happening in your code I would suggest to simplify it and then adding TraceOrders = true to your Initialize(), that way helpful order debug info is printed to your output window as the strategy runs.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X