Dictionary<string, TickerInfo> tickerData = new Dictionary<string, TickerInfo>();
/// Populate the dictionary with ticker data
/// Format for new tickers is as follows: Minimum Tick Size, Mini Tick Value, Mini Ratio, Micro Tick Size, Micro Tick Value, Micro Ratio
/// double.NaN repesents a value that is unavailable
tickerData.Add("NQ", new TickerInfo(0.25, 5.00, 20.00, 0.25, 0.50, 2.00));
tickerData.Add("ES", new TickerInfo(0.25, 12.50, 50.00, 0.25, 1.25, 5.00));
tickerData.Add("RTY", new TickerInfo(0.10, 5.00, 50.00, 0.10, 0.50, 5.00));
tickerData.Add("CL", new TickerInfo(0.01, 10.00, 1000.00, 0.01, 1.00, 100.00));
tickerData.Add("NG", new TickerInfo(0.001, 10.00, 10000.00, 0.001, 1.00, 1000.00));
tickerData.Add("GC", new TickerInfo(0.10, 10.00, 100.00, 0.10, 1.00, 10.00));
tickerData.Add("SI", new TickerInfo(0.005, 25.00, 5000.00, 0.005, 5.00, 1000.00));
tickerData.Add("HG", new TickerInfo(0.0005, 12.50, 25000.00, 0.0005, 1.25, 2500.00));
tickerData.Add("PL", new TickerInfo(0.10, 5.00, 50.00, 0.10, double.NaN, double.NaN)); // For "PL", where x is represented as NaN
tickerData.Add("ZC", new TickerInfo(0.25, 12.50, 50.00, 0.125, 1.25, 10.00));
tickerData.Add("ZS", new TickerInfo(0.25, 12.50, 50.00, 0.125, 1.25, 10.00));
tickerData.Add("ZW", new TickerInfo(0.25, 12.50, 50.00, 0.125, 1.25, 10.00));
/// Add other ticker data here...
Later, I want to reference which ticker is open on the current chart that the indicator is enabled on, and be able to reference these numbers based on the given ticker. Well, when I Print(Instrument.FullName); it shows up with "NQ 6-24" for example. I'm afraid this wont help because if I were to do:
if (Instrument.FullName == "NQ") etc. etc.
Then the FullName would not match the name in my dictionary. I don't want to edit my code every time I change expiry's. There must be a way to access just the symbol right?
