/// <summary> /// Initialize cash holder for a quant fund /// </summary> /// <param name="basecurrency"></param> /// <param name="initialcash"></param> public CashPosition(CurrencyType basecurrency, decimal initialcash) { InitialCash = initialcash; BaseCurrency = basecurrency; //Add initial cash _settledcash = new SettledCash(initialcash); }
/// <summary> /// Add cash to this holder of cash /// </summary> /// <param name="cash"></param> public void AddCash(SettledCash cash) { //Check if this settled or unsettled cash if (cash is UnsettledCash unsettledfunds) { _unsettledcash.Add(unsettledfunds); } else { _settledcash.AddFunds(cash.Amount); } }