Ejemplo n.º 1
0
        public string FilterTrades(string username, string clientid, string acctcode, string symbol, string sectype, string time, string exchange, string side)
        {
            try
            {
                TradeFilter filter = new TradeFilter();
                filter.AcctCode = acctcode;
                int iClientId = 0;
                if (int.TryParse(clientid, out iClientId))
                {
                    filter.ClientId = iClientId;
                }
                filter.Exchange = exchange;
                filter.SecType  = sectype;
                filter.Side     = side;
                filter.Symbol   = symbol;
                filter.Time     = time;
                Trade[] trades = new IBTradingService().FilterTrades(username, filter);
                if (trades != null)
                {
                    trades.ToCSV();
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                _Logger.Error(ex);
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public string GetAllOpenOrders(string username)
 {
     try
     {
         Order[] orders = new IBTradingService().GetAllOpenOrders(username);
         if (orders != null)
         {
             return(orders.ToCSV());
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         _Logger.Error(ex);
         throw ex;
     }
 }
Ejemplo n.º 3
0
        public string GetAccountSummary(string username)
        {
            try
            {
                AccountSummary[] summary = new IBTradingService().GetAccountSummary(username);
                if (summary != null)
                {
                    return(summary.ToCSV());
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                _Logger.Error(ex);
                throw ex;
            }
        }
Ejemplo n.º 4
0
        public string GetPositions(string username)
        {
            try
            {
                Position[] positions = new IBTradingService().GetPositions(username);
                if (positions != null)
                {
                    return(positions.ToCSV());
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                _Logger.Error(ex);
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public string GetAllTrades(string username)
        {
            try
            {
                Trade[] trades = new IBTradingService().GetAllTrades(username);
                if (trades != null)
                {
                    return(trades.ToCSV());
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                _Logger.Error(ex);
                throw ex;
            }
        }