Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit signals generated from Strategy builder to last n bars

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

    Limit signals generated from Strategy builder to last n bars

    Hi,

    I am using strategy builder to generate signals in my trading.

    - Is it possible to write a condition ins strategy builder that will only display the signals for the last "n" bars?

    - Is it possible to write a condition in strategy builder to only display signals for current day? Or between a specific time on current day?

    Appreciate the help.

    #2
    Hi aprilfool,

    You can use the following code to only display markers for the current day:

    Code:
    if (Bars.IsFirstBarOfSession) {
        // Removes all draw objects
        RemoveDrawObjects();
    }
    Regards,
    William
    ninZa
    NinjaTrader Ecosystem Vendor - ninZa.co

    Comment


      #3
      Hello aprilfool,

      That depends on how you are marking signals. If you are using drawing objects you can use the Remove All Drawing Objects at the start of the session to clear previous drawing objects, that lets you draw from the start of the session. You could also make time conditions in your strategy so it only draws during specific times.

      To remove the objects you would create an action of Drawing -> Remove All Drawing Objects. To check if the bar is the first bar of the session you can make a condition like the following:
      Left: Misc-> first bar of session
      Center: equals
      Right: Misc -> True

      There is a guide on how to make time conditions here: https://ninjatrader.com/support/help...ateTimeFilters

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      87 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      132 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X