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 nandhumca, Today, 03:41 PM
          0 responses
          1 view
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          6 responses
          32 views
          0 likes
          Last Post ScottWalsh  
          Started by frankthearm, Today, 09:08 AM
          10 responses
          36 views
          0 likes
          Last Post frankthearm  
          Working...
          X