本文整理汇总了C#中BarSeries.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BarSeries.Add方法的具体用法?C# BarSeries.Add怎么用?C# BarSeries.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BarSeries
的用法示例。
在下文中一共展示了BarSeries.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compress
public BarSeries Compress(DataEntryEnumerator enumerator)
{
BarSeries series = new BarSeries();
this.NewCompressedBar += delegate(object sender, CompressedBarEventArgs args)
{
series.Add(args.Bar);
};
while (enumerator.MoveNext())
{
this.Add(enumerator.Current);
}
this.Flush();
return series;
}
示例2: GetHistoricalBars
public BarSeries GetHistoricalBars(IHistoricalDataProvider provider, Instrument instrument, DateTime dateTime1, DateTime dateTime2, BarType barType, long barSize)
{
if (provider.IsDisconnected)
provider.Connect();
DataManager.DataNotifier @class = new DataManager.DataNotifier();
string text = Guid.NewGuid().ToString();
lock (this.dictionary_0)
{
this.dictionary_0.Add(text, @class);
}
provider.Send(new HistoricalDataRequest(instrument, dateTime1, dateTime2, 6)
{
RequestId = text,
BarType = new BarType?(barType),
BarSize = new long?(barSize)
});
@class.ReadyEvent.WaitOne();
lock (this.dictionary_0)
{
this.dictionary_0.Remove(text);
}
var bs = new BarSeries("", "", -1, -1);
foreach (var data in @class.Data)
{
var objs = data.Objects;
for (int i = 0; i < objs.Length; i++)
bs.Add((Bar)objs[i]);
}
return bs;
}
示例3: GetRange
///<summary>
/// Returns bars from within specified dates interval
///</summary>
public BarSeries GetRange(DateTime dateTime1, DateTime dateTime2)
{
BarSeries barSeries = new BarSeries();
int index1 = this.series.GetIndex(dateTime1, EIndexOption.Next);
int index2 = this.series.GetIndex(dateTime1, EIndexOption.Prev);
if (index1 != -1 && index2 != -1)
{
for (int index3 = index1; index3 <= index2; ++index3)
barSeries.Add(new Bar(this.series[index3]));
}
return barSeries;
}