I'm trying to create a Swing object (in Swing Indicator class) based on the daily timeframe from within a new indicator which will be used on the 1 minute timeframe. The reason I do this so that I have access to the daily swings from within the lower 1 minute timeframe. I create the time series as follows....
I've declared the Swing object in the class as follows:
Swing swingsD1;
I create the daily data time series:
AddDataSeries(this.Instrument.FullName, Data.BarsPeriodType.Day, 1, Data.MarketDataType.Last);
How do I pass the bar data series into the Swing object? As follows(??):
swingsD1 = new Swing(BarsArray[1], 2);
The problem is that I get an error that there is no constructor that takes 2 arguments. Yet I can see the constructor in the read only Swing indicator class (ships with Ninjatrader 8):
public Swing Swing(ISeries<double> input, int strength)
{
if (cacheSwing != null)
for (int idx = 0; idx < cacheSwing.Length; idx++)
if (cacheSwing[idx] != null && cacheSwing[idx].Strength == strength && cacheSwing[idx].EqualsInput(input))
return cacheSwing[idx];
return CacheIndicator<Swing>(new Swing(){ Strength = strength }, input, ref cacheSwing);
}
I'd appreciate any help
Thankyou,
iq
Comment