Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to CHASE a LIMIT Entry Order - MANAGED

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

    How to CHASE a LIMIT Entry Order - MANAGED

    Good Morning! I've been programming a strategy that I'd like to enter my initial LIMIT ORDER and then have the strategy CHASE the LIMIT ENTRY order until I cancel. This is what I have so far:

    if ( Position.MarketPosition == MarketPosition.Flat && entryOrder == null
    && <<< remaining conditions >>>
    {
    EnterShortLimit( 0, true, Convert.ToInt32( ContractQty ), BollingerBandSetLower100_14[0] + 2 * TickSize, "Short Market Entry WALK THE LINE" );
    entryTime = ToTime( Time[0] );
    Print( "SHORT Entry Time WALK THE LINE Time = " + entryTime );
    barNumberOfOrder = CurrentBar;
    }

    if ( entryOrder != null && CurrentBar > barNumberOfOrder + 2 )
    {
    CancelOrder( entryOrder );
    cancelTime = ToTime( Time[0] );
    Print( "Cancelled SHORT Limit Entry Order Time = " + cancelTime );
    }​


    Since, the condition is liveUntilCancelled, I'd like to update the entry limit order with BollingerBandSetLower100_14[0] + 2 * TickSize​ with each current new bar UNTIL Cancelled (and yes, there's more support code below in OnOrderUpdate)

    I cannot find or figure an easy way, at my programming level, of how to quickly administer, essentially following the BollingerBandSetLower100_14[0] + 2 * TickSize.

    Could you please help with this context of how to Chase my Limit entry orders? Thanks in advance! -John​​

    #2
    Hello 317234,

    Below is a link to an example ProfitChaseStopTrailExitOrdersExample with sample logic of a limit order chase.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Good Morning! Thank you. I've been mucking the process of putting all the parts and pieces together for the entry trail and I had already come across that example and have it downloaded already.
      Question: Do we have to first enter the INITIAL limit order and THEN change it with trailing criteria? As in, another IF-THEN looking for entryOrder != null and then chase the limit entry order? Would it be possible for you to parse the ProfitChaseStopTrailExitOrderExample and point out what details I would critically need to do this function (ie, would I need OnOrderExectution as well)? Thanks for you help NinjaTrader_ChelseaB!

      Comment


        #4
        Hello 317234,

        Yes, the limit has to be submitted before it can have the price modified for chasing action.

        In this example the limit is submitted in OnExecutionUpdate() on line 228. (You can submit the order in OnBarUpdate() if this is an entry)
        The limit order, once submitted is assigned to an Order variable in OnOrderUpdate() on line 250/97.
        The chase action condition is in OnBarUpdate() on line 190 and the order price is modified to the new chase price on line 195.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        39 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X