Hi,
I am having trouble plotting multiple SMAs on a 30M chart from within an indicator. My preferred method of doing this would be to add 3 EURUSD Data series to the actual chart and pass all three of then into the indicator as input parameters but it is my understanding that this is not possible.
Please advise if this is not true.
So.. My workaround is to use a 30M chart (most detail) and to use the AddDataSeries function to add the additional timeframes in the Indicator
AddDataSeries(BarsPeriodType.Minute, 240); // BarsInProgress = 1 AddDataSeries(BarsPeriodType.Day, 1); // BarsInProgress = 2
protected override void OnBarUpdate() { // Ignore bar update events for the supplementary - Bars object added above if (BarsInProgress == 1 || BarsInProgress == 2) { return; } if (CurrentBar > 8) { SMA smaSmall = SMA(Typicals[0], 6); SmallNormal[0] = smaSmall[0]; } if (CurrentBar > (24/4) * 8) { SMA smaMedium = SMA(Typicals[1], 6); MediumNormal[0] = smaMedium[0]; } if (CurrentBar > 24 * 8) { SMA smaLarge = SMA(Typicals[2], 6); LargeNormal[0] = smaLarge[0]; } }
Please advise, Thanks
Comment