Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Overnight High Low

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

    Overnight High Low

    Hi, guys, I'm trying to draw lines for the overnight high and low. For example, if the session is extended hours and session is as follows:

    13.30 to 6.30 = overnight session
    6.30 to 13.15 = retail session.

    What I'm trying to figure out is the high and low between 13.30 and 6.30. The standard PriorDay OHLC ninja indicator shows the high/low for the full 24 hour session. I am able to do this from midnight but how do I start it from 13.30 from the day before.

    if(ToTime(Time[0]) > 000000 && ToTime(Time[0]) < 133000)

    Also the SampleGetHighLowByTimeRange works for the current day but not for the start time being 13.30 from the day before.

    Thanks
    DJ

    #2
    DJ, one way would be running on a custom session template that would use the start / end hours you seek, if you need run with the 24 hrs default one you would need to custom track the values needed, you could for example review the min and max methods and then reset your calcs at 'your' session break times.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand. I have setup the template for two custom sessions as follows:

      13.30 to 6.30 = overnight session
      6.30 to 13.15 = retail session.

      The SampleGetHighLowByTimeRange still doesn't work though as it doesn't let you overlap the periods. In fact it stops you as per this code on line 89

      // Check to make sure the end time is not earlier than the start time
      if (EndHour < StartHour)
      return;

      In fact I tried to remove it and replace these lines

      {
      startDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, StartHour, StartMinute, 0);
      endDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, EndHour, EndMinute, 0);
      }

      and replace with the below reflecting that it is one day back:

      {
      startDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[1].Day, StartHour, StartMinute, 0);
      endDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[1].Day, EndHour, EndMinute, 0);
      }

      Is there some sort of simple way to call up previous sessions like this:

      //double value = ((High[0], Bars.BarsSinceSession - 1));

      This didn't work either. Any other ideas to get this one?

      Thanks.

      DJ

      Comment


        #4
        DJ, you might be able to succeed to modfiy this indicator to your needs to work on a prior day as well, however then you would also face adding weekend and holiday / double sessions logic like for Monday.

        I would custom code getting the values you seek, so simply track the highest high / lowest low in a series that you reset as needed when your break times hit.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        4 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        10 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X