public PortfolioComponentView(IModelVersion modelVersion, decimal modelAllocation, PortfolioComponentView parent) : this(parent) { PortfolioComponentType = PortfolioComponentType.Model; ComponentKey = modelVersion.Key; ComponentName = modelVersion.ParentModel.ModelName; ModelAllocation = modelAllocation; }
/// <summary> /// Initializes a new instance of the <see cref="T:B4F.TotalGiro.Instruments.ModelModel">ModelModel</see> class. /// </summary> public ModelModel(IModelVersion version, decimal allocation) : base(allocation) { this.version = version; }
/// <summary> /// Initializes a new instance of the <see cref="T:B4F.TotalGiro.Instruments.ModelInstrument">ModelInstrument</see> class. /// </summary> public ModelInstrument(IModelVersion parent, IInstrument component, decimal allocation) : base(allocation) { base.ParentVersion = parent; this.component = component; }
public RebalanceIndicationLine( IModelVersion version, IModelVersion nextVersion, IInstrumentsWithPrices instrument, DateTime startDate, decimal allocation, Price buyPrice, Price sellPrice) { this.Version = version; this.NextVersion = nextVersion; if (this.NextVersion != null) this.EndDate = this.NextVersion.LatestVersionDate; this.Instrument = instrument; this.StartDate = startDate; this.Allocation = allocation; this.BuyPrice = buyPrice; this.SellPrice = sellPrice; }
private static IEnumerable<PortfolioComponentView> expandModelVersion(IDalSession session, IModelVersion modelVersion, decimal allocation, PortfolioComponentView parent) { PortfolioComponentView model = new PortfolioComponentView(modelVersion, allocation, parent); return modelVersion.ModelComponents .OrderBy(mc => mc.ModelComponentType == ModelComponentType.Instrument ? 0 : 1) .ThenBy(mc => mc.ComponentName) //.Where(mc => mc.ModelComponentKey != 13258) .Select(mc => expandModelComponent(session, mc, allocation * mc.Allocation, model)) .Aggregate(EnumerableExtensions.Singleton(model), Enumerable.Concat); }