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 trilliantrader, 04-18-2024, 08:16 AM
        4 responses
        18 views
        0 likes
        Last Post trilliantrader  
        Started by mgco4you, Today, 09:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        9 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        10 views
        0 likes
        Last Post Rapine Heihei  
        Working...
        X