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 kevinenergy, 02-17-2023, 12:42 PM
          117 responses
          2,766 views
          1 like
          Last Post jculp
          by jculp
           
          Started by Mongo, Today, 11:05 AM
          5 responses
          15 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Deleted: SightCare Australia Reviews by SightCareAubetter
          Started by SightCareAubetter, Today, 12:55 PM
          Topic deleted by NinjaTrader_LuisH
          Started by traderqz, Today, 12:06 AM
          8 responses
          16 views
          0 likes
          Last Post traderqz  
          Started by SightCareAubetter, Today, 12:50 PM
          0 responses
          2 views
          0 likes
          Last Post SightCareAubetter  
          Working...
          X