當前位置: 首頁>>代碼示例>>C#>>正文


C# BarType類代碼示例

本文整理匯總了C#中BarType的典型用法代碼示例。如果您正苦於以下問題:C# BarType類的具體用法?C# BarType怎麽用?C# BarType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BarType類屬於命名空間,在下文中一共展示了BarType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Add

		public void Add(InstrumentList instruments, BarType barType, long barSize)
		{
			foreach (Instrument current in instruments)
			{
				this.Add(current, barType, barSize);
			}
		}
開發者ID:ForTrade,項目名稱:CSharp,代碼行數:7,代碼來源:BarFactory.cs

示例2: BarDataTypeItem

 public BarDataTypeItem(BarType barType, long barSize)
   : base(DataType.Bar)
 {
   this.barType = barType;
   this.barSize = barSize;
   this.key = string.Format("{0}{1}", (object) barType, (object) barSize);
 }
開發者ID:smther,項目名稱:FreeOQ,代碼行數:7,代碼來源:BarDataTypeItem.cs

示例3: BarTypeSizeToString

		public static string BarTypeSizeToString(BarType barType, long barSize)
		{
			switch (barType)
			{
				case BarType.Time:
					if (barSize == 86400L)
						return "Daily";
					if (barSize % 86400L == 0L)
                        return string.Format("{0} day", barSize / 86400);
					if (barSize % 3600L == 0L)
						return string.Format("{0} hour", (object)(barSize / 3600L));
					if (barSize % 60L == 0L)
						return string.Format("{0} min", (object)(barSize / 60L));
					else
						return string.Format("{0} sec", (object)barSize);
				case  BarType.Tick:
					return string.Format("{0} tick", (object)barSize);
				case BarType.Volume:
					return string.Format("{0} vol", (object)barSize);
				case BarType.Range:
					return string.Format("{0} range", (object)((double)barSize / 10000.0));
				default:
					throw new ArgumentException(string.Format("Unknown bar type - {0}", barType));
			}
		}
開發者ID:smther,項目名稱:FreeOQ,代碼行數:25,代碼來源:DataSeriesHelper.cs

示例4: BarFactoryItem

		protected BarFactoryItem(Instrument instrument, BarType barType, long barSize)
		{
			this.factory = null;
			this.instrument = instrument;
			this.barType = barType;
			this.barSize = barSize;
		}
開發者ID:ForTrade,項目名稱:CSharp,代碼行數:7,代碼來源:BarFactoryItem.cs

