Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Specific Day of Week

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

    Specific Day of Week

    For backtesting a strategy, I'm only interested in the last day of the week.

    Right now, I can specify <do something> on Friday by
    if (Time[0].DayOfWeek == DayOfWeek.Friday)
    <do something>

    But sometimes, there are holidays on a Friday and I miss out using this method. Is there a better way? Would there be a way that would work with last day of a month too?

    #2
    pretender,

    You can work with DateTimes here and manipulate them for your calculations, however to keep track of holidays you may need to use your own pre-set holidays so the strategy knows what these days are.

    Represents an instant in time, typically expressed as a date and time of day.


    I seem to remember some posts the the forum related to including holidays, I would suggest browsing a little to find them.

    Here is an example : http://www.ninjatrader.com/support/f...ad.php?t=24947
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X