Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How Do I Code a Strategy That Cancels Order After Not Filled in Two Periods?

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

    How Do I Code a Strategy That Cancels Order After Not Filled in Two Periods?

    as the title says:

    How Do I Code a Strategy That Cancels Order After Not Filled in Two Periods?

    Once the conditions of my strategy are met, and an order is placed, I am concerned that, after two periods, the desireable conditions are no longer in place, and I therefore want to cancel the order.

    How would I begin to code this?


    Thanks in advance.

    #2
    You would need to use the CancelOrder() command then at your desired bar to cancel your working entries, when you place the order keep track of the barnumber so you would know when the order has been working 2 bars then without a fill. We have a reference sample that demonstrates this approach here - http://www.ninjatrader.com/support/f...ad.php?t=18890

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X