• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancelling an order without an incoming tick

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

    Cancelling an order without an incoming tick

    Hi,
    I have a client who wishes to place trades using limit orders on stocks so thin that often no ticks come in for long periodsl.
    I have implemented a timer system so that the strategy triggers at regular intervals and can place an order when desired.
    This works fine.
    However when that entry order needs to be cancelled (entry criteria is no longer valid) sending a cancel request for that order does nothing.
    e.g.
    CancelOrder(entryOrder)

    A tick coming in will finally motivate NT8 to cancel the order.

    Is there some way around this? How can I poke NT8 in the ribs in the right way to get it to cancel an order without a tick from the market?

    Thanks,
    saltminer

    #2
    Great question. I have no idea. I wonder if this worked in NT7.

    Might have to post who you are connected to - it might be at the adapter level?

    Comment


      #3
      Hello saltminer and sledge,

      After testing this on GC 02-18, I am able to cancel my orders with a timer before an additional tick is received.

      I may suggest checking to make sure the timer is actually firing. I've attached a test script that I used if you would like to test on your end and review the code.

      Please let me know if this does not resolve your inquiry.
      Attached Files
      Last edited by NinjaTrader_Jim; 01-16-2018, 03:50 PM.
      JimNinjaTrader Customer Service

      Comment


        #4
        Hi Jim,
        thanks so much for building that. It closely resembled my own code, and for a good while I couldn't figure out what was different. I realised at last that I had to use the EnterLongLimit with the signature that includes BarsArray and GoodTilCancelled in it, e.g. EnterLongLimit(0,true,price,name)
        It then worked as expected.

        By the way, I had used a DispatcherTimer in my code, while you used the ye olde Forms.Timer.
        I see conflicting advice about these two in various posts on the forum. Can I get a 2018 update on exactly which is the recommended timer for NT8 WPF?

        Thanks again,
        saltminer

        Comment


          #5
          Hello saltminer,

          I'm glad you got it sorted on your end.

          Both timers would be valid for use, however the WPF DispatcherTimer would be a more robust/powerful timer to use than the WinForms timer.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by linacesaro, Today, 09:17 PM
          0 responses
          3 views
          0 likes
          Last Post linacesaro  
          Started by n8dogg59, Today, 06:55 AM
          2 responses
          17 views
          0 likes
          Last Post n8dogg59  
          Started by pstrusi, Today, 03:29 PM
          2 responses
          10 views
          0 likes
          Last Post pstrusi
          by pstrusi
           
          Started by ntbone, Today, 03:06 PM
          0 responses
          4 views
          0 likes
          Last Post ntbone
          by ntbone
           
          Started by AMATX, Today, 01:43 PM
          2 responses
          9 views
          0 likes
          Last Post AMATX
          by AMATX
           
          Working...
          X