Pre loader

OhlcDataSeries Append or Update latest bar

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

A useful addition to the OhlcDataSeries would be an Append(datetime,value) method that would automatically determine whether to update the latest open, high, low, close or add a new bar based based on the values passed in, the current bar time/values and the BarTimeFrame property.

Thanks again

Paul

  • You must to post comments
0
0

Hi Paul,

Thanks for the suggestion, we appreciate feedback from our customers which help to make our API/user experience better! We will consider if this can be done to improve usability of stock charts in future iterations.

For now, you can implement such a method using Update/Insert/Append existing API in this way:

        private void AddOrUpdatePoint(DateTime date, double value)
        {
            if (_dataSeries.XValues.IndexOf(date) >= 0)
            {
                _dataSeries.Update(date, value);
            }
            else
            {
                _dataSeries.Append(date, value);
            }
        }

Thanks,
Yuriy

  • David Whatley
    That is incorrect. This is in reference to the ohlcDataSeries. It is not a single value, though a new single value would be what is passed in. Then it would have to figure out the correct action: Add a new bar, setting ohlc values to that value. Or update the existing bar, changing the h and l values if appropriate and setting the c value to that.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies