Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add(PeriodType.Day,1); Issue

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

    Add(PeriodType.Day,1); Issue

    Hello,
    I have an indicator in a 5000 Volume bar chart. When the first bar closes on a new day (after midnight) I need to access the prior days OHLC data which I am trying to do by accessing daily bars:
    protected override void Initialize()
    {
    Add(PeriodType.Day,1); // Add the daily bars to the indicator
    // Other code...
    }

    protected override void OnBarUpdate()
    {
    daysback = 0;
    tempDate = Convert.ToDateTime(Times[1][daysback].ToShortDateString());
    yHigh = Highs[1][daysback];
    yLow = Lows[1][daysback];
    yClose = Closes[1][daysback];
    }

    The problem is that the most recent data available is not from yesterdays session, but from a day ago. For instance, right now at 2:00AM Friday morning (10/5/2012), the most recent daily bar is from 10/3/2012.

    When is the daily bar from 10/4/2012 added? Can I force it to update somehow? It has not been updating, even after the market opens at 9:30 Eastern. (Pressing F5 does not help.)

    This same indicator works on a 25000 Volume chart, I don't know why it's having issues with the 5000 Volume chart.

    Is there a better way to access OHLC data from prior days?

    Thanks,

    Roger


    #2
    Hi Roger, the new daily bar will need to open / have received the first tick to close the prior one, so you can access it.

    I would suggest using GetDayBar or PriorDayOHLC here as replacement for your needs.



    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 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
    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