Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create a Stop Loss at the High or Low of a bar subsequent to and Entry.

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

    Create a Stop Loss at the High or Low of a bar subsequent to and Entry.

    Using Strategy Builder, I want to create a stop loss at either the high or low of a subsequent entry (or signal bar) depending on whether I'm in a Long position or Short position.

    In the case of being in a Long position, I want to create a stop loss when the Low of a subsequent bar is reached, that is, if I enter a Long I want to exit that Long position when the price reaches the Low of that entry (i.e. signal bar) or any subsequent bar, until a Low is reached. I would like this stop loss signal to last longer than one bar at a time.

    I am using (1) Continuim for a data feed, (2) 1 minute bars and (3) a PC w/Windows 10.

    I have tried creating a Set to accomplish this but with no success.

    The Set I created has a Condition establishing that I'm in a Long position (Position.MarketPosition = MarketPostion.Long) and with

    an Action (ExitLongStopMarket(DefaultQuantity, (Low[0] + (-8*TickSize)), "@ExitLongPosition", @"Long");

    Unfortunately, this part of the strategy is not working.

    This is the end part of a strategy with the rest of the strategy executing correctly.

    Any suggestions would be appreciated.

    #2
    Hello cortlane,

    To do this in the Strategy Builder, you will need to save the calculated price to a variable, and use this as the stop price for 'Exit long/short positon with stop order'.

    Below is a link to an example.


    To require two conditions to evaluate as true in sequence, you can use a bool variable that is set to true when the first condition is true, is checked for true in the second condition, and then is set back to false.

    Below is a link to an example.
    Hi, To improve a strategy, I would like the condition to enter a trade to be triggered only after a second crossing happens. Meaning, for instance we have a sthocastics crossing, but the strategy would only trigger when a crossing between 2 emas happen. Would the looking back N bars work? Can it be done within the builder
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Did you figure it out Cortlane? I am trying to do the same thing.

      Comment


        #4
        I believe this video can help you both.

        It's detailed so you'll have to walk through it slowly and follow along but it's effective.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        43 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
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 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