Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Restrict Days in Bars Type

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

    Restrict Days in Bars Type

    Hello Ninjatrader staff,

    I have a bit of a peculiar question.

    I would like to restrict the days that a specific bars type (eg. Renko, Day, Minute) can process data to only the first Monday of the month. I know that this can be achieved on a weekly basis with a Trading Hours template, by only selecting Monday as a trading day, but the Trading Hours template restricts me to only intra-week periods, and does not allow me to use only the first Monday of the month.

    In a regular strategy script, I would use something like --> if (Time[0].Day <= 7 && Time[0].DayOfWeek == DayOfWeek.Monday) <-- which would give me the desired exclusion. But in the script of a Bars Type, the Time[0] function does not exist.

    So the question is, how can I code this in a Bars Type script?

    Thank you in advance for your time, I look forward to your answer.

    GLFX005

    #2
    Hello GLFX005,

    You could potentially use the timestamps from the data in a BarsType to check if the timestamp falls within a specific day and only build those bars, I have no idea how that would affect the end result chart though as I don't know of any bars type which omits data. You could try doing that to check if that works.

    The same type of condition you provided could be used, bars types don't use a time series and instead just have time object https://ninjatrader.com/support/help...ndatapoint.htm


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    657 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    373 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X