示例5: BarSeries

		///<summary>
		///  Gets bar series by instrument, bar type and bar size
		///</summary>
		public BarSeries this [Instrument instrument, BarType barType, long barSize]
		{
			get
			{
				return new BarSeries(FreeQuant.Instruments.DataManager.Bars[Map.OQ_FQ_Instrument[(object)instrument] as FreeQuant.Instruments.Instrument, EnumConverter.Convert(barType), barSize]);
			}
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:10,代碼來源:BarSeriesList.cs

示例6: CreateNewBar

		protected void CreateNewBar(BarType barType, DateTime beginTime, DateTime endTime, double price)
		{
			if (barType == BarType.Time && this.newBarSize == 86400)
				this.bar = new Bar(new FreeQuant.Data.Daily(beginTime, price, price, price, price, 0));
			else
				this.bar = new Bar(new FreeQuant.Data.Bar(EnumConverter.Convert(barType), this.newBarSize, beginTime, endTime, price, price, price, price, 0, 0));
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:7,代碼來源:BarCompressor.cs

示例7: TryGetBarTypeSize

		public static bool TryGetBarTypeSize(string seriesName, out BarType barType, out long barSize)
		{
			DataSeriesInfo dataSeriesInfo = DataSeriesHelper.GetDataSeriesInfo(seriesName);
			barType = dataSeriesInfo.BarType;
			barSize = dataSeriesInfo.BarSize;
			return dataSeriesInfo.DataType == DataType.Bar;
		}
開發者ID:smther,項目名稱:FreeOQ,代碼行數:7,代碼來源:DataSeriesHelper.cs

示例8: CreateNewBar

		protected void CreateNewBar(BarType barType, DateTime beginTime, DateTime endTime, double price)
		{
			if (barType == BarType.Time && this.barSize == 86400)
				this.bar = new Daily(beginTime, price, price, price, price, 0);
			else
				this.bar = new Bar(barType, this.barSize, beginTime, endTime, price, price, price, price, 0, 0);
		}
開發者ID:smther,項目名稱:FreeOQ,代碼行數:7,代碼來源:BarCompressor.cs

示例9: GetHistoricalBars

		public static BarSeries GetHistoricalBars(Instrument instrument, DateTime begin, DateTime end, BarType barType, long barSize)
		{
			FreeQuant.Instruments.Instrument instrument1 = Map.OQ_FQ_Instrument[(object)instrument] as FreeQuant.Instruments.Instrument;
			if (barSize == 86400)
				return new BarSeries((FreeQuant.Series.BarSeries)FreeQuant.Instruments.DataManager.GetDailySeries(instrument1, begin, end));
			else
				return new BarSeries(FreeQuant.Instruments.DataManager.GetBarSeries(instrument1, begin, end, EnumConverter.Convert(barType), barSize));
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:8,代碼來源:DataManager.cs

示例10: BarSeries

		public BarSeries this[Instrument instrument, BarType barType, long barSize]
		{
			get
			{
				SmartQuant.Instruments.Instrument instrument2 = Map.OQ_SQ_Instrument[instrument] as SmartQuant.Instruments.Instrument;
				return new BarSeries(SmartQuant.Instruments.DataManager.Bars[instrument2, EnumConverter.Convert(barType), barSize]);
			}
		}
開發者ID:houzhongxu,項目名稱:OpenQuant.API,代碼行數:8,代碼來源:BarSeriesList.cs

示例11: GetBarPrefab

	private Bar GetBarPrefab(BarType barType) {
		if (barType == BarType.PlainBar) return plainBarPrefab;
		else if (barType == BarType.ButtonBar) return buttonBarPrefab;
		else {
			Debug.LogError("invalid bar type: " + barType.ToString());
			return null;
		}
	}
開發者ID:wtrebella,項目名稱:Grappler,代碼行數:8,代碼來源:BarPanel.cs

示例12: GetHistoricalBars

		public static BarSeries GetHistoricalBars(Instrument instrument, DateTime begin, DateTime end, BarType barType, long barSize)
		{
			SmartQuant.Instruments.Instrument instrument2 = Map.OQ_SQ_Instrument[instrument] as SmartQuant.Instruments.Instrument;
			if (barSize == 86400L)
			{
				return new BarSeries(SmartQuant.Instruments.DataManager.GetDailySeries(instrument2, begin, end));
			}
			return new BarSeries(SmartQuant.Instruments.DataManager.GetBarSeries(instrument2, begin, end, EnumConverter.Convert(barType), barSize));
		}
開發者ID:houzhongxu,項目名稱:OpenQuant.API,代碼行數:9,代碼來源:DataManager.cs

示例13: Contains

		public bool Contains(BarType barType, long barSize)
		{
			foreach (BarRequest barRequest in this.list)
			{
				if (barSize == barRequest.BarSize && barType == barRequest.BarType)
					return true;
			}
			return false;
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:9,代碼來源:BarRequestList.cs

示例14: Contains

		public bool Contains(BarType barType, long barSize)
		{
			if (!this.Enabled) return true;

			foreach (BarFilterItem item in this.Items)
			{
				if (item.BarType == barType && item.BarSize == barSize)
					return item.Enabled;
			}
			return false;
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:11,代碼來源:BarFilter.cs

示例15: SeriesNameToBarTypeSize

		private static bool SeriesNameToBarTypeSize(string name, out BarType barType, out long barSize)
		{
			barType = BarType.Range;
			barSize = -1L;
			string[] strArray = name.Split(new char[1]
			{
				'.'
			});
			if (strArray.Length >= 4 && strArray[strArray.Length - 3] == "Bar" && Enum.IsDefined(typeof(BarType), (object)strArray[strArray.Length - 2]))
			{
				barType = (BarType)Enum.Parse(typeof(BarType), strArray[strArray.Length - 2]);
				if (long.TryParse(strArray[strArray.Length - 1], out barSize))
					return true;
			}
			return false;
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:16,代碼來源:DataManager.cs


注:本文中的BarType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。