Testa.cs 'NinjaTrader.NinjaScript.Series<double>' does not contain a definition for 'GroupBy' and no extension method 'GroupBy' accepting a first argument of type 'NinjaTrader.NinjaScript.Series<double>' could be found (are you missing a using directive or an assembly reference?) CS1061 221 20
Testa.cs 'double' does not contain a definition for 'Max' and no extension method 'Max' accepting a first argument of type 'double' could be found (are you missing a using directive or an assembly reference?) CS1061 222 19
Testa.cs 'double' does not contain a definition for 'First' and no extension method 'First' accepting a first argument of type 'double' could be found (are you missing a using directive or an assembly reference?) CS1061 223 15
namespace NinjaTrader.NinjaScript.Indicators
{
private Series<double> Rng0;
private Series<double> Rng1;
private Series<double> Rng0Rng1;
private double groups;
public class Testa : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
BarsBack = 360;
Rng0Index = 0;
Rng1Index = 0;
private double CalcMode()
{
double groups = Rng0Rng1.GroupBy(v => v);
int maxCount = groups.Max(g => g.Count());
int mode = groups.First(g => g.Count() == maxCount).Key;
}
protected override void OnBarUpdate()
{
CountIf(() => Rng0[Rng0Index] - Rng1[Rng1Index] >= 15*TickSize, BarsBack);
Rng0Rng1[Rng0Index] = Rng0[Rng0Index] - Rng1[Rng1Index];
var mode = CalcMode();
}
What's wrong with the 'double' with 'GroupBy' 'Max' and 'First' ? Thanks!
Comment