本文整理汇总了C#中BarType类的典型用法代码示例。如果您正苦于以下问题:C# BarType类的具体用法?C# BarType怎么用?C# BarType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BarType类属于命名空间,在下文中一共展示了BarType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: BarSeries
public BarSeries this [Instrument instrument, BarType barType, long barSize]
{
get
{
if (this.MSDWvxa7A1)
{
Hashtable hashtable = this.JqsWcXm11r(instrument, barType);
BarSeries barSeries = hashtable[barSize] as BarSeries;
if (barSeries == null)
{
barSeries = new BarSeries(string.Format("{0}-{1}-{2}", instrument.Symbol, barType, barSize));
hashtable.Add(barSize, barSeries);
if (this.BarSeriesAdded != null)
this.BarSeriesAdded(this, new BarSeriesEventArgs(barSeries, instrument));
}
return barSeries;
}
else
{
this.barType = barType;
this.barSize = barSize;
Hashtable hashtable = new Hashtable(this.listByIntrument);
foreach (DictionaryEntry entry in this.listByIntrument)
{
Instrument instrument1 = entry.Key as Instrument;
BarSeries barSeries = entry.Value as BarSeries;
barSeries.Name = string.Format("{0}", instrument1.Symbol, barType, barSize);
this.JqsWcXm11r(instrument1, barType).Add(barSize, barSeries);
}
this.listByIntrument.Clear();
this.MSDWvxa7A1 = true;
BarSeries barSeries1 = this[instrument, barType, barSize];
foreach (DictionaryEntry dictionaryEntry in hashtable)
{
if (this.BarSeriesRenamed != null)
this.BarSeriesRenamed(this, new BarSeriesEventArgs(dictionaryEntry.Value as BarSeries, dictionaryEntry.Key as Instrument));
}
return barSeries1;
}
}
}
开发者ID:heber,项目名称:FreeOQ,代码行数:41,代码来源:BarSeriesList.cs
示例17: Convert
public static string Convert(byte dataType, BarType? barType = null, long? barSize = null)
{
switch (dataType)
{
case 2:
return "Bid";
case 3:
return "Ask";
case 4:
return "Trade";
case 5:
return "Quote";
case 6:
if (!barType.HasValue)
return "Bar";
if (!barSize.HasValue)
return string.Format("Bar {0}", (object) barType.Value);
return string.Format("Bar {0} {1}", (object) barType.Value, (object) barSize.Value);
default:
return string.Format("DataType #{0}", (object) dataType);
}
}
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:22,代码来源:DataTypeConverter.cs
示例18: GetCompressor
public static BarCompressor GetCompressor(BarType barType, long oldBarSize, long newBarSize)
{
BarCompressor barCompressor;
switch (barType)
{
case BarType.Time:
barCompressor = new TimeBarCompressor();
break;
case BarType.Tick:
barCompressor = new TickBarCompressor();
break;
case BarType.Volume:
barCompressor = new VolumeBarCompressor();
break;
case BarType.Range:
barCompressor = new RangeBarCompressor();
break;
default:
throw new ArgumentException(string.Format("Unknown bar type - {0}", barType));
}
barCompressor.oldBarSize = oldBarSize;
barCompressor.newBarSize = newBarSize;
return barCompressor;
}
开发者ID:heber,项目名称:FreeOQ,代码行数:24,代码来源:BarCompressor.cs
示例19: GetBarSeries
public static BarSeries GetBarSeries(Instrument instrument, DateTime datetime1, DateTime datetime2, BarType barType, long barSize)
{
string suffix = string.Format("{0}{1}{2}{3}{4}", SUFFIX_BAR, SERIES_SEPARATOR, barType, SERIES_SEPARATOR, barSize);
return DataManager.GetBarSeries(instrument, suffix, datetime1, datetime2);
}
开发者ID:heber,项目名称:FreeOQ,代码行数:5,代码来源:DataManager.cs
示例20: Init
public static void Init()
{
if (DataManager.initialized)
return;
ProviderManager.NewQuote += new QuoteEventHandler(DataManager.OnNewQuote);
ProviderManager.NewTrade += new TradeEventHandler(DataManager.OnNewTrade);
ProviderManager.NewBar += new BarEventHandler(DataManager.OnNewBar);
ProviderManager.NewBarOpen += new BarEventHandler(DataManager.OnNewBarOpen);
ProviderManager.NewMarketDepth += new MarketDepthEventHandler(DataManager.OnNewMarketDepth);
ProviderManager.NewFundamental += new FundamentalEventHandler(DataManager.OnNewFundamental);
ProviderManager.NewCorporateAction += new CorporateActionEventHandler(DataManager.OnNewCorporateAction);
ProviderManager.MarketDataRequestReject += new MarketDataRequestRejectEventHandler(DataManager.OnMarketDataRequestReject);
ProviderManager.Connected += new ProviderEventHandler(DataManager.a9pwYGI8t);
DataManager.barArrayLength = -1;
DataManager.tradeArrayLength = -1;
DataManager.quoteArrayLength = -1;
DataManager.fundamentalArrayLength = -1;
DataManager.corporateActionArrayLength = -1;
DataManager.defaultBarType = BarType.Time; // DataManager.TrxWldYDwK = BarType.Time;
DataManager.defaultBarSize = 60; // DataManager.AK2WYmbanY
DataManager.Load();
DataManager.initialized = true;
}
开发者ID:heber,项目名称:FreeOQ,代码行数:24,代码来源:DataManager.cs
注:本文中的BarType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论