Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder:Monthly Filter and Stop Loss

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

    Strategy Builder:Monthly Filter and Stop Loss

    Hello,

    1. is it possible to make a monthly filter at the strategy builder.For example the strategy should not trade in december?

    2.i made a strategy and i set an stop loss and a trailing stop but the trailing stop is not working.Can i not run a stop loss and trailing stop at the same time?

    best regards

    tobias

    #2
    Hello tobiaste,

    Thanks for your post and welcome to the NinjaTrader forums!!

    Yes, it is possible and it is difficult due to the limitations of the strategy Builder.

    You would create a filter based on actual dates, for example 12/1/2020 through 12/31/2020 which means that you would have to update the filter each year.

    I've attached an example of the type of logic you would need in a strategy builder example.

    If you apply this to a daily chart, it will color the background over the days it would trade. If you check the check box "Exclude October" Then you would see that the background for the current month of October would not be colored.

    The strategy has an internal variable bool called "TradeOctober" which is set to true by default and importantly is set true in Set 1 without conditions meaning that on every bar it will be true. Next in set 2 is the actual filter and if the time is between the first and last day of October AND if you have set the user input "ExcludeOctober" as true, set 2 will set "TradeOctober" to false. Finally to demonstrate the exclusion, Set 3 checks if the bool TradeOctober is true and if so colors the background.

    In your strategy, you would use the state of bool TradeOctober as part of your entry conditions.

    MonthlyFilterExample.zip

    Comment


      #3
      Hello tobiaste,

      I forgot to answer your second question, "Can i not run a stop loss and trailing stop at the same time?".

      You cannot run the trailing stop and the fixed stop on the same order, if so, the trailing stop is not used. You can use one or the other.

      It is possible to use the fixed stop on one order and a trailing stop on another order and this is done by using entry signal names to tie the entry order to the trailing stop.

      Comment


        #4
        Originally posted by NinjaTrader_PaulH View Post
        Hello tobiaste,

        I forgot to answer your second question, "Can i not run a stop loss and trailing stop at the same time?".

        You cannot run the trailing stop and the fixed stop on the same order, if so, the trailing stop is not used. You can use one or the other.

        It is possible to use the fixed stop on one order and a trailing stop on another order and this is done by using entry signal names to tie the entry order to the trailing stop.
        hello,

        thank you for your answer . Can you maybe make an example who i can do that?

        Comment


          #5
          Hello tobiaste,

          Thanks for your reply.

          In this case, I can describe the process.

          In your set that places an entry order, you would place two EnterLong() orders. In each one, you would create a unique signal name into the order., for example "Long1" and "Long2".

          In the "stops and targets" section, add a stop loss and in the filed "From entry signal" enter Long1. Next, add the trailing stop and in its "from entry signal" type Long2. Now the exits are tied to the entries.

          What is important is that you use the exact same spelling and capitalization.

          In general, for using stops I would suggest setting the stop mode to Ticks and specifying the number of ticks away from the entry for the stop/trailing stop.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          56 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          132 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X