当前位置: 首页>>代码示例>>C#>>正文


C# SecurityId.IsDefault方法代码示例

本文整理汇总了C#中SecurityId.IsDefault方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityId.IsDefault方法的具体用法?C# SecurityId.IsDefault怎么用?C# SecurityId.IsDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecurityId的用法示例。


在下文中一共展示了SecurityId.IsDefault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSecurityPath

		/// <summary>
		/// Получить путь к папке с маркет-данными для инструмента.
		/// </summary>
		/// <param name="securityId">Идентификатор инструмента.</param>
		/// <returns>Путь к папке с маркет-данными.</returns>
		public string GetSecurityPath(SecurityId securityId)
		{
			if (securityId.IsDefault())
				throw new ArgumentNullException("securityId");

			var id = securityId.SecurityCode + "@" + securityId.BoardCode;

			var folderName = id.SecurityIdToFolderName();

			return UseAlphabeticPath
				? IOPath.Combine(Path, id.Substring(0, 1), folderName)
				: IOPath.Combine(Path, folderName);
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:18,代码来源:LocalMarketDataDrive.cs

示例2: CancelOrders

		public void CancelOrders(bool? isStopOrder, string portfolioName, Sides? side, SecurityId securityId, SecurityTypes? securityType)
		{
			_adapter.AddDebugLog("CancelOrders: stop={0}, portf={1}, side={2}, id={3}", isStopOrder, portfolioName, side, securityId);

			var isBuySell = (side == null) ? null : side.Value.ToAlfaDirect();
			var account = portfolioName.IsEmpty() ? null : portfolioName.AccountFromPortfolioName();
			var pCode = securityId.SecurityCode.IsEmpty() ? null : securityId.SecurityCode;

			var treaties = new List<string>();
			var treaty = account.IsEmpty() ? null : account.TreatyFromAccount();

			if (!treaty.IsEmpty())
				treaties.Add(treaty);
			else
			{
				var data = _tableAccounts.GetLocalDbData();
				treaties.AddRange(data.Select(row => FieldsAccounts.Treaty.GetStrValue(row.ToColumns())));
			}

			if (!treaties.Any())
				throw new InvalidOperationException(LocalizedStrings.Str2277Params.Put(portfolioName));

			string placeCode = null;
			if (!securityId.IsDefault())
			{
				placeCode = _adapter.SecurityClassInfo.GetSecurityClass(securityType, securityId.BoardCode);

				if (placeCode == null)
					throw new InvalidOperationException(LocalizedStrings.Str2278);
			}

			foreach (var t in treaties)
				_ad.DropOrder(null, isBuySell, t, account, placeCode, pCode, -1);
		}
开发者ID:xyicheng,项目名称:StockSharp,代码行数:34,代码来源:AlfaWrapper.cs

示例3: GetStorageDrive

		/// <summary>
		/// Создать хранилище для <see cref="IMarketDataStorage"/>.
		/// </summary>
		/// <param name="securityId">Идентификатор инструмента.</param>
		/// <param name="dataType">Тип маркет-данных.</param>
		/// <param name="arg">Параметр, ассоциированный с типом <paramref name="dataType"/>. Например, <see cref="CandleMessage.Arg"/>.</param>
		/// <param name="format">Тип формата.</param>
		/// <returns>Хранилище для <see cref="IMarketDataStorage"/>.</returns>
		public override IMarketDataStorageDrive GetStorageDrive(SecurityId securityId, Type dataType, object arg, StorageFormats format)
		{
			if (securityId.IsDefault())
				throw new ArgumentNullException("securityId");

			return _drives.SafeAdd(Tuple.Create(securityId, dataType, arg, format),
				key => new LocalMarketDataStorageDrive(CreateFileName(dataType, arg), GetSecurityPath(securityId), format, this));
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:16,代码来源:LocalMarketDataDrive.cs

示例4: GetSecurityPath

//#pragma warning disable 612
		///// <summary>
		///// Load settings.
		///// </summary>
		///// <param name="storage">Settings storage.</param>
		//public override void Load(SettingsStorage storage)
		//{
		//	base.Load(storage);

		//	UseAlphabeticPath = storage.GetValue<bool>(nameof(UseAlphabeticPath));
		//}

		///// <summary>
		///// Save settings.
		///// </summary>
		///// <param name="storage">Settings storage.</param>
		//public override void Save(SettingsStorage storage)
		//{
		//	base.Save(storage);

		//	storage.SetValue(nameof(UseAlphabeticPath), UseAlphabeticPath);
		//}

		/// <summary>
		/// To get the path to the folder with market data for the instrument.
		/// </summary>
		/// <param name="securityId">Security ID.</param>
		/// <returns>The path to the folder with market data.</returns>
		public string GetSecurityPath(SecurityId securityId)
		{
			if (securityId.IsDefault())
				throw new ArgumentNullException(nameof(securityId));

			var id = securityId.ToStringId();

			var folderName = id.SecurityIdToFolderName();

			return //UseAlphabeticPath
				IOPath.Combine(Path, id.Substring(0, 1), folderName);
			//: IOPath.Combine(Path, folderName);
		}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:41,代码来源:LocalMarketDataDrive.cs


注:本文中的SecurityId.IsDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。