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 Mindset, 04-21-2026, 06:46 AM
                0 responses
                88 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                135 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                68 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by cmoran13, 04-16-2026, 01:02 PM
                0 responses
                119 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                69 views
                0 likes
                Last Post PaulMohn  
                Working...
                X