Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RiskAllocationRequest" /> class.
 /// </summary>
 /// <param name="clientId">clientId.</param>
 /// <param name="allocationMethod">allocationMethod (required).</param>
 /// <param name="optConfig">optConfig.</param>
 /// <param name="marketDataSource">marketDataSource (default to MarketDataSourceEnum.Nucleus).</param>
 /// <param name="riskScore">riskScore.</param>
 /// <param name="useProxyData">useProxyData (default to false).</param>
 /// <param name="allocations">allocations.</param>
 public RiskAllocationRequest(Guid?clientId = default(Guid?), AllocationMethodEnum allocationMethod = default(AllocationMethodEnum), OptConfig optConfig = default(OptConfig), MarketDataSourceEnum?marketDataSource = MarketDataSourceEnum.Nucleus, decimal?riskScore = default(decimal?), bool?useProxyData = false, List <Guid?> allocations = default(List <Guid?>))
 {
     // to ensure "allocationMethod" is required (not null)
     if (allocationMethod == null)
     {
         throw new InvalidDataException("allocationMethod is a required property for RiskAllocationRequest and cannot be null");
     }
     else
     {
         this.AllocationMethod = allocationMethod;
     }
     this.ClientId  = clientId;
     this.OptConfig = optConfig;
     // use default value if no "marketDataSource" provided
     if (marketDataSource == null)
     {
         this.MarketDataSource = MarketDataSourceEnum.Nucleus;
     }
     else
     {
         this.MarketDataSource = marketDataSource;
     }
     this.RiskScore = riskScore;
     // use default value if no "useProxyData" provided
     if (useProxyData == null)
     {
         this.UseProxyData = false;
     }
     else
     {
         this.UseProxyData = useProxyData;
     }
     this.Allocations = allocations;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GoalAccumulationAllocationRequest" /> class.
 /// </summary>
 /// <param name="recommendationConfig">recommendationConfig.</param>
 /// <param name="compoundingRate">compoundingRate (default to 0.0F).</param>
 /// <param name="riskScore">riskScore.</param>
 /// <param name="recommendType">recommendType (default to RecommendTypeEnum.Horizon).</param>
 /// <param name="createLog">createLog (default to false).</param>
 /// <param name="goalConfig">goalConfig.</param>
 /// <param name="n">n (default to 1000).</param>
 /// <param name="allocationMethod">allocationMethod (required).</param>
 /// <param name="allocationPriority">allocationPriority (required).</param>
 /// <param name="removeOutliers">removeOutliers (default to true).</param>
 /// <param name="adjustForCompounding">adjustForCompounding (default to false).</param>
 /// <param name="goalId">goalId.</param>
 /// <param name="confTgt">confTgt (default to 0.9F).</param>
 /// <param name="tradingDaysPerYear">tradingDaysPerYear (default to 252).</param>
 /// <param name="useProxyData">useProxyData (default to false).</param>
 /// <param name="thresh">thresh.</param>
 /// <param name="withdrawalTax">withdrawalTax (default to 0.0F).</param>
 /// <param name="clientId">clientId.</param>
 /// <param name="optConfig">optConfig.</param>
 /// <param name="marketDataSource">marketDataSource (default to MarketDataSourceEnum.Nucleus).</param>
 /// <param name="threshType">threshType (default to ThreshTypeEnum.Perc).</param>
 /// <param name="horizonFrequency">horizonFrequency (default to HorizonFrequencyEnum.Year).</param>
 /// <param name="horizon">horizon.</param>
 /// <param name="allocations">allocations.</param>
 /// <param name="currInv">currInv.</param>
 /// <param name="depositConfig">depositConfig.</param>
 public GoalAccumulationAllocationRequest(RecommendationConfig recommendationConfig = default(RecommendationConfig), float?compoundingRate = 0.0F, decimal?riskScore = default(decimal?), RecommendTypeEnum?recommendType = RecommendTypeEnum.Horizon, bool?createLog = false, GoalConfig goalConfig = default(GoalConfig), int?n = 1000, AllocationMethodEnum allocationMethod = default(AllocationMethodEnum), AllocationPriorityEnum allocationPriority = default(AllocationPriorityEnum), bool?removeOutliers = true, bool?adjustForCompounding = false, Guid?goalId = default(Guid?), float?confTgt = 0.9F, int?tradingDaysPerYear = 252, bool?useProxyData = false, decimal?thresh = default(decimal?), float?withdrawalTax = 0.0F, Guid?clientId = default(Guid?), OptConfig optConfig = default(OptConfig), MarketDataSourceEnum?marketDataSource = MarketDataSourceEnum.Nucleus, ThreshTypeEnum?threshType = ThreshTypeEnum.Perc, HorizonFrequencyEnum?horizonFrequency = HorizonFrequencyEnum.Year, int?horizon = default(int?), List <Guid?> allocations = default(List <Guid?>), decimal?currInv = default(decimal?), List <AccumulationGoalDepositConfig> depositConfig = default(List <AccumulationGoalDepositConfig>))
 {
     // to ensure "allocationMethod" is required (not null)
     if (allocationMethod == null)
     {
         throw new InvalidDataException("allocationMethod is a required property for GoalAccumulationAllocationRequest and cannot be null");
     }
     else
     {
         this.AllocationMethod = allocationMethod;
     }
     // to ensure "allocationPriority" is required (not null)
     if (allocationPriority == null)
     {
         throw new InvalidDataException("allocationPriority is a required property for GoalAccumulationAllocationRequest and cannot be null");
     }
     else
     {
         this.AllocationPriority = allocationPriority;
     }
     this.RecommendationConfig = recommendationConfig;
     // use default value if no "compoundingRate" provided
     if (compoundingRate == null)
     {
         this.CompoundingRate = 0.0F;
     }
     else
     {
         this.CompoundingRate = compoundingRate;
     }
     this.RiskScore = riskScore;
     // use default value if no "recommendType" provided
     if (recommendType == null)
     {
         this.RecommendType = RecommendTypeEnum.Horizon;
     }
     else
     {
         this.RecommendType = recommendType;
     }
     // use default value if no "createLog" provided
     if (createLog == null)
     {
         this.CreateLog = false;
     }
     else
     {
         this.CreateLog = createLog;
     }
     this.GoalConfig = goalConfig;
     // use default value if no "n" provided
     if (n == null)
     {
         this.N = 1000;
     }
     else
     {
         this.N = n;
     }
     // use default value if no "removeOutliers" provided
     if (removeOutliers == null)
     {
         this.RemoveOutliers = true;
     }
     else
     {
         this.RemoveOutliers = removeOutliers;
     }
     // use default value if no "adjustForCompounding" provided
     if (adjustForCompounding == null)
     {
         this.AdjustForCompounding = false;
     }
     else
     {
         this.AdjustForCompounding = adjustForCompounding;
     }
     this.GoalId = goalId;
     // use default value if no "confTgt" provided
     if (confTgt == null)
     {
         this.ConfTgt = 0.9F;
     }
     else
     {
         this.ConfTgt = confTgt;
     }
     // use default value if no "tradingDaysPerYear" provided
     if (tradingDaysPerYear == null)
     {
         this.TradingDaysPerYear = 252;
     }
     else
     {
         this.TradingDaysPerYear = tradingDaysPerYear;
     }
     // use default value if no "useProxyData" provided
     if (useProxyData == null)
     {
         this.UseProxyData = false;
     }
     else
     {
         this.UseProxyData = useProxyData;
     }
     this.Thresh = thresh;
     // use default value if no "withdrawalTax" provided
     if (withdrawalTax == null)
     {
         this.WithdrawalTax = 0.0F;
     }
     else
     {
         this.WithdrawalTax = withdrawalTax;
     }
     this.ClientId  = clientId;
     this.OptConfig = optConfig;
     // use default value if no "marketDataSource" provided
     if (marketDataSource == null)
     {
         this.MarketDataSource = MarketDataSourceEnum.Nucleus;
     }
     else
     {
         this.MarketDataSource = marketDataSource;
     }
     // use default value if no "threshType" provided
     if (threshType == null)
     {
         this.ThreshType = ThreshTypeEnum.Perc;
     }
     else
     {
         this.ThreshType = threshType;
     }
     // use default value if no "horizonFrequency" provided
     if (horizonFrequency == null)
     {
         this.HorizonFrequency = HorizonFrequencyEnum.Year;
     }
     else
     {
         this.HorizonFrequency = horizonFrequency;
     }
     this.Horizon       = horizon;
     this.Allocations   = allocations;
     this.CurrInv       = currInv;
     this.DepositConfig = depositConfig;
 }