/// <summary> /// To get market data value for the strategy instrument. /// </summary> /// <typeparam name="T">The type of the market data field value.</typeparam> /// <param name="strategy">Strategy.</param> /// <param name="field">Market-data field.</param> /// <returns>The field value. If no data, the <see langword="null" /> will be returned.</returns> public static T GetSecurityValue<T>(this Strategy strategy, Level1Fields field) { if (strategy == null) throw new ArgumentNullException(nameof(strategy)); return strategy.GetSecurityValue<T>(strategy.Security, field); }
/// <summary> /// Получить значение маркет-данных для инструмента стратегии. /// </summary> /// <typeparam name="T">Тип значения поля маркет-данных.</typeparam> /// <param name="strategy">Стратегия.</param> /// <param name="field">Поле маркет-данных.</param> /// <returns>Значение поля. Если данных нет, то будет возвращено <see langword="null"/>.</returns> public static T GetSecurityValue <T>(this Strategy strategy, Level1Fields field) { if (strategy == null) { throw new ArgumentNullException("strategy"); } return(strategy.GetSecurityValue <T>(strategy.Security, field)); }