Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PriorDayOHLC().PriorHigh[1]

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

    PriorDayOHLC().PriorHigh[1]

    Am I able to use the following to find to high of the day before the last day ?
    PriorDayOHLC().PriorHigh[
    1]

    currently it is returning 0 for some reason

    #2
    Hello Fiddy,

    Thank you for your post.

    The bar index [ ], will refer to the number of bars ago value for that indicator.

    Since, you are requesting 1 bar ago, on intraday time, the 0 and 1 will return the same value.

    The only time that this isn't true, is when it is the first bar of session.

    You can filter this out with -
    Code:
    if(Bars.FirstBarOfSession)
    {
         Print("Bar 0: " + PriorDayOHLC().PriorHigh[0]);
         Print("Bar 1: " + PriorDayOHLC().PriorHigh[1]);
    }
    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      How would you suggest a better way / correct way to write the following

      PriorDayOHLC().PriorLow[0] > PriorDayOHLC().PriorHigh[1]

      What I want is the low from yesterday to be greater than the high of the day before yesterday.
      However I want to run this on an intraday chart

      Comment


        #4
        Fiddy,

        What you would want to do is check for the price change between the [0] and [1], and then store the value you want to use later.

        if(PriorDayOHLC().PriorHigh[0] != PriorDayOHLC().PriorHigh[1])
        {
        newDay = PriorDayOHLC().PriorHigh[1];
        }

        if(PriorDayOHLC().PriotLow[0] > high)
        {
        // Take action here
        }
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 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
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X