diff --git a/indicators/news/News.cs b/indicators/news/News.cs index 590a94e..0580f42 100644 --- a/indicators/news/News.cs +++ b/indicators/news/News.cs @@ -48,6 +48,7 @@ namespace NinjaTrader.NinjaScript.Indicators VerticalPadding = 5; YOffset = 0; CellBackgroundColor = Brushes.Transparent; + CurrencyFilter = "USD"; } else if (State == State.Configure) { @@ -103,6 +104,9 @@ namespace NinjaTrader.NinjaScript.Indicators string time = eventTime.ToString("hh:mmtt").ToLower(); + if (!string.IsNullOrEmpty(CurrencyFilter) && !currency.Equals(CurrencyFilter, StringComparison.OrdinalIgnoreCase)) + continue; // Skip events that do not match the filter. + newsEvents.Add(new NewsEvent { Time = time, Currency = currency, Title = title }); } } @@ -303,6 +307,10 @@ namespace NinjaTrader.NinjaScript.Indicators get { return Serialize.BrushToString(CellBackgroundColor); } set { CellBackgroundColor = Serialize.StringToBrush(value); } } + + [Display(Name = "Currency Filter", GroupName = "News", Order = 10)] + public string CurrencyFilter { get; set; } + #endregion } }