Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Always use limitOrder with "liveUntilCancelled" in slow markets ... ?

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

    Always use limitOrder with "liveUntilCancelled" in slow markets ... ?

    Hi,

    I have seen weird case when using limit-orders which are only active for the current bar.

    When trading in markets which are very slow and doesn't produce many ticks per minute (e.g. overnight 6E germany time) then I use the following order:

    Code:
    targetOrder = ExitShortLimit (0, false, quantity, targetLevel, "Profit-Target", entryOrder.Name);
    The second parameter indicates that this order is only active for the current bar, so at the next bar I have to reset the order.

    Now I'm working on M1-Timeframe and sometimes after midnight I see in my log that the limit order is cancelled ... after testing with the replay connection I can reproduce the following ...

    00:26 - Orders placed, all seems to be ok.
    00:27 - Orders placed again, because I need to set it for everey bar
    00:28 - ...
    00:29 - ...
    00:30 - Order: Type = Limit State = Cancelled

    There is no new bar on 00:30 because there are limited ticks in the market, so the next bar opens at 00:30 plus 10 seconds, and right before the 10 seconds the Limit-Order is cancelled.

    So I need some confirmation about this. Is my assumption correct that in a slow market the orders are cancelled on a new bar, when there are no new ticks for the new bar ... after 10 seconds of inactivity?

    So for this case I need to use always "liveUntilCancelled" configuration of orders?

    Thx,
    DT

    #2
    DT, there's no set time when the order will expire in this case, when you have a slow market like this it will be cancelled when the next open tick for a new bar arrives (with liveUntilCancelled to false).

    Comment


      #3
      Ok, thx for the answer ... but the posted flow is exactly that what happens in my case. Only with liveUntilCancelled = true the orders are not cancelled. It is very easy to reproduce ... maybe it is a bug in NT ... don't know ... but the workaroung works for me ...

      Thx,
      DT

      Comment


        #4
        Please use TraceOrders = true to see the exact reason it was cancelled.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        64 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