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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    174 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    329 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    252 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    355 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    182 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X