Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Duplicate orders from a strategy

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

    Duplicate orders from a strategy

    Hi

    Last night for the first time in 7 months, my strategy placed duplicate entry orders and I would like clarification of my understanding before I make a change, please.

    With the managed approach to entry orders, "By default, orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted".
    I am using "entryOrder1 = EnterShort( nContracts1, entryName1 );"
    Within OnExecution(), I set a flag to prevent the entry order code running again if the entry order is executed.
    CalculateOnBarClose = false;
    EntriesPerDirection = 3;
    EntryHandling = EntryHandling.UniqueEntries;
    TimeInForce = Cbi.TimeInForce.Day;

    Is it possible that the arrival of the next tick was earlier than the execution of the entry order, resulting in the entry order being placed again?

    My understanding was that the entry order would be cancelled and resubmitted if it was not already executed, so it should still result in only one entry.

    Regardless of the cause, I think I can prevent this occuring by setting EntriesPerDirection = 1; Right?

    If EntriesPerDirection = 3; in Initialize(), but I change it to 1 in the New Strategy settings when the strategy is added in the Control Center, which takes precedence?

    Sorry about the many questions, but this is trading live and I don't want to make unnecessary changes.

    Cheers
    Tony

    #2
    Hi Tony, since you're placing a market order I would not expect it to expire and thus get resubmitted - the reason was the higher EntriesPerDirection you ran with hitting the race condition on the execution taking longer than the next tick with COBC false, that's my best guess as well without having run it. The UI entered EntriesPerDirection would override your code setting, so that's a possible approach.

    Comment


      #3
      Thanks, Bertrand.
      All is clear.
      Cheers
      Tony

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X