public static Message GetMessage(this StrategyNotification strategyNotification)
        {
            MessageType messageType;

            switch (strategyNotification.NotificationLevel)
            {
            case NotificationLevel.Error:
                messageType = MessageType.Error;
                break;

            case NotificationLevel.Warning:
                messageType = MessageType.Warn;
                break;

            default:
                messageType = MessageType.Info;
                break;
            }

            return(new Message
            {
                MessageType = messageType,
                Text = strategyNotification.Message,
                Timestamp = strategyNotification.Timestamp,
                TextVerbose = strategyNotification.ToString()
            });
        }
        public static Message GetMessage(this StrategyNotification strategyNotification)
        {
            if (strategyNotification == null)
            {
                throw new ArgumentNullException(nameof(strategyNotification));
            }

            MessageType messageType = strategyNotification.NotificationLevel switch
            {
                NotificationLevel.Error => MessageType.Error,
                NotificationLevel.Warning => MessageType.Warn,
                _ => MessageType.Info
            };

            return(new Message
            {
                MessageType = messageType,
                Text = strategyNotification.Message,
                Timestamp = strategyNotification.Timestamp,
                TextVerbose = strategyNotification.ToString()
            });
        }
    }