/* * 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. */ namespace QuantConnect.Securities { /// /// Defines the parameters for /// public class GetMaximumOrderQuantityForDeltaBuyingPowerParameters { /// /// Gets the algorithm's portfolio /// public SecurityPortfolioManager Portfolio { get; } /// /// Gets the security /// public Security Security { get; } /// /// The delta buying power. /// /// Sign defines the position side to apply the delta, positive long, negative short side. public decimal DeltaBuyingPower { get; } /// /// True enables the to skip setting /// for non error situations, for performance /// public bool SilenceNonErrorReasons { get; } /// /// Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes /// /// Default value is 0. This setting is useful to avoid small trading noise when using SetHoldings public decimal MinimumOrderMarginPortfolioPercentage { get; } /// /// Initializes a new instance of the class /// /// The algorithm's portfolio /// The security /// The delta buying power to apply. /// Sign defines the position side to apply the delta /// Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes /// True will not return /// set for non error situation, this is for performance public GetMaximumOrderQuantityForDeltaBuyingPowerParameters(SecurityPortfolioManager portfolio, Security security, decimal deltaBuyingPower, decimal minimumOrderMarginPortfolioPercentage, bool silenceNonErrorReasons = false) { Portfolio = portfolio; Security = security; DeltaBuyingPower = deltaBuyingPower; SilenceNonErrorReasons = silenceNonErrorReasons; MinimumOrderMarginPortfolioPercentage = minimumOrderMarginPortfolioPercentage; } } }