For the life of me I can't figure out why my Indicator values for a multitimeframe indicator is totally different than the indicator values when the indicator is a single-timeframe indicator.
For example, I applied the following multi-timeframe indicator to a 5-minute chart of the stock RDC with 40 days of data loaded and using the "US Equities RTH" template. The multi-timeframe version adds the Daily chart as an additional dataseries.
However, the indicator values for the multi-timeframe version don't seem to be working because it is totally different than when I place the rsiSignal dataseries into it's own single-timeframe version and place it on the Daily Chart.
In addition, it also appears that I'm unable to access the Daily rsiSignal values from the BarsinProgress = 0 portion of the code. The rsiSignal values are returned as 0 which is incorrect.
Any help would be greatly appreciated.
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
// Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Overlay = true;
MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
Add(PeriodType.Day, 1);
CalculateOnBarClose = false;
smaValue = new DataSeries(this);
rsiSignal = new DataSeries(this);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if(BarsInProgress == 1 && CurrentBar > 10)
{
daysLoaded = CurrentBar;
if(CurrentBar < 10)
return;
smaValue.Set(SMA(10)[0]);
rsiSignal.Set(RSI(smaValue, 5, 2)[0]);
Print("DAILY SERIES VALUE");
Print("Time = "+Time[0]);
Print("rsiSignal = "+rsiSignal[0]);
}
if(BarsInProgress != 0)
return;
if(daysLoaded > 10 )
{
Print("INTRADAY SERIES VALUE");
Print("Time = "+Time[0]);
Print("rsiSignal = "+rsiSignal[0]);
}
}

Comment