Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order canceled on close the bar on lower timeframe

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

    Order canceled on close the bar on lower timeframe

    Hi,
    I’m programming a multi timeframe (MTF) strategy.
    When the strategy open an order and bar on the lower time frame closed the order is cancelled:
    • 01.10.2014 07:58:09 Order='0d8a26dcec25434d9e648883d25657ee/Replay101' Name='Buy' State=PendingSubmit Instrument='ES ##-##' Action=Buy Limit price=1962.25 Stop price=0 Quantity=1 Type=Limit Tif=Gtc OverFill=False Oco='' Filled=0 Fill price=0 Token='0d8a26dcec25434d9e648883d25657ee' Gtd='01.01.0001 00:00:00'
    • 01.10.2014 07:58:09 Order='0d8a26dcec25434d9e648883d25657ee/Replay101' Name='Buy' State=Accepted Instrument='ES ##-##' Action=Buy Limit price=1962.25 Stop price=0 Quantity=1 Type=Limit Tif=Gtc OverFill=False Oco='' Filled=0 Fill price=0 Token='0d8a26dcec25434d9e648883d25657ee' Gtd='01.01.0001 00:00:00'
    • 01.10.2014 07:58:09 Order='0d8a26dcec25434d9e648883d25657ee/Replay101' Name='Buy' State=Working Instrument='ES ##-##' Action=Buy Limit price=1962.25 Stop price=0 Quantity=1 Type=Limit Tif=Gtc OverFill=False Oco='' Filled=0 Fill price=0 Token='0d8a26dcec25434d9e648883d25657ee' Gtd='01.01.0001 00:00:00'
    • 01.10.2014 07:58:09 Open: 1963 Close: 1962.5 <- Bar close on lower timeframe
    • 01.10.2014 07:58:09 Order='0d8a26dcec25434d9e648883d25657ee/Replay101' Name='Buy' State=PendingCancel Instrument='ES ##-##' Action=Buy Limit price=1962.25 Stop price=0 Quantity=1 Type=Limit Tif=Gtc OverFill=False Oco='' Filled=0 Fill price=0 Token='0d8a26dcec25434d9e648883d25657ee' Gtd='01.01.0001 00:00:00'
    • 01.10.2014 07:58:09 Order='0d8a26dcec25434d9e648883d25657ee/Replay101' Name='Buy' State=Cancelled Instrument='ES ##-##' Action=Buy Limit price=1962.25 Stop price=0 Quantity=1 Type=Limit Tif=Gtc OverFill=False Oco='' Filled=0 Fill price=0 Token='0d8a26dcec25434d9e648883d25657ee' Gtd='01.01.0001 00:00:00'
    • 01.10.2014 08:00:13 Open: 1962.25 Close: 1962.5 <- Bar close on lower timeframe


    What can I do to fix this problem?

    Bye,

    Michel

    #2
    Hello,

    Thank you for the question.

    It is likely that it is being canceled if the condition to submit the order is no longer true and the order is not marked as LiveUntilCanceled = true.

    An order is canceled if you Submit an order and then another call to OnBarUpdate occurs in which the order is not re submitted, in this case you submit on your primary and then have OnBarUpdate called again for the secondary which canceled the order.

    To resolve this, you could either use LiveUntilCanceled or logic, http://ninjatrader.com/support/helpG...EnterLongLimit

    To use LiveUntilCancelled you would do this in the overloads when submitting the order. So as an example, instead of:

    Code:
    EnterLongLimit(int quantity, double limitPrice, string signalName)
    you would use

    Code:
    EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)
    If you instead wanted to correct this with logic, the condition that became true to submit the order would need to also remain true during the OnBarUpdate calls for the secondary series, whatever logic is required to make that change would be required to correct this logically.

    I look forward to being of further assistance.

    Comment


      #3
      Hello Jesse,

      Thank you! I have fixed the problem.

      Bye.

      Michel

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X