Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongLimit() overloads

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

    EnterLongLimit() overloads

    I am using a MTF strategy and wanted to enter on the price of the Close[0]

    using this

    // Enter Long
    if ((iOrderL1 == null || Historical) && iQuantity1 != 0)
    iOrderL1 = EnterLong(0, iQuantity1, sENTRY1L);
    if ((iOrderL2 == null || Historical) && iQuantity2 != 0)
    iOrderL2 = EnterLong(0, iQuantity2, sENTRY2L);
    if ((iOrderL5 == null || Historical) && iQuantity5 != 0)
    iOrderL5 = EnterLongLimit(0, false,iQuantity5, Close[0],sENTRY5L);
    return;
    }

    I see, as per screenshot, that the L5 entry didnt happen, even though price eventually fell well away from the Close[0] (on the entry bar) but the two entrys L1 L2 did.

    This compiled ok ... so I am thinking ?????
    Attached Files

    #2
    You need to keep the order alive. Your order likely expired as it did not fill within one bar. To keep the order alive you can either set liveUntilCancelled to true or just keep calling EnterLongLimit() on every single bar you want the order kept alive.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      I will try that, I am thinking though that a drop of 10 ticks below the close[0] would have almost guaranteed a fill on a limit order. I havent been able to conjure up a ( <= Close[0] ) as a limit price in the overload... is there a way to use that? As in (Math.Min (Close[0], Open[0]))
      or
      ((Close[0] - 5*Ticksize))

      TIA,
      Jon
      Last edited by Trader.Jon; 01-28-2011, 03:28 PM.

      Comment


        #4
        No, a limit order has an exact price and you will not be able to set a price range for it like that. If the order expires before it fills, then it simply won't fill because it is no longer active. You will need to keep the order alive until it fills or until you want to cancel it.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        77 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        45 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        27 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        62 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X