Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hi-Low-Middle of previous day

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

    Hi-Low-Middle of previous day

    This is rather simple but can not find it. Looking for an indicator that Draws 3 Lines at end of session, Hi, Low & Middle of trading day & extending to Next Day but not the day after.

    #2
    I believe the easiest approach would just be to use PriorDayOHLC()
    https://ninjatrader.com/support/help...injascript.htm

    Define a double for the high, one for the low and one for the average (divided the sum of the High+Low by 2). That will give you the prices to use with Draw.Line

    Than for start and end times of the Draw.Line() you could just use;

    double BarVal = BarsPeriod.Value;
    DateTime StartTime = Time[0].Date.AddDays(-1).AddHours(XX).AddMinutes(XX + BarVal);
    DateTime EndTime = Time[0].Date.AddHours(XX).AddMinutes(XX + BarVal);

    Since NT uses end bar time as bar time, adding the BarVal will allow you to have the indicator adjust with timeframes, so if you defined time of 9 hours and 30 minutes, if it was a 5min chart, it would have that time as 935, which would be the 930 open candle. Defining the StartTime to use the day prior with AddDays(-1) and extending it to XX:XX time on current day with EndTime.

    -Chris
    Last edited by ChrisR; 06-06-2023, 04:46 PM.

    Comment


      #3
      Originally posted by FishTrade View Post
      This is rather simple but can not find it. Looking for an indicator that Draws 3 Lines at end of session, Hi, Low & Middle of trading day & extending to Next Day but not the day after.
      PriorDayOHLC can do this, except for that 'Middle' part.

      You can turn off the Open & Close lines, as desired.

      Suggest you copy that indy and use it as the basis for
      your own custom script ... sounds like it would an easy
      addition.

      Comment


        #4
        Hello FishTrade,

        Thanks for your post.

        ChrisR and bltdavid are correct. The PriorDayOHLC indicator could be used to get the PriorDayOHLC.PriorHigh and PriorDayOHLC.PriorLow values and assign those values to a plot.

        The "Middle" values could be calculated by adding the PriorDayOHLC.PriorHigh and PriorDayOHLC.PriorLow values and dividing by 2. That calculation could be assigned to a plot.

        For example:

        double midValue = (PriorDayOHLC().PriorHigh[0] + PriorDayOHLC().PriorLow[0])/2;

        See the help guide documentation below.

        PriorDayOHLC: https://ninjatrader.com/support/help...b=priordayohlc
        AddPlot(): https://ninjatrader.com/support/help...ghtsub=addplot
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X