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
- murfinp asked 11 years ago
- You must login to post comments
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
- Yuriy Zadereckiy answered 11 years ago
-
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 login to post comments
Please login first to submit.