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 Karado58, 11-26-2012, 02:57 PM
        8 responses
        14,828 views
        0 likes
        Last Post Option Whisperer  
        Started by Option Whisperer, Today, 09:05 AM
        0 responses
        1 view
        0 likes
        Last Post Option Whisperer  
        Started by cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by Harry, 05-02-2018, 01:54 PM
        10 responses
        3,204 views
        0 likes
        Last Post tharton3  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Working...
        X