with the same indicator in each temporality (EZKnube) That indicator has some plots, but the one that interests me is one called Trend. value 1 (buy) and -1 (sell) (attached image). I am activating the strategy in 30 seconds
error:I cannot access the values of the EZKNUBE indicator in the time frame 60 min and 15 min
else if (State == State.Configure)
{
// Agregar la serie de datos de 60 minutos
AddDataSeries(Data.BarsPeriodType.Minute, 60);
AddDataSeries(Data.BarsPeriodType.Minute, 15);
}
else if (State == State.DataLoaded)
{
// Inicializar EZKnube1_60Min solo una vez con la serie de datos de 60 minutos
if (BarsInProgress == 1)
{
EZKnube1_60Min = EZKnube(Close, EZKTriggerLine.EMA, 18, EZKSmothTrendLine.EMA, 18, "", true, true, 10, Brushes.Aqua, Brushes.Orange);
EZKnube1_15Min = EZKnube(Close, EZKTriggerLine.EMA, 18, EZKSmothTrendLine.EMA, 18, "", true, true, 10, Brushes.Aqua, Brushes.Orange);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 0)
return;
double trendValue60Min = EZKnube1_60Min.Trend[0];
double trendValue15Min = EZKnube1_15Min.Trend[0];
// Imprimir los valores de tendencia en la consola de NinjaTrader
Print("Trend 60 Min Value: " + trendValue60Min);
Print("Trend 15 Min Value: " + trendValue15Min);
// Si la tendencia es -1 en todas las temporalidades, pintar en rojo
if (trendValue60Min == -1 && trendValue15Min == -1)
{
BackBrushAll = Brushes.Red;
}
// Si la tendencia es 1 en todas las temporalidades, pintar en verde
else if (trendValue60Min == 1 && trendValue15Min == 1)
{
BackBrushAll = Brushes.Green;
}
}
Comment