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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    65 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Working...
    X