Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time of High bar within specific range

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

    Time of High bar within specific range

    Hello,

    Im currently grabbing the high and low bars within a specific range as follows:

    Code:
    if (Time[0] == startN)
    {
    nStart = CurrentBar-1;
    }
    
    if (Time[0] == Time[0].Date.AddHours(16))
    {
    nEnd = CurrentBar;
    nBars = nEnd-nStart;
    nHigh = HighestBar(High, nBars);
    nLow  = LowestBar(Low, nBars);
    }


    Than boxing those values within that range as follows
    Code:
    if (Time[0] == Time[0].Date.AddHours(16))
    {
    Draw.Rectangle(this, "Hi/Lo", false, startN, High[CurrentBar-(nEnd-nHigh)], endN, Low[CurrentBar-(nEnd-nLow)], Brushes.Red, Brushes.Transparent, 0, true);
    }​

    No issues there, but what I am having difficulty with is printing the time of that bar that forms the high and low within that range. Any assistance would be appreciated, it doesnt have to coincide with the above method on pulling the high bar.
    Last edited by ChrisR; 05-20-2023, 08:16 PM.

    #2
    Nevermind, I was way overthinking this. This was accomplished by

    Code:
    if (Time[0] == Time[0].Date.AddHours(16))
    Print(Bars.GetTime(CurrentBar-nHigh));​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X