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

Auto Cancelled order limit

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

    Auto Cancelled order limit

    Hi,

    I'm working with IOrders, and BuyLimit orders, but NT rejects order constantly. This is the text from Output window

    Order='NT-00000/Sim101' Name='Compra1' State=PendingSubmit Instrument='$EURUSD' Action=Buy Limit price=1,372 Stop price=0 Quantity=1 Strategy='ejObjCompra' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='68eb4da299a14c788d2abab48489b5a4' Gtd='01/12/2099 00:00:00'
    Order='NT-00000/Sim101' Name='Compra1' State=Accepted Instrument='$EURUSD' Action=Buy Limit price=1,372 Stop price=0 Quantity=1 Strategy='ejObjCompra' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='68eb4da299a14c788d2abab48489b5a4' Gtd='01/12/2099 00:00:00'
    Order='NT-00000/Sim101' Name='Compra1' State=Working Instrument='$EURUSD' Action=Buy Limit price=1,372 Stop price=0 Quantity=1 Strategy='ejObjCompra' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='68eb4da299a14c788d2abab48489b5a4' Gtd='01/12/2099 00:00:00'
    Order='NT-00000/Sim101' Name='Compra1' State=PendingCancel Instrument='$EURUSD' Action=Buy Limit price=1,372 Stop price=0 Quantity=1 Strategy='ejObjCompra' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='68eb4da299a14c788d2abab48489b5a4' Gtd='01/12/2099 00:00:00'
    Order='NT-00000/Sim101' Name='Compra1' State=Cancelled Instrument='$EURUSD' Action=Buy Limit price=1,372 Stop price=0 Quantity=1 Strategy='ejObjCompra' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='68eb4da299a14c788d2abab48489b5a4' Gtd='01/12/2099 00:00:00'


    How could place an orderlimit place till executed?

    Thanks

    #2
    Hi Giger2000,

    Thank you for your post.

    You would need to use the Live Until Cancelled feature for the limit order.
    Take a look at the link below on Advanced Order Handling for the Live Until Cancelled orders
    Advanced Order Handling

    Additionally, take a look at this link below on how to use the code for the EnterLongLimit() with the Live Until Cancelled -
    EnterLongLimit()

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Hi Giger2000,

      Thank you for your post.

      You would need to use the Live Until Cancelled feature for the limit order.
      Take a look at the link below on Advanced Order Handling for the Live Until Cancelled orders
      Advanced Order Handling

      Additionally, take a look at this link below on how to use the code for the EnterLongLimit() with the Live Until Cancelled -
      EnterLongLimit()

      Let me know if I can be of further assistance.
      I had tried with this code:

      protected override void OnBarUpdate()
      {
      if (entryOrder == null && Close[0] < Open[0])
      entryOrder = EnterLongLimit(0, true, 1, 1.367, "Buy1");



      }

      But didn't works. The orders has been cancelled

      Comment


        #4
        Giger2000,

        You will need to use TraceOrders = true; in the initialize() method and debug the code to see why the order is getting cancelled.

        With the Live Until Cancelled being set, NinjaTrader will not cancel out your order unless there is something else being implemented such as a CancelOrder() or EnterShort() being placed.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Cal View Post
          Giger2000,

          You will need to use TraceOrders = true; in the initialize() method and debug the code to see why the order is getting cancelled.

          With the Live Until Cancelled being set, NinjaTrader will not cancel out your order unless there is something else being implemented such as a CancelOrder() or EnterShort() being placed.
          I'he found found the problem!!!. I had Exitonclose=true

          Thks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by reynoldsn, Today, 09:01 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Gavin45, Today, 08:40 AM
          2 responses
          3 views
          0 likes
          Last Post Gavin45
          by Gavin45
           
          Started by Option Whisperer, Today, 09:00 AM
          0 responses
          2 views
          0 likes
          Last Post Option Whisperer  
          Started by icebergdelphi, Today, 08:57 AM
          0 responses
          3 views
          0 likes
          Last Post icebergdelphi  
          Started by z.franck, Today, 08:37 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X