Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimize on DayOfWeek

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

    Optimize on DayOfWeek

    As part of my optimization, I'd like to pass in a variable to represent DayOfWeek.

    Does Time[0].DayOfWeek have an integer equivilent?

    In Excel, Sunday = 1, Monday = 2, etc.

    Brooks

    #2
    Hello brooksrimes,

    Unfortunately this is not available. As a training exercise I am working on a simple script that will allow this. If everything checks out I will share with you tomorrow.
    Last edited by NinjaTrader_RyanM1; 05-18-2010, 02:09 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      brooksrimes,

      Below are the results of this:
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Thanks Ryan, I'll take a look at it. Yesterday, I came up with:

        // Monday
        if (Weekday == 1 && Time[0].DayOfWeek == DayOfWeek.Monday
        ...
        {
        EnterLong(1, "Long1");
        }
        // Tuesday
        if (Weekday == 2 && Time[0].DayOfWeek == DayOfWeek.Tuesday
        ...
        {
        EnterLong(1, "Long1");
        ....

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        318 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X