/* * 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.Securities; namespace QuantConnect.Interfaces { /// /// Reduced interface which allows setting and accessing /// price properties for a /// public interface ISecurityPrice { /// /// Get the current value of the security. /// decimal Price { get; } /// /// If this uses trade bar data, return the most recent close. /// decimal Close { get; } /// /// Access to the volume of the equity today /// decimal Volume { get; } /// /// Gets the most recent bid price if available /// decimal BidPrice { get; } /// /// Gets the most recent bid size if available /// decimal BidSize { get; } /// /// Gets the most recent ask price if available /// decimal AskPrice { get; } /// /// Gets the most recent ask size if available /// decimal AskSize { get; } /// /// Access to the open interest of the security today /// long OpenInterest { get; } /// /// for the asset. /// Symbol Symbol { get; } /// /// of the symbol /// SymbolProperties SymbolProperties { get; } /// /// Update any security properties based on the latest market data and time /// /// New data packet from LEAN void SetMarketPrice(BaseData data); /// /// Updates all of the security properties, such as price/OHLCV/bid/ask based /// on the data provided. Data is also stored into the security's data cache /// /// The security update data /// The data type /// Flag indicating whether /// contains any fill forward bar or not void Update(IReadOnlyList data, Type dataType, bool? containsFillForwardData); /// /// Get the last price update set to the security. /// /// BaseData object for this security BaseData GetLastData(); } }