Пример #1
0
        static void ConnectTest()
        {
            IBUser user = new IBUser("127.0.0.1", 4002, 2, _log);
            if (user.Connect())
            {
                var summary = user.GetAccountSummary();
                foreach (var item in summary)
                {
                    Console.WriteLine(string.Format("{0} {1} {2} {3} {4}", item.RequestId, item.Account, item.Tag, item.Currency, item.Value));
                }

                var simpleOrder = new Skywolf.Contracts.DataContracts.Trading.SimpleOrder() {
                    UserName = "******",
                    Action = Skywolf.Contracts.DataContracts.Trading.TradeAction.BUY,
                    Currency = "USD",
                    Folder = "Index",
                    Quantity = 100,
                    SecurityType = Skywolf.Contracts.DataContracts.Trading.TradeSecurityType.Stock,
                    Strategy = "SmartBeta",
                    Symbol = "SPY" };

                try
                {
                    var contract = IBContractSamples.GetContract(simpleOrder);
                    var order = IBOrderSamples.GetOrder(simpleOrder);
                    int result = user.PlaceOrder(contract, order);
                    Console.WriteLine(string.Format("OrderId is {0}", result));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(string.Format("Error is {0}", ex.Message));
                }
            }

            Console.Read();
        }
 public UserController(IBUser bUser, IBGroup bGroup)
 {
     _bUser  = bUser;
     _bGroup = bGroup;
 }
Пример #3
0
 public BGroup(IBUser bUser)
 {
     _bUser = bUser;
 }
 public MongoDbGenericDao_Search_Tests()
 {
     IBUser = new BUser(mongodbserver);
 }
Пример #5
0
 public FUser()
 {
     _userBusiness = new BUser();
 }
 public MongoDbGenericDao_Search_Tests()
 {
     IBUser = new BUser(mongodbserver);
 }