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

GTCs must be submitted as limit or stop limit orders

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

    GTCs must be submitted as limit or stop limit orders

    I have a strategy that tried to place a short market order in a live account. When it executed the EnterShort(DefaultQuantity, "") command, it got this error:

    GTCs must be submitted as limit or stop limit orders. Affected Order: SellShort 1 Market

    How do I place a market order from a strategy?

    Thanks!
    Bryan
    cassb
    NinjaTrader Ecosystem Vendor - Logical Forex

    #2
    Hi cassb,

    Thank you for your post.

    In this case, you would want to submit a limit order, as EnterShort() is a market order, and is getting rejected.

    Instead you can use EnterShortLimit() or EnterShortStopLimit()

    More info at - http://www.ninjatrader-support.com/H...nterShortLimit

    and - http://www.ninjatrader-support.com/H...ShortStopLimit
    TimNinjaTrader Customer Service

    Comment


      #3
      I don't want to submit a limit order. I want to submit a market order.
      cassb
      NinjaTrader Ecosystem Vendor - Logical Forex

      Comment


        #4
        Hi cassb,

        In this case, when you apply the strategy, choose a different TIF.
        TimNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Tim View Post
          Hi cassb,

          In this case, when you apply the strategy, choose a different TIF.
          Ah, OK. I didn't know that GTC was the default. In case anyone is finding this thread and is looking for the same info, here is the Support Guide page:

          Definition
          Sets the time in force property for all orders generated by a strategy. This property is dependant on what time in force your broker may or may not support.


          Property Value
          Cbi.TimeInForce.Day
          Cbi.TimeInForce.Gtc


          Syntax
          TimeInForce


          Examples
          protected override void Initialize()
          {
          TimeInForce = Cbi.TimeInForce.Day;
          }
          cassb
          NinjaTrader Ecosystem Vendor - Logical Forex

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by chbruno, 04-24-2024, 04:10 PM
          4 responses
          50 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          10 responses
          398 views
          1 like
          Last Post beobast
          by beobast
           
          Started by lorem, Yesterday, 09:18 AM
          5 responses
          20 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by WHICKED, Today, 12:56 PM
          2 responses
          15 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Felix Reichert, Today, 02:12 PM
          0 responses
          4 views
          0 likes
          Last Post Felix Reichert  
          Working...
          X