Exemple #1
0
 public HistoricalPosition(int key, IInstrumentsWithPrices instrument, decimal valueSize,
     DateTime positionDate, IAccountTypeInternal account)
 {
     this.Key = key;
     this.ValueSize = new InstrumentSize(valueSize, instrument);
     this.PositionDate = positionDate;
     this.Account = account;
 }
 public InstrumentPriceRowView(IInstrumentsWithPrices instrument, decimal priceQuantity)
 {
     this.instrumentId = instrument.Key;
     this.isin = instrument.Isin;
     this.instrumentName = instrument.Name;
     this.currency = instrument.CurrencyNominal.AltSymbol;
     this.decimalPlaces = instrument.DecimalPlaces;
     this.priceQuantity = priceQuantity;
 }
 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;
 }
 /// <summary>
 /// Get historical price of instrument at point in time
 /// </summary>
 /// <param name="session">Data access object</param>
 /// <param name="instrument">Instrument object</param>
 /// <param name="date">Date</param>
 /// <returns>Collection of historical prices</returns>
 public static IList<IHistoricalPrice> GetHistoricalPrices(IDalSession session, IInstrumentsWithPrices instrument, DateTime date)
 {
     List<ICriterion> expressions = new List<ICriterion>();
     expressions.Add(Expression.Eq("Price.Instrument.Key", instrument.Key));
     expressions.Add(Expression.Eq("Date", date));
     return session.GetTypedList<IHistoricalPrice, IHistoricalPrice>(expressions);
 }