16 using System.Runtime.CompilerServices;
28 public static partial class Messages
35 [MethodImpl(MethodImplOptions.AggressiveInlining)]
36 public static string InvalidTargetPercent(
IAlgorithm algorithm, decimal percent)
38 return Invariant($
@"The portfolio target percent: {
39 percent}, does not comply with the current 'Algorithm.Settings' 'MaxAbsolutePortfolioTargetPercentage': {
40 algorithm.Settings.MaxAbsolutePortfolioTargetPercentage} or 'MinAbsolutePortfolioTargetPercentage': {
41 algorithm.Settings.MinAbsolutePortfolioTargetPercentage}. Skipping");
44 [MethodImpl(MethodImplOptions.AggressiveInlining)]
47 return Invariant($
"{symbol} not found in portfolio. Request this data when initializing the algorithm.");
50 [MethodImpl(MethodImplOptions.AggressiveInlining)]
53 return Invariant($
"Unable to compute order quantity of {symbol}. Reason: {result.Reason} Returning null.");
56 [MethodImpl(MethodImplOptions.AggressiveInlining)]
57 public static string ToString(Algorithm.Framework.Portfolio.PortfolioTarget portfolioTarget)
59 var str = Invariant($
"{portfolioTarget.Symbol}: {portfolioTarget.Quantity.Normalize()}");
60 if (!
string.IsNullOrEmpty(portfolioTarget.Tag))
62 str += $
" ({portfolioTarget.Tag})";