public Account OpenAccount(Money seedAmount) { var account = new Account(); account.Deposit(seedAmount); return account; }
private Reservation(Account account, DateTimeOffset expiration, Money amount) : this(true) { this.account = account; this.Expiration = expiration; this.Amount = amount; }
public async Task<Maybe<IOrder>> SubmitSellOrder(string symbol, Account account, double shares) { await Task.Yield(); var id = Guid.NewGuid(); var slippage = MoneyUtil.NinetyPercentOf(new Money(shares * 10, Currency.FromCurrencyCode(CurrencyCode.USD))); var order = new TestOrder() { Id = id, Slippage = slippage, IsExecuted = false }; sellOrders.Add(id, order); return Maybe<IOrder>.Some(order); }
public async Task<Maybe<IOrder>> SubmitBuyOrder(string symbol, Account account, Money amount) { await Task.Yield(); var id = Guid.NewGuid(); var slippage = MoneyUtil.TenPercentOf(amount); var order = new TestOrder() { Id = id, Slippage = slippage, IsExecuted = false }; buyOrders.Add(id, order); return Maybe<IOrder>.Some(order); }
internal static Reservation Award(Account account, DateTimeOffset expiration, Money amount) { return new Reservation(account, expiration, amount); }
public Account SplitAccount(Account existingAccount, Money amount) { existingAccount.Withdraw(amount); return this.OpenAccount(amount); }
public Task<Maybe<IOrder>> SubmitSellOrder(string symbol, Account account, double shares) { throw new NotImplementedException(); }
public Task<Maybe<IOrder>> SubmitBuyOrder(string symbol, Account account, Money amount) { throw new NotImplementedException(); }