Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy Stop can't be placed below the market

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

    Buy Stop can't be placed below the market

    Is this the correct way to resubmit rejected EnterLongStopMarket() orders:


    private Order rejectedEntryOrder = null;

    if (rejectedEntryOrder != null)
    rejectedEntryOrder = GetRealtimeOrder(rejectedEntryOrder);

    if ((entryOrder == null || entryOrder2 == null) && Close[0] > Close[1])
    {
    EnterLongStopMarket(0, true, 1, mfe[0], @"myEntryOrderLong1");
    }

    // Rejeced Order Mangement
    if (rejectedEntryOrder == null)
    rejectedEntryOrder = EnterLongStopMarket(0, true, 1, mfe[0], @"myEntryOrderLong1");

    // Rejection entry orders
    if (order.Name == @"myEntryOrderLong1")
    rejectedEntryOrder = order;

    if (rejectedEntryOrder != null && rejectedEntryOrder == order)
    {
    // Rejection handling
    if (order.OrderState == OrderState.Rejected)
    {
    // Entry order was rejected !!!!
    EnterLongStopMarket(0, true, 1, mfe[0], @"myEntryOrderLong1");
    }
    }

    When I run the script in playback, I still get the error messages that say: "Buy stop or buy stop limit orders can't be placed below the market. affected order: Buy 1 StopMarket @3931.50
    Then NT8 crashes.

    I know I can do a check for High[0] > GetCurrentAsk(), but this check decreases my entry signals by a lot.
    Last edited by AdeptistJune; 05-24-2022, 09:53 PM.

    #2
    Without directly addressing your question, but nevertheless being very relevant, the following are essential to understanding Limit and Stop orders:
    • Buy Limit must be BELOW current Ask
    • Buy Stop must be ABOVE current Ask
    • Sell Limit must be ABOVE current Bid
    • Sell Stop must be BELOW current Bid
    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    Comment


      #3
      Hello AdeptistJune,

      Thank you for your reply.

      Looks like you're setting the price of the order to mfe[0] but you're not checking that that price is above current ask before submitting the order. I would suggest checking that's above the current price and if it isn't, adjust the price so it is.

      Please let us know if we may be of further assistance to you.

      Comment


        #4
        Hello Kate,

        My mistake for saying HIgh[0], when actually, I am checking mfe[0] > GetCurrentAsk(). I was just saying High[0] as an example.

        When I check mfe[0] > GetCurrentAsk(), it decreases my number of trading signals.

        I'm thinking of commenting out mfe[0] > GetCurrentAsk(), and trapping the rejected order, and resubmitting the order again.

        When I tried this last night, in playback, the error occurred, and my NT8 crashed.

        So either I wrote the rejection handling script wrong, or what I'm attempting doesn't work.

        Any advice on how to approach EnterLong(Short)BuyStopMarket() orders that are rejected if I choose not to use the mfe[0] > GetCurrentAsk() check?

        Thanks.

        Comment


          #5
          Hello AdeptistJune,

          Thank you for your reply.

          I mean, at some point you're going to need to check that when the order is submitted that it's at a valid price, if you just keep trying to submit the order at the same price you'd likely end up in kind of a loop of rejections and resubmittals. I would definitely advise checking that the mfe value is on the correct side before even submitting the order initially.

          Please let us know if we may be of further assistance to you.

          Comment


            #6
            Hello Kate,

            I was thinking the same thing, but it helps to hear it from someone who has more experience than myself. I will continue testing mfe[0] > CurrentAsk().

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            62 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            134 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X