Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market order submitted as Limit?

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

    Market order submitted as Limit?

    Hello,

    I have a strange error message indicating that a Limit order errored out, but I submitted the order using EnterLong or EnterShort which is supposed to be a Market order.

    What am I doing wrong?

    Many Thanks, Caesar.

    The order entry code is as follows:
    Code:
    EnterLong(ContractQuantity, "EnterLongMarket");
    The error messages are as follows:
    Click image for larger version  Name:	Screenshot 2023-06-19 162036.png Views:	3 Size:	22.2 KB ID:	1256679
    Last edited by Skechers; 06-19-2023, 03:39 PM.

    #2

    Deleted.​​​
    Last edited by Skechers; 06-19-2023, 02:51 PM.

    Comment


      #3
      Hello, thanks for writing in. Im unable to guess at what code you have in your strategy. Can you post the contents of the strategy?

      Comment


        #4
        Here it is:
        Code:
                            if (CrossTrigger == 1)
                            {    // Plot Long
                                CrossTrigger = 0;
                                if (TradingEnabled && ClearToSubmit && StrategyEnabled)
                                {    
                                    if(TradingEnabled && ShowOtherPlots)
                                    {
                                        Trigger[0] = (Low[0] - (SecondaryPlotGap * 4) - SecondaryPlotOffset - PrimaryPlotOffset);
                                        PlotBrushes[7][0] = Brushes.SkyBlue;
                                    }
                                    ClearToSubmit = false;
                                    if (Limit_1_Market_2 == 1)
                                    {
                                        PrintLog(1, "Strategy: Submitting Long Limit Order " + (High[0] + Low[0]).ToString(format) + " Qty: " + ContractQuantity);
                                        EnterLongLimit(ContractQuantity, (High[0] + Low[0]) / 2, "EnterLongLimit");
                                    }
                                    else
                                    {
                                        PrintLog(1, "Strategy: Submitting Long Market Order" + " Qty: " + ContractQuantity );
                                        EnterLong(ContractQuantity, "EnterLongMarket");
                                    }
                                }
                            }​

        Comment


          #5
          Hello Caesar,

          To confirm, there is no stop loss or profit target being submitted with SetProfitTarget and/or SetStopLoss(), is this correct?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi Chelsea, yes, the strategy makes use of SetProfitTarget and SetStopLoss. If those are causing the issue, what alternatives are there?

            Many Thanks, Caesar.

            Comment


              #7
              Hi, It is the stop loss order that is causing the error for you. You are placing this order above the market price at the time of submission. To avoid this, make sure the price you are going to submit the order at a legal price level (below GetCurrentBid()).

              Comment


                #8
                Many Thanks!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CarlTrading, 03-31-2026, 09:41 PM
                1 response
                80 views
                1 like
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                40 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                63 views
                2 likes
                Last Post CaptainJack  
                Started by CarlTrading, 03-30-2026, 11:51 AM
                0 responses
                63 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 03-30-2026, 11:48 AM
                0 responses
                54 views
                0 likes
                Last Post CarlTrading  
                Working...
                X