SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hello.
I’m trying to implement leading indicators. I have OHLC series as main (RenderableSeries[0]) and when I’m adding leading series with future DateTime value they still render as non-leading.

Code snippet:

XyDataSeries<DateTime, double> ser = (XyDataSeries<DateTime, double>) chartControl.RenderableSeries[series.index].DataSeries;

                if (candles.Count <= 0 || ser == null) { return; }

                if (ser.Count == 0)
                { ser.Append(candles[0].BeginTime, candles[0].Close); series.last = 0; }
                else { ser.Update(candles[series.last].BeginTime, candles[series.last].Close); }

                //ChartData.BaseXValues не идут в будущее
                
                List<DateTime> time = new List<DateTime>();
                List<double> open = new List<double>();
                List<double> close = new List<double>();
                List<double> high = new List<double>();
                List<double> low = new List<double>();

                for (int i = series.last + 1; i < candles.Count && candles[i]!=null; i++)
                {
                    time.Add(candles[i].BeginTime);
                    close.Add(candles[i].Close);
                }

                if (time.Count > 0)
                {
                    ser.Append(time, close);
                }

Screenshot:

Debugger screenshot:

  • You must to post comments
0
0

Hi VReuda,

CategoryDateTimeAxis looks at the index of each data-point to determine where to place it. This is by design.

If you wish to have a leading indicator, you can pre-pend the series with Y=double.NaN. We do this in our SciTrader examples to show moving averages for example.

I hope this helps,
Andrew

  • VRueda
    That works fine. And one more question: how can I change some kind of "max limit" of XAxis VisibleRange? I mean not just changing VisibleRange.Max, but setting the right border offset from the end of the main series. Is there a way to avoid scripting all VisibleRange changes manually?
  • Andrew
    Hi there,There are a few things you can do.You can use Axis.GrowBy which adds a padding to the axis. You can use Axis.AutoRange, which zooms to fit data or leaves this manual You can use SciChartSurface.ViewportManager, which gives full control over the viewport.I hope this helps, Andrew
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.