示例#1
0
 public HttpResponseMessage UpdateStaticData([FromBody] IEnumerable <IBStaticData> value)
 {
     try
     {
         if (!SQLQueryAccessor.UpdateIbStaticData(value))
         {
             return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "UpdateStaticData Failed"));
         }
         return(Request.CreateResponse(HttpStatusCode.OK, value));
     }
     catch (Exception message)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }
示例#2
0
 public HttpResponseMessage UpdateStrategy([FromBody] IBStrategyMapping value)
 {
     try
     {
         if (!SQLQueryAccessor.UpdateIbStrategyMapping(value))
         {
             return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "IBStrategymapping with Accountname: " + value.AccountName + ", TickerName: " + value.TickerName + " not found to update"));
         }
         return(Request.CreateResponse(HttpStatusCode.OK, value));
     }
     catch
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }
示例#3
0
        public IEnumerable <Contract> GetIBSecurity()
        {
            var             temp   = SQLQueryAccessor.GetIbSecurities();
            List <Contract> result = new List <Contract>();

            foreach (var item in temp)
            {
                var contract = new Contract();
                contract.Symbol      = item.TickerName;
                contract.LocalSymbol = item.TickerName;
                contract.ConId       = item.ConId;
                contract.PrimaryExch = item.Exchange;
                contract.SecType     = "STK";
                result.Add(contract);
            }
            return(result);
        }
示例#4
0
 public IEnumerable <IBStrategy> GetStrategy()
 {
     return(SQLQueryAccessor.GetIbStrategy());
 }
示例#5
0
 public IEnumerable <IBStaticData> IBStaticData() => SQLQueryAccessor.GetIbStaticData();
示例#6
0
 public decimal CashBalanceStart() => SQLQueryAccessor.GetCashActivity(_ibcore._AccountName);