Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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).
    BertrandNinjaTrader Customer Service

    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 algospoke, Today, 06:53 PM
        0 responses
        2 views
        0 likes
        Last Post algospoke  
        Started by mlprice12, 12-21-2021, 04:55 PM
        3 responses
        291 views
        0 likes
        Last Post paypachaysa  
        Started by lorem, 04-25-2024, 09:18 AM
        20 responses
        85 views
        0 likes
        Last Post lorem
        by lorem
         
        Started by xepher101, 05-10-2024, 12:19 PM
        4 responses
        52 views
        0 likes
        Last Post xepher101  
        Started by DawnTreader, 05-08-2024, 05:58 PM
        22 responses
        82 views
        0 likes
        Last Post DawnTreader  
        Working...
        X