Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit Order and Trailing Stop

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

    Limit Order and Trailing Stop

    Hi,
    I'd like to create a strategy where a stop limit order is placed after a condition is met, then cancel this order X bars later if not filled. If it is filled, I'd like to trail the stop based upon the previous bar's close.

    For example, on a long trade, after the condition is met, I'd like an order placed below the market. After X bars and not filled, cancel the order. If the order is filled, I'd like the stop to be set on the low of the previous bar, then trail up on the close with each bar.

    Is there a code example for this?

    Thanks.

    #2
    Hello,

    Thank you for your note.

    This is not a problem to code. However a reference to do exactly this does not exist.

    However please take a look at the following references that should get you up and running.

    Following are links to all available NinjaScript reference samples within this forum section: Strategy Reference Samples (NinjaTrader 8) - also applicable to NT7 Using a time filter to limit trading hours (http://www.ninjatrader.com/support/forum/showthread.php?t=3226) Using multiple entry/exit signals simultaneously


    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Thanks. This should keep me busy for awhile.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      639 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      572 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X