本文整理汇总了C#中Instrument.LoadResourceData方法的典型用法代码示例。如果您正苦于以下问题:C# Instrument.LoadResourceData方法的具体用法?C# Instrument.LoadResourceData怎么用?C# Instrument.LoadResourceData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instrument
的用法示例。
在下文中一共展示了Instrument.LoadResourceData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadDataFile
private void LoadDataFile()
{
// Makes an instance of class Instrument
var instrument = new Instrument(instrProperties, (int) period)
{
DataDir = Data.OfflineDataDir,
MaxBars = Configs.MaxBars,
StartTime = Configs.DataStartTime,
EndTime = Configs.DataEndTime,
UseStartTime = Configs.UseStartTime,
UseEndTime = Configs.UseEndTime
};
instrument.LoadResourceData(dataFile, period);
Data.InstrProperties = instrProperties.Clone();
Data.Bars = instrument.Bars;
Data.Period = period;
Data.Update = instrument.Update;
Data.Time = new DateTime[Data.Bars];
Data.Open = new double[Data.Bars];
Data.High = new double[Data.Bars];
Data.Low = new double[Data.Bars];
Data.Close = new double[Data.Bars];
Data.Volume = new int[Data.Bars];
for (int bar = 0; bar < Data.Bars; bar++)
{
Data.Open[bar] = instrument.Open(bar);
Data.High[bar] = instrument.High(bar);
Data.Low[bar] = instrument.Low(bar);
Data.Close[bar] = instrument.Close(bar);
Data.Time[bar] = instrument.Time(bar);
Data.Volume[bar] = instrument.Volume(bar);
}
Data.MinPrice = instrument.MinPrice;
Data.MaxPrice = instrument.MaxPrice;
Data.DaysOff = instrument.DaysOff;
Data.AverageGap = instrument.AverageGap;
Data.MaxGap = instrument.MaxGap;
Data.AverageHighLow = instrument.AverageHighLow;
Data.MaxHighLow = instrument.MaxHighLow;
Data.AverageCloseOpen = instrument.AverageCloseOpen;
Data.MaxCloseOpen = instrument.MaxCloseOpen;
Data.DataCut = instrument.Cut;
Data.IsIntrabarData = false;
Data.IsTickData = false;
Data.IsData = true;
Data.IsResult = false;
Data.GenerateMarketStats();
}