I established a print with the symbol and I can see that it does the perfect route, but when it compares fundamentalDataUpdate.Instrument.FullName it does not match because the information it is reading is wrong.
I appreciate your help
Thank you
public class SevenFPonderado : Indicator
{
private string[] symbols = {"AAPL", "MSFT", "GOOGL", "AMZN", "META", "TSLA", "NVDA"}; // Add more symbols
private double[] prices;
private double[] ask;
private double[] marketCaps;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "SevenFPonderado";
Calculate = Calculate.OnPriceChange;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
foreach (string symbol in symbols)
{
AddDataSeries(symbol, Data.BarsPeriodType.Second,1, Data.MarketDataType.Last);
}
prices = new double[symbols.Length];
ask = new double[symbols.Length];
marketCaps = new double[symbols.Length];
}
}
protected override void OnFundamentalData(FundamentalDataEventArgs fundamentalDataUpdate)
{
for (int i = 0; i < symbols.Length; i++)
{
string symbol = symbols[i];
// Print("Symbolo " + symbol);
// Print("Fundamnetal " + fundamentalDataUpdate.Instrument.FullName);
// NOTA imprimo Symbols y Fundamental no son igual, cuando deberian serlo
// La Informacion de Fundamentales no me Toma AAPL ni NVDA, y esta tomando NQ como fundamental al final
if (fundamentalDataUpdate.Instrument.FullName == symbols[i] && fundamentalDataUpdate.FundamentalDataType == FundamentalDataType.MarketCap)
{
marketCaps[i] = fundamentalDataUpdate.DoubleValue;
Print(symbol + " Market Cap " + marketCaps[i]);
}
}
}

Comment