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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    61 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    148 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X