/// <summary> /// Initialise security portfolio manager. /// </summary> public SecurityPortfolioManager(SecurityManager securityManager, SecurityTransactionManager transactions, IOrderProperties defaultOrderProperties = null) { Securities = securityManager; Transactions = transactions; MarginCallModel = new DefaultMarginCallModel(this, defaultOrderProperties); CashBook = new CashBook(); UnsettledCashBook = new CashBook(); _unsettledCashAmounts = new List <UnsettledCashAmount>(); _baseCurrencyCash = CashBook[CashBook.AccountCurrency]; _baseCurrencyUnsettledCash = UnsettledCashBook[CashBook.AccountCurrency]; // default to $100,000.00 _baseCurrencyCash.SetAmount(100000); }
/// <summary> /// Set the account currency cash this algorithm is to manage. /// </summary> /// <param name="cash">Decimal cash value of portfolio</param> public void SetCash(decimal cash) { _setCashWasCalled = true; _baseCurrencyCash.SetAmount(cash); }
/// <summary> /// Set the base currrency cash this algorithm is to manage. /// </summary> /// <param name="cash">Decimal cash value of portfolio</param> public void SetCash(decimal cash) { _baseCurrencyCash.SetAmount(cash); }