/*
* 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 GetMaximumOrderQuantityForTargetBuyingPowerParameters
{
///
/// Gets the algorithm's portfolio
///
public SecurityPortfolioManager Portfolio { get; }
///
/// Gets the security
///
public Security Security { get; }
///
/// Gets the target signed percentage buying power
///
public decimal TargetBuyingPower { 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 target percentage buying power
/// 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 GetMaximumOrderQuantityForTargetBuyingPowerParameters(SecurityPortfolioManager portfolio, Security security,
decimal targetBuyingPower, decimal minimumOrderMarginPortfolioPercentage, bool silenceNonErrorReasons = false)
{
Portfolio = portfolio;
Security = security;
TargetBuyingPower = targetBuyingPower;
SilenceNonErrorReasons = silenceNonErrorReasons;
MinimumOrderMarginPortfolioPercentage = minimumOrderMarginPortfolioPercentage;
}
}
}