/* * 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 System.Collections.Generic; using QuantConnect.Data; using QuantConnect.Interfaces; using QuantConnect.Securities; namespace QuantConnect.Orders.Fills { /// /// Defines the parameters for the method /// public class FillModelParameters { /// /// Gets the /// public Security Security { get; } /// /// Gets the /// public Order Order { get; } /// /// Gets the provider /// public ISubscriptionDataConfigProvider ConfigProvider { get; } /// /// Gets the minimum time span elapsed to consider a market fill price as stale (defaults to one hour) /// public TimeSpan StalePriceTimeSpan { get; } /// /// Gets the collection of securities by order /// /// We need this so that combo limit orders can access the prices for each security to calculate the price for the fill public Dictionary SecuritiesForOrders { get; } /// /// Callback to notify when an order is updated by the fill model /// public Action OnOrderUpdated { get; } /// /// Creates a new instance /// /// Security asset we're filling /// Order packet to model /// The to use /// The minimum time span elapsed to consider a fill price as stale /// Collection of securities for each order public FillModelParameters( Security security, Order order, ISubscriptionDataConfigProvider configProvider, TimeSpan stalePriceTimeSpan, Dictionary securitiesForOrders, Action onOrderUpdated = null) { Security = security; Order = order; ConfigProvider = configProvider; StalePriceTimeSpan = stalePriceTimeSpan; SecuritiesForOrders = securitiesForOrders; OnOrderUpdated = onOrderUpdated ?? (o => { }); } } }