Pre loader

Extracting OHLC from renderableSeries.DataSeries

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

How do I extract the latest OHLC datapoint from renderableSeries.DataSeries?

I need to extract all open, high, low & close values for the last candlestick in the chart. It is a real-time chart, so values are changing constantly.

  • You must to post comments
0
0

Hi there,

something like this:

var ohlcDataSeries = renderableSeries.DataSeries as OhlcDataSeries<DateTime, double>;
int count = ohlcDataSeries.Count;
DateTime date = ohlcDataSeries.XValues[count - 1];
double open = ohlcDataSeries.OpenValues[count - 1];
double high = ohlcDataSeries.HighValues[count - 1];
double low = ohlcDataSeries.LowValues[count - 1];
double close = ohlcDataSeries.CloseValues[count - 1]; // Note: CloseValues == YValues

That should do it!

If you want to be notified when data changes, you can subscribe to the SciChartSurface.Rendered event, or just get this value out when the data is appended.

Are you trying to create a latest price indicator on the axis? If so see the answer to your other post… 🙂

Best regards,
Andrew

  • 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