Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder: StopLoss at the MAX of the last 10 bars...not working... why?

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

    Strategy Builder: StopLoss at the MAX of the last 10 bars...not working... why?

    Hi there, using the Strat Builder, I wanted to set the StopLoss for a Short entry to be at the MAX of the last 10 bars + 10 ticks (as an example).
    However, when running the playback, the stop loss gets completely ignored. Has anybody managed to get this done? I feel the Strat Builder should allow for this, after all the SL window does offer the user to decide where the stop loss should, using indicators, offsets etc.

    Thanks!

    #2
    Hello Oracletrades,

    Thanks for your post.

    If you are using the Set methods from the Stops and Targets window then please note that these are fixed values that are set when the strategy is applied. These cannot be used dynamically such as you are showing (in the strategy builder). I would recommend using the Stops an targets with fixed values using the CalculationMode of Ticks and specifying the number of ticks from the entry to use,

    If you want to use the set methods dynamically, it is possible to do so however you would have to unlock the strategy and work directly in Ninjascript. Once unlocked you would not be able to use the strategy builder on that particular strategy.

    Alternatively, in the Strategy Builder, you can create your own profit and stop by using other order types. For example (long position) , profit target orders are Exit long by a limit order, Exit long by a market if touched order. Exit Long can be used for a profit or stop (it is a market order so it fills immediately). Stop orders are: Exit long by a stop order, ExitLong by a stop limit order. So these order types can be dynamically set.

    Please note that a limit type order will be automatically canceled if not filled on the bar that it is placed. This means you would need to create logic to continue to place the order until it does fill or you no longer need the order.

    Comment


      #3
      Hi Paul, thanks for that detailed reply. That is a really good idea and the reason I hadn't thought of doing it that way is because of what you say: every new bar the limit orders get "wiped" from the strategy builder. When you say:

      This means you would need to create logic to continue to place the order until it does fill or you no longer need the order.
      ... is there any documentation anywhere that you know of that would outline how to do this? The results of many strategies changes dramatically when an order is allowed to stay "alive" after a bar closes... It's a shame this option is only available to coders and developers in my opinion.

      Comment


        #4
        Hello Oracletrades,

        Thanks for your reply.

        If you want to unlock the Strategy builder created strategy and work directly in Ninjascript then you can use the advance Order handling which allows for Live until canceled options. The programmer then would need to also handle the canceling of any orders.

        If you want to remain in the Strategy Builder then you would need to set up your strategy so that once you are in a position, that you submit your exit limit orders. So the criteria would be that you are in a market position (long or short) and submit the exit limit order which will be resubmitted on each bar until you fill the order (because the market position changes). Here is a link to the strategy builder help guide on MarketPosition as a condition: https://ninjatrader.com/support/help...ionComparisons

        Comment


          #5
          If you used ExitShort instead of StopLoss when your conditions are met, I think you will be closer to your goal. Yes, you cannot exit exactly at the stop price with ExitShort order, but it will be close.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          20 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          120 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          63 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
          45 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X