Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order won't fill?

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

    Order won't fill?

    In this particlular stategy, the EnterShort will not fill?? It fills with I take out the
    //Allow only entries if no current position open
    if (Position.MarketPosition == MarketPosition.Flat)
    and
    //Allow only entries if no current position open
    if (Position.MarketPosition == MarketPosition.Short)

    Anybody have an idea why???

    {


    // Condition set 1
    if (CrossBelow(EMA(5), EMA(50), 1))
    {
    //Allow only entries if no current position open
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    EnterShort(DefaultQuantity, "Sell Short on 5 cross 50");
    }
    }

    // Condition set 2
    if (CrossBelow(EMA(30), EMA(5), 1))
    {
    //Allow only entries if no current position open
    if (Position.MarketPosition == MarketPosition.Short)
    {
    ExitShort("", "Exit Short on 30 cross 5");
    }
    }
    }

    I am trying to make sure that only one order gets filled. By the way, the entire strategy compiles with no problems????

    Thanks!

    #2
    You don't have to worry about making sure only one order gets filled, NT takes care of that you internal to a strategy. This is control by the "Entries per direction" and "Entry handling" parameters when running a strategy. Remove the checks for market position and run a strategy with default settings and you will only get filled on one order at a time.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks Ray...but that is not true! What happens that if the 5EMA crosses below the 50, and then there is a brief cross-back above, and then another cross below of the 5 and 50, before the 30 crosses the 5 to give me my exit, I end up with 2 lots instead of 1. That is why I put in the
      if (Position.MarketPosition == MarketPosition.Flat)
      line. It should still work shouldn't it?????

      Comment


        #4
        I can see how you would think that but it is incorrect. It will only enter once and further order methods are ignored assuming you are using default settings.

        Further information can be found in this section -

        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        572 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X