예제 #1
0
        public Account OpenAccount(Money seedAmount)
        {
            var account = new Account();
            account.Deposit(seedAmount);

            return account;
        }
예제 #2
0
 private Reservation(Account account, DateTimeOffset expiration, Money amount)
     : this(true)
 {
     this.account = account;
     this.Expiration = expiration;
     this.Amount = amount;
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 internal static Reservation Award(Account account, DateTimeOffset expiration, Money amount)
 {
     return new Reservation(account, expiration, amount);
 }
예제 #6
0
        public Account SplitAccount(Account existingAccount, Money amount)
        {
            existingAccount.Withdraw(amount);

            return this.OpenAccount(amount);
        }
예제 #7
0
 public Task<Maybe<IOrder>> SubmitSellOrder(string symbol, Account account, double shares)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 public Task<Maybe<IOrder>> SubmitBuyOrder(string symbol, Account account, Money amount)
 {
     throw new NotImplementedException();
 }