コード例 #1
0
        public string GetBarSettingsFriendlyName(BarSettings sets)
        {
            if (sets == null)
            {
                return(string.Empty);
            }
            var exists = barSettingsSeries.FirstOrDefault(bs => bs == sets);

            return(exists == null?sets.ToString() : exists.Title);
        }
コード例 #2
0
 public string GetBarSettingsFriendlyName(BarSettings sets)
 {
     var exists = barSettingsSeries.FirstOrDefault(bs => bs == sets);
     return !ReferenceEquals(exists, null) ? exists.Title : sets.ToString();
 }
コード例 #3
0
        public static bool PutForecast(int categoryId, string ticker, BarSettings timeframe, string xmlForecast)
        {
            var wc = new WebClient();
            if (!string.IsNullOrEmpty(username))
                wc.Credentials = new NetworkCredential(username, pass);

            var requestParams = new NameValueCollection
                                    {
                                        { TradeSignalXml.ReqPtrForecastCategory, categoryId.ToString() },
                                        { TradeSignalXml.ReqPtrForecastTicker, ticker },
                                        { TradeSignalXml.ReqPtrForecastTimeframe, timeframe.ToString(TradeSignalXml.TimeframeSeparator) }
                                    };
            wc.QueryString = requestParams;
            try
            {
                var responseBytes = wc.UploadData(url, "PUT", TradeSignalXml.DefaultEncoding.GetBytes(xmlForecast));
                var respString = TradeSignalXml.DefaultEncoding.GetString(responseBytes);
                return respString == "OK";
            }
            catch (Exception ex)
            {
                Logger.Error("Ошибка в PutForecast()", ex);
                return false;
            }
        }
コード例 #4
0
        public string GetBarSettingsFriendlyName(BarSettings sets)
        {
            var exists = barSettingsSeries.FirstOrDefault(bs => bs == sets);

            return(!ReferenceEquals(exists, null) ? exists.Title : sets.ToString());
        }