/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using QuantConnect.Data;
using QuantConnect.Interfaces;
using QuantConnect.Securities;
namespace QuantConnect
{
///
/// Defines a base class for
///
public abstract class DataProviderEventArgs : EventArgs
{
///
/// Gets the symbol being processed that generated the event
///
public Symbol Symbol { get; }
///
/// Initializes a new instance of the class
///
/// Symbol being processed that generated the event
protected DataProviderEventArgs(Symbol symbol)
{
Symbol = symbol;
}
}
///
/// Event arguments for the event
///
public sealed class InvalidConfigurationDetectedEventArgs : DataProviderEventArgs
{
///
/// Gets the error message
///
public string Message { get; }
///
/// Initializes a new instance of the class
///
/// Symbol being processed that generated the event
/// The error message
public InvalidConfigurationDetectedEventArgs(Symbol symbol, string message)
: base(symbol)
{
Message = message;
}
}
///
/// Event arguments for the event
///
public sealed class NumericalPrecisionLimitedEventArgs : DataProviderEventArgs
{
///
/// Gets the error message
///
public string Message { get; }
///
/// Initializes a new instance of the class
///
/// Symbol being processed that generated the event
/// The error message
public NumericalPrecisionLimitedEventArgs(Symbol symbol, string message)
: base(symbol)
{
Message = message;
}
}
///
/// Event arguments for the event
///
public sealed class DownloadFailedEventArgs : DataProviderEventArgs
{
///
/// Gets the error message
///
public string Message { get; }
///
/// Gets the error stack trace
///
public string StackTrace { get; }
///
/// Initializes a new instance of the class
///
/// Symbol being processed that generated the event
/// The error message
/// The error stack trace
public DownloadFailedEventArgs(Symbol symbol, string message, string stackTrace = "")
: base(symbol)
{
Message = message;
StackTrace = stackTrace;
}
}
///
/// Event arguments for the event
///
public sealed class ReaderErrorDetectedEventArgs : DataProviderEventArgs
{
///
/// Gets the error message
///
public string Message { get; }
///
/// Gets the error stack trace
///
public string StackTrace { get; }
///
/// Initializes a new instance of the class
///
/// Symbol being processed that generated the event
/// The error message
/// The error stack trace
public ReaderErrorDetectedEventArgs(Symbol symbol, string message, string stackTrace = "")
: base(symbol)
{
Message = message;
StackTrace = stackTrace;
}
}
///
/// Event arguments for the event
///
public sealed class StartDateLimitedEventArgs : DataProviderEventArgs
{
///
/// Gets the error message
///
public string Message { get; }
///
/// Initializes a new instance of the class
///
/// Symbol being processed that generated the event
/// The error message
public StartDateLimitedEventArgs(Symbol symbol, string message)
: base(symbol)
{
Message = message;
}
}
///
/// Event arguments for the NewTradableDate event
///
public sealed class NewTradableDateEventArgs : DataProviderEventArgs
{
///
/// The new tradable date
///
public DateTime Date { get; }
///
/// The last of the
/// for which we are enumerating
///
public BaseData LastBaseData { get; }
///
/// The last raw security price we have
///
public decimal? LastRawPrice { get; }
///
/// Initializes a new instance of the class
///
/// The new tradable date
/// The last of the
/// for which we are enumerating
/// The of the new tradable date
/// The last raw security price we have
public NewTradableDateEventArgs(DateTime date, BaseData lastBaseData, Symbol symbol, decimal? lastRawPrice)
: base(symbol)
{
Date = date;
LastBaseData = lastBaseData;
LastRawPrice = lastRawPrice;
}
}
}