I have read every single existing thread on this topic but I still have not found a solution to my problem.
Here it is: I have created a multi-timeframe indicator called ContextAnalyzer. This indicator performs an analysis of two timeframes and populates a DataSeries object (myContextSeries) with the results of the analysis (a single value for each bar of the primary data series). I have completely tested this indicator and it works like a charm when applied to a chart. I have even done as far as printing the CurrentBar and myContextSeries[0] for each bar of the primary series to verify the logic. So far, so good....
myContextSeries is exposed publicly via the following code:
[Browsable(false)]
[XmlIgnore()]
public DataSeries ContextMOM
{
get { return myContextSeries; }
}
So far I assume that all is good...
I would now like to use the values of the DataSeries referenced above in another indicator, let's call it ContextConsumer. Here is my test code for this:
public class ContextConsumer: Indicator { private ContextAnalyzer myContext; protected override void Initialize() { Overlay = true; } protected override void OnStartUp() { myContext = ContextAnalyzer(PeriodType.Minute,3); } protected override void OnBarUpdate() { double dContext = myContext.ContextMOM[0]; if (dContext == -2) BarColor = Color.Red; if (dContext == -1) BarColor = Color.Magenta; if (dContext == 1) BarColor = Color.LightBlue ; if (dContext == 2) BarColor = Color.Blue ; }
Any help is greatly appreciated.
Comment