Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug

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

    Bug

    Hi

    My strategy was trying to place a buy limit order and I got the message "Buy Stop or Buy Limit Orders cannot be placed below the market"

    Surely a buy limit order HAS to be placed below the market ... It could not have been a buy stop order as my strategy only places buy limit orders

    Any help or insight appreciated ...

    Thanks

    Paul

    #2
    Hi Paul, could it be that you tried placing a StopLimit order below the market? If yes, try placing a regular limit order instead.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Paul, could it be that you tried placing a StopLimit order below the market? If yes, try placing a regular limit order instead.
      Hi

      I am only using EnterLongLimit & EnterShortLimit - they are correct for regular limit orders?

      Thanks

      Comment


        #4
        murfinp,

        Please provide the exact code you are using. You need to submit at valid prices for any order type you submit.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          murfinp,

          Please provide the exact code you are using. You need to submit at valid prices for any order type you submit.
          Josh

          Here you go ...

          ==================
          protected void openLongs() {

          double currAsk;
          double prc;

          flattenAll(false,"Open Longs");

          currAsk = GetCurrentAsk();

          stopLossPrice = currAsk - maxPosition*TickSize - TickSize*stopLossAdjustment;
          SetStopLoss(CalculationMode.Price,stopLossPrice);
          cancelOrdersPrice = currAsk + targetCancelOrders*TickSize;

          for (int i= 1; i<= noOrders;i++) {
          prc = currAsk -(i-1)*TickSize;
          SetProfitTarget("BuyLimitOrder "+prc.ToString(),CalculationMode.Ticks,targetTicks );
          listOpenOrders.Add(EnterLongLimit(0,true,1,prc,"Bu yLimitOrder "+prc.ToString()));
          }

          lastAction = ACTIONOPENEDLONGS;
          }

          Comment


            #6
            You need to ensure prc is a valid price. It likely is not. You can only buy at the ask or above, yet here you have outlined a price below the ask.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              You need to ensure prc is a valid price. It likely is not. You can only buy at the ask or above, yet here you have outlined a price below the ask.
              Josh

              It is a buy limit so it has to be at/below the ask??

              Paul

              Comment


                #8
                Pardon the typo, but what you have outlined is still erroneous. You are likely running on a liquid market where the time difference from when you calcualte the ask to when the order is submitted, the actual market price is now lower than what you submitted your limit at. You should not place orders so close to the inside market because of movement that can very quickly and easily make your orders invalid and rejected when they reach the brokerage/exchange.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by murfinp View Post
                  for (int i= 1; i<= noOrders;i++) {
                  prc = currAsk -(i-1)*TickSize;
                  SetProfitTarget("BuyLimitOrder "+prc.ToString(),CalculationMode.Ticks,targetTicks );
                  listOpenOrders.Add(EnterLongLimit(0,true,1,prc,"Bu yLimitOrder "+prc.ToString()));
                  }
                  Hi Paul,

                  not sure if you are aware of, but for int i = 1 you submit a limit order at the ask price. It is very close to the market.

                  Regards
                  Ralph

                  Comment


                    #10
                    Guys

                    Ok ... points taken .... thanks

                    Paul

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    647 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    368 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    571 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    573 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X