Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Two orders in opposite direction

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

    Two orders in opposite direction

    I'd like to set two limit orders in opposite direction:
    ...
    if (enterOrderL == null && enterOrderS == null){
    enterOrderL = EnterLongLimit(0, true, DefaultQuantity, GetCurrentBid()-SpredVal * TickSize, "");
    enterOrderS = EnterShortLimit(0, true, DefaultQuantity, GetCurrentAsk() + SpredVal * TickSize, "");
    }
    ...

    EnterLongLimit() executed correctly, but EnterShortLimit() shows this error:
    "**NT** An Enter() method to submit an entry order at '01.10.2012 13:53:15' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation."

    After using "Unmanaged = true" EnterShortLimit() shows another error:
    "**NT** Error on calling 'OnBarUpdate' method for strategy 'Spreader_a/ee88b08fcd2a4c3c83f65ccff284d70b': 'EnterLongLimit' method can't be called on unmanaged strategies."

    Is there any way to deceive "Internal Order Handling Rules that Reduce Unwanted Positions"?

    #2
    Hello n0_namer,
    You cannot place bracket orders using the Managed approach. You have to use the Unmanaged approach to do it.

    You are placing the orders using the Enter() methods, which you cannot use if you set Unmanaged = true.

    Please use the SubmitOrder() method to place the order. Please refer to our help guide to know more

    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi,

      I'm trying to sort out my issue here with this. I want 2 orders in the market in opposite directions AT THE SAME TIME. I've turned on the unmanaged approach in the initialise function.
      I'm using the submit orders functions ie:

      Code:
      if (Close[0] > SMA(20)[0] && entryOrder == null)
               			entryOrder = SubmitOrder(PERIOD_M1_ASK, OrderAction.Buy, OrderType.Limit, 1, GetCurrentBid(), 0, "", "Long Limit");
      				
      				if (Close[0] < SMA(20)[0] && entryOrder2 == null)
               			entryOrder2 = SubmitOrder(PERIOD_M1_ASK, OrderAction.Sell, OrderType.Limit, 1, GetCurrentAsk(), 0, "", "Short Limit");

      however when the second order gets executed, it closes out the first position.
      I need both positions remaining open in both directions.

      Please tell me how to stop the above happening.;

      thanks
      Daniel
      Last edited by PolarBear; 02-10-2013, 07:19 PM.

      Comment


        #4
        Daniel, I have replied directly to your email sent to support - thanks.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertran:

          Please help me on this one. I want to enter 1 contract at market and 1 contract at limit price at the same signal.

          Thanks.

          Comment


            #6
            luxurious_04, please open a new thread for your unrelated issue - thanks.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RookieTrader, Today, 09:37 AM
            4 responses
            17 views
            0 likes
            Last Post RookieTrader  
            Started by PaulMohn, Today, 12:36 PM
            0 responses
            2 views
            0 likes
            Last Post PaulMohn  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            38 views
            0 likes
            Last Post love2code2trade  
            Started by alifarahani, Today, 09:40 AM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by junkone, Today, 11:37 AM
            3 responses
            22 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X