Hi. My series have only single-valued data points, i.e. the Close price. The Financial Indicators (Bollinger, MACD, etc.) all have a set of standard financial member paths inherited from Infragistics.Controls.Charts.FinancialSeries, namely OpenMemberPath, CloseMemberPath, HighMemberPath, LowMemberPath, and VolumeMemberPath.
Obviously I can add duplicate accessors on my collection items to simulate the existence of these values, but I can find nothing in the docs to indicate how such data might be interpretted, and experimentation has yielded inconsistent results.
Do you have recommendations for usage of Financial Indicators for single-valued series?
Many thanks
HtD
Do I need to provide handlers for Typical and TypicalBasedOn? I am experimenting here but I get NullReferenceExceptions because FastItemsSource has not been set in the underlying code.
Any help appreciated
Each indicator will tell you in the api remarks which member paths it expects to be populated: http://help.infragistics.com/NetAdvantage/DV/2011.2/CLR4.0/?page=InfragisticsSL4.Controls.Charts.XamDataChart.v11.2~Infragistics.Controls.Charts.MovingAverageConvergenceDivergenceIndicator.html
In general, this is driven by how the indicator is typically calculated. Some of them don't necessarily make a lot of sense if you have only a single value.
You only need to provide handlers for Typical and TypicalBasedOn if you are using an indicator that depends on the Typical Price and you also want to customize how typical price is obtained.
If you want to completely customize the calculation you can use CustomIndicator.
This post shows how that can be done, in general: http://community.infragistics.com/forums/p/48149/257201.aspx#257201
The based on handlers are for letting the chart know which columns the calculation is based on, so that it knows under which circumstances the calculation needs to be refreshed.
-Graham
Thanks Graham.
Actually I'm a little confused by the output of the MACD indicator. I expected to see a "MACD" line (EMA[short] - EMA[long]), a "MACDSignal" line (EMA[MACD]) and a "Divergence" histogram (MACD - MACDSignal). Such a chart can be seen in the Wikipedia entry for MACD. This is how my users expect to see the data.
Thanks for the CustomIndicator suggestion. I have not tried this, but an alternative approach I have tried is to implement MACD as a secondary chart with the three required series bound to a ViewModel which creates the required MACD data from the source series. This chart shares a sync object with the main chart. Can you see any problems with this approach?
Every MACD implementation I have seen uses only a single source series, usually the close price. Again, this is what my users are expecting.
Graham
I have looked into the CustomIndicator approach as you suggest, but unless I'm missing something it still restricts me to a single IndicatorColumn and a single TrendLine . This means I cannot implement a divergence histogram as per my previous post.
Obviously I have my custom chart prototype mentioned in my previous post, but this is not ideal. For example, it will not be possible to elegantly display indicators dynamically using templates in response to user actions. What approach would you suggest? Bite the bullet and implement a custom indicator type from scratch?
By the way, I have noticed a potential issue with your financial calculations implementation. There are various ways to specify the initial values for EMA (i.e. when i < period) and this was one of the reasons I was seeing anomalies when comparing the XamDataChart MACD line with the same generated in Excel using our internal methodology. I have been able to fix this by extending MovingAverageConvergenceDivergenceIndicator and overriding ProvideSupportingCalculations, but the TrendLine does not call this so is instead defaulting to the EMA calculation on the Series class. It would be better to be able to inject functors so that financial calculations are fully configurable and consistent.
In the latest versions there is actually a property you can use the have the display ignore a configurable amount of values, so you can essentially eliminate the first period from display if you consider its primed calculation invalid, but I can't recall how this affects a trendline you may have specified for that indicator.
Unfortunately you can't specify more than one trend line per series at present. But you can build a trendline as a custom indicator. I believe most of the moving average methods are available to you in the calculation methods provided to the indicator calculation.
Another option you have (albeit less CPU-memory efficient) is to add the series twice, but hide its stroke for the second copy, and only show the trendline portion.
I belive we currently let you replace the TypicalPrice calculation, but not any of the moving average calculations. I'd recommend making a feature request so that we support the same degree of customization for the moving average calculations as TypicalPrice.
The trendline calculations are not configurable at all, currently, beyond their period. And if you have an immediate need for some of them to work differently, you could implement them as a customindicator or custom series in the short term. This would also allow you to display more than one trendline per series, at the cost of some additional complexity at setup time.
The current trendline setup sacrifices some customizability in favor of ease of configuration.