Ejemplo n.º 1
0
 public PortfolioComponentView(IModelVersion modelVersion, decimal modelAllocation, PortfolioComponentView parent)
     : this(parent)
 {
     PortfolioComponentType = PortfolioComponentType.Model;
     ComponentKey = modelVersion.Key;
     ComponentName = modelVersion.ParentModel.ModelName;
     ModelAllocation = modelAllocation;
 }
Ejemplo n.º 2
0
 /// <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;
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
        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);
        }