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 cre8able, Today, 03:20 PM
        0 responses
        6 views
        0 likes
        Last Post cre8able  
        Started by Fran888, 02-16-2024, 10:48 AM
        3 responses
        47 views
        0 likes
        Last Post Sam2515
        by Sam2515
         
        Started by martin70, 03-24-2023, 04:58 AM
        15 responses
        114 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by The_Sec, Today, 02:29 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by jeronymite, 04-12-2024, 04:26 PM
        2 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X