本文整理汇总了C#中HydraTaskSettings类的典型用法代码示例。如果您正苦于以下问题:C# HydraTaskSettings类的具体用法?C# HydraTaskSettings怎么用?C# HydraTaskSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HydraTaskSettings类属于命名空间,在下文中一共展示了HydraTaskSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new FinVizSettings(settings);
if (settings.IsDefault)
_settings.Interval = TimeSpan.FromDays(1);
}
示例2: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new OandaHistorySettings(settings);
if (settings.IsDefault)
{
_settings.Offset = 1;
_settings.StartFrom = new DateTime(1990, 1, 1);
_settings.Interval = TimeSpan.FromDays(1);
}
}
示例3: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new RtsCompetitionSettings(settings);
if (settings.IsDefault)
{
_settings.StartFrom = new DateTime(2006, 09, 15);
_settings.Interval = TimeSpan.FromDays(1);
_settings.Offset = 1;
_settings.IgnoreWeekends = true;
}
}
示例4: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new TrueFXSettings(settings);
if (settings.IsDefault)
{
_settings.DayOffset = 1;
_settings.StartFrom = new DateTime(2009, 5, 1);
_settings.Interval = TimeSpan.FromDays(1);
_settings.UseTemporaryFiles = TempFiles.UseAndDelete;
}
}
示例5: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new YahooSettings(settings);
if (settings.IsDefault)
{
_settings.DayOffset = 1;
_settings.StartFrom = new DateTime(2000, 1, 1);
_settings.Interval = TimeSpan.FromDays(1);
_settings.IgnoreWeekends = true;
}
}
示例6: InitTask
private void InitTask(IHydraTask task, HydraTaskSettings settings)
{
Core.Extensions.Tasks.Add(task);
task.Init(settings);
_logManager.Sources.Add(task);
task.DataLoaded += (security, dataType, arg, time, count) =>
{
if (dataType == typeof(NewsMessage))
{
LoadedNews += count;
return;
}
var allSecurity = _taskAllSecurities.SafeAdd(task, key => task.GetAllSecurity());
var taskSecurity = _taskSecurityCache.SafeAdd(task).SafeAdd(security, key => task.Settings.Securities.FirstOrDefault(s => s.Security == key));
HydraTaskSecurity.TypeInfo info;
HydraTaskSecurity.TypeInfo allInfo;
if (dataType == typeof(ExecutionMessage))
{
switch ((ExecutionTypes)arg)
{
case ExecutionTypes.Tick:
{
info = taskSecurity?.TradeInfo;
allInfo = allSecurity?.TradeInfo;
LoadedTrades += count;
break;
}
case ExecutionTypes.OrderLog:
{
info = taskSecurity?.OrderLogInfo;
allInfo = allSecurity?.OrderLogInfo;
LoadedOrderLog += count;
break;
}
case ExecutionTypes.Order:
case ExecutionTypes.Trade:
{
info = taskSecurity?.TransactionInfo;
allInfo = allSecurity?.TransactionInfo;
LoadedTransactions += count;
break;
}
default:
throw new ArgumentOutOfRangeException(nameof(arg));
}
}
else if (dataType == typeof(QuoteChangeMessage))
{
info = taskSecurity?.DepthInfo;
allInfo = allSecurity?.DepthInfo;
LoadedDepths += count;
}
else if (dataType == typeof(Level1ChangeMessage))
{
info = taskSecurity?.Level1Info;
allInfo = allSecurity?.Level1Info;
LoadedLevel1 += count;
}
else if (dataType.IsCandleMessage())
{
info = taskSecurity?.CandleInfo;
allInfo = allSecurity?.CandleInfo;
LoadedCandles += count;
}
else
throw new ArgumentOutOfRangeException(nameof(dataType), dataType, LocalizedStrings.Str1018);
if (allInfo != null)
{
allInfo.Count += count;
allInfo.LastTime = time.LocalDateTime;
task.Settings.Securities.Update(allSecurity);
}
if (info == null)
return;
info.Count += count;
info.LastTime = time.LocalDateTime;
task.Settings.Securities.Update(taskSecurity);
};
}
示例7: DukasCopySettings
public DukasCopySettings(HydraTaskSettings settings)
: base(settings)
{
ExtensionInfo.TryAdd("UseTemporaryFiles", TempFiles.UseAndDelete.To<string>());
}
示例8: ConvertTaskSettings
public ConvertTaskSettings(HydraTaskSettings settings)
: base(settings)
{
ExtensionInfo.TryAdd("DestinationStorageFormat", StorageFormats.Binary.To<string>());
ExtensionInfo.TryAdd("MarketDepthBuilder", OrderLogBuilders.Plaza2.To<string>());
}
示例9: MfdSettings
public MfdSettings(HydraTaskSettings settings)
: base(settings)
{
ExtensionInfo.TryAdd("CandleDayStep", 30);
}
示例10: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new UxFtpSettings(settings);
if (!settings.IsDefault)
return;
_settings.DayOffset = 3;
_settings.StartFrom = RtsHistorySource.UxMinAvaliableTime;
_settings.IsSystemOnly = true;
_settings.Interval = TimeSpan.FromDays(1);
_settings.IgnoreWeekends = true;
_settings.UseTemporaryFiles = TempFiles.UseAndDelete;
}
示例11: ConvertTaskSettings
public ConvertTaskSettings(HydraTaskSettings settings)
: base(settings)
{
}
示例12: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new AlorHistorySettings(settings);
if (settings.IsDefault)
{
_settings.Offset = 1;
_settings.StartFrom = new DateTime(2001, 1, 1);
_settings.Interval = TimeSpan.FromDays(1);
_settings.IgnoreWeekends = true;
_settings.UseTemporaryFiles = TempFiles.UseAndDelete;
}
}
示例13: QuandlSettings
public QuandlSettings(HydraTaskSettings settings)
: base(settings)
{
}
示例14: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new QuandlSettings(settings);
if (_settings.IsDefault)
{
_settings.DayOffset = 1;
_settings.StartFrom = new DateTime(1980, 1, 1);
_settings.Interval = TimeSpan.FromDays(1);
_settings.IgnoreWeekends = true;
_settings.AuthToken = new SecureString();
_settings.UseTemporaryFiles = TempFiles.UseAndDelete;
}
_quandlSecurityStorage = new QuandlSecurityStorage(EntityRegistry);
}
示例15: ApplySettings
protected override void ApplySettings(HydraTaskSettings settings)
{
_settings = new RtsSettings(settings);
if (settings.IsDefault)
{
_settings.DayOffset = 3;
_settings.StartFrom = RtsHistorySource.RtsMinAvaliableTime;
_settings.UsdRurStartFrom = FortsDailyData.UsdRateMinAvailableTime;
_settings.IsDownloadUsdRate = true;
//_settings.UsdRateLastDate = FortsDailyData.UsdRateMinAvailableTime;
_settings.IsSystemOnly = true;
_settings.LoadEveningSession = false;
_settings.SaveRtsStdTrades = false;
_settings.SaveRtsStdCombinedOnly = false;
_settings.Interval = TimeSpan.FromDays(1);
_settings.IgnoreWeekends = true;
_settings.UseTemporaryFiles = TempFiles.UseAndDelete;
}
}