本文整理汇总了C#中TickType类的典型用法代码示例。如果您正苦于以下问题:C# TickType类的具体用法?C# TickType怎么用?C# TickType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TickType类属于命名空间,在下文中一共展示了TickType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TickPriceEventArgs
/// <summary>
/// Full Constructor
/// </summary>
/// <param name="tickerId">The ticker Id that was specified previously in the call to reqMktData().</param>
/// <param name="tickType">Specifies the type of price.</param>
/// <param name="price">Specifies the price for the specified field.</param>
/// <param name="canAutoExecute">specifies whether the price tick is available for automatic execution.</param>
public TickPriceEventArgs(int tickerId, TickType tickType, decimal price, bool canAutoExecute)
{
this.tickerId = tickerId;
this.canAutoExecute = canAutoExecute;
this.price = price;
this.tickType = tickType;
}
开发者ID:sansong,项目名称:RightEdgePlugins,代码行数:14,代码来源:TickPriceEventArgs.cs
示例2: CsvDataProcessor
/// <summary>
/// Initializes a new instance of the <see cref="CsvDataProcessor"/> class
/// </summary>
/// <param name="dataDirectory">The root data directory, /Data</param>
/// <param name="resolution">The resolution being sent into the Process method</param>
/// <param name="tickType">The tick type, trade or quote</param>
public CsvDataProcessor(string dataDirectory, Resolution resolution, TickType tickType)
{
_dataDirectory = dataDirectory;
_resolution = resolution;
_tickType = tickType;
_writers = new Dictionary<Symbol, Writer>();
}
开发者ID:AlexCatarino,项目名称:Lean,代码行数:13,代码来源:CsvDataProcessor.cs
示例3: TickOptionComputationEventArgs
/// <summary>
/// Full Constructor
/// </summary>
/// <param name="tickerId">The ticker Id that was specified previously in the call to reqMktData().</param>
/// <param name="tickType">Specifies the type of option computation.</param>
/// <param name="impliedVol">The implied volatility calculated by the TWS option modeler, using the specificed ticktype value.</param>
/// <param name="delta">The option delta calculated by the TWS option modeler.</param>
/// <param name="modelPrice">The model price.</param>
/// <param name="pvDividend">Present value of dividends expected on the option’s underlier.</param>
public TickOptionComputationEventArgs(int tickerId, TickType tickType, double impliedVol, double delta,
double modelPrice, double pvDividend)
{
this.tickerId = tickerId;
this.pvDividend = pvDividend;
this.delta = delta;
this.modelPrice = modelPrice;
this.impliedVol = impliedVol;
this.tickType = tickType;
}
开发者ID:sansong,项目名称:RightEdgePlugins,代码行数:19,代码来源:TickOptionComputationEventArgs.cs
示例4: LeanDataPathComponents
/// <summary>
/// Initializes a new instance of the <see cref="LeanDataPathComponents"/> class
/// </summary>
public LeanDataPathComponents(SecurityType securityType, string market, Resolution resolution, Symbol symbol, string filename, DateTime date, TickType tickType)
{
Date = date;
SecurityType = securityType;
Market = market;
Resolution = resolution;
Filename = filename;
Symbol = symbol;
TickType = tickType;
}
开发者ID:AlexCatarino,项目名称:Lean,代码行数:13,代码来源:LeanDataPathComponents.cs
示例5: Tick
// In Base Class: Last Trade Tick:
//public decimal Price = 0;
// In Base Class: Ticker String Symbol of the Asset
//public string Symbol = "";
// In Base Class: DateTime of this SnapShot
//public DateTime Time = new DateTime();
/********************************************************
* CLASS CONSTRUCTORS
*********************************************************/
/// <summary>
/// Initialize Tick Class
/// </summary>
public Tick()
{
base.Value = 0;
base.Time = new DateTime();
base.DataType = MarketDataType.Tick;
base.Symbol = "";
TickType = TickType.Trade;
Quantity = 0;
Exchange = "";
SaleCondition = "";
Suspicious = false;
}
开发者ID:nagyist,项目名称:QuantConnect-QCAlgorithm,代码行数:24,代码来源:Tick.cs
示例6: Tick
/********************************************************
* CLASS CONSTRUCTORS
*********************************************************/
/// <summary>
/// Initialize Tick Class
/// </summary>
public Tick()
{
Price = 0;
Type = MarketDataType.Tick;
Time = new DateTime();
TickType = TickType.Trade;
Quantity = 0;
Exchange = "";
SaleCondition = "";
Suspicious = false;
DataType = DataType.MarketData;
Symbol = "";
}
开发者ID:vdt,项目名称:QCAlgorithm,代码行数:19,代码来源:Tick.cs
示例7: TickOptionComputationEventArgs
/// <summary>
/// Full Constructor
/// </summary>
/// <param name="tickerId">The ticker Id that was specified previously in the call to reqMktData().</param>
/// <param name="tickType">Specifies the type of option computation.</param>
/// <param name="impliedVol">The implied volatility calculated by the TWS option modeler, using the specificed ticktype value.</param>
/// <param name="delta">The option delta calculated by the TWS option modeler.</param>
/// <param name="optionPrice">The model price.</param>
/// <param name="pvDividend">Present value of dividends expected on the option’s underlier.</param>
/// <param name="gamma">Gamma</param>
/// <param name="vega">Vega</param>
/// <param name="theta">Theta</param>
/// <param name="undPrice">Underlying Price</param>
public TickOptionComputationEventArgs(int tickerId, TickType tickType, double impliedVol, double delta, double optionPrice, double pvDividend, double gamma, double vega, double theta, double undPrice)
{
this.tickerId = tickerId;
this.pvDividend = pvDividend;
this.delta = delta;
this.optionPrice = optionPrice;
this.impliedVol = impliedVol;
this.tickType = tickType;
this.gamma = gamma;
this.vega = vega;
this.theta = theta;
this.underlyingPrice = undPrice;
}
开发者ID:yixin-xie,项目名称:ib-csharp,代码行数:26,代码来源:TickOptionComputationEventArgs.cs
示例8: Arguments
public Arguments(Symbol symbol, DateTime date, Resolution resolution, string market, TickType tickType)
{
Symbol = symbol;
Date = date;
Resolution = resolution;
TickType = tickType;
Market = market;
if (symbol.ID.SecurityType != SecurityType.Option && (resolution == Resolution.Hour || resolution == Resolution.Daily))
{
// for the time being this is true, eventually I'm sure we'd like to support hourly/daily quote data in other security types
TickType = TickType.Trade;
}
}
开发者ID:AlexCatarino,项目名称:Lean,代码行数:13,代码来源:LeanDataPathComponentsTests.cs
示例9: TickEfpEventArgs
/// <summary>
/// Full Constructor
/// </summary>
/// <param name="tickerId">The ticker Id that was specified previously in the call to reqMktData().</param>
/// <param name="tickType">Specifies the type of price.</param>
/// <param name="basisPoints">Annualized basis points, which is representative of the
/// financing rate that can be directly compared to broker rates.</param>
/// <param name="formattedBasisPoints">Annualized basis points as a formatted string that depicts them in percentage form.</param>
/// <param name="impliedFuture">Implied futures price.</param>
/// <param name="holdDays">Number of “hold days” until the expiry of the EFP.</param>
/// <param name="futureExpiry">Expiration date of the single stock future.</param>
/// <param name="dividendImpact">The “dividend impact” upon the annualized basis points interest rate.</param>
/// <param name="dividendsToExpiry">The dividends expected until the expiration of the single stock future.</param>
public TickEfpEventArgs(int tickerId, TickType tickType, double basisPoints, string formattedBasisPoints,
double impliedFuture, int holdDays, string futureExpiry, double dividendImpact,
double dividendsToExpiry)
{
this.tickerId = tickerId;
this.dividendsToExpiry = dividendsToExpiry;
this.dividendImpact = dividendImpact;
this.futureExpiry = futureExpiry;
this.holdDays = holdDays;
this.impliedFuture = impliedFuture;
this.formattedBasisPoints = formattedBasisPoints;
this.basisPoints = basisPoints;
this.tickType = tickType;
}
开发者ID:sansong,项目名称:RightEdgePlugins,代码行数:27,代码来源:TickEFPEventArgs.cs
示例10: CreateZipEntryName
/// <summary>
/// Creates the entry name for a QC zip data file
/// </summary>
public static string CreateZipEntryName(string symbol, SecurityType securityType, DateTime date, Resolution resolution, TickType dataType = TickType.Trade)
{
symbol = symbol.ToLower();
if (resolution == Resolution.Hour || resolution == Resolution.Daily)
{
return symbol + ".csv";
}
//All fx is quote data.
if (securityType == SecurityType.Forex) dataType = TickType.Quote;
return String.Format("{0}_{1}_{2}_{3}.csv", date.ToString(DateFormat.EightCharacter), symbol, resolution.ToString().ToLower(), dataType.ToString().ToLower());
}
开发者ID:reinhardtken,项目名称:Lean,代码行数:17,代码来源:Compression.cs
示例11: LeanDataWriter
/// <summary>
/// Create a new lean data writer to this base data directory.
/// </summary>
/// <param name="symbol">Symbol string</param>
/// <param name="dataDirectory">Base data directory</param>
/// <param name="resolution">Resolution of the desired output data</param>
/// <param name="dataType">Write the data to trade files</param>
public LeanDataWriter(Resolution resolution, Symbol symbol, string dataDirectory, TickType dataType = TickType.Trade)
{
_securityType = symbol.ID.SecurityType;
_dataDirectory = dataDirectory;
_resolution = resolution;
_symbol = symbol;
_market = symbol.ID.Market.ToLower();
_dataType = dataType;
// All fx data is quote data.
if (_securityType == SecurityType.Forex || _securityType == SecurityType.Cfd)
{
_dataType = TickType.Quote;
}
// Can only process Fx and equity for now
if (_securityType != SecurityType.Equity && _securityType != SecurityType.Forex && _securityType != SecurityType.Cfd)
{
throw new Exception("Sorry this security type is not yet supported by the LEAN data writer: " + _securityType);
}
}
开发者ID:neosb,项目名称:Lean,代码行数:28,代码来源:LeanDataWriter.cs
示例12: GetDataType
private Type GetDataType(SecurityType securityType, Resolution resolution, TickType tickType)
{
if (resolution == Resolution.Tick)
{
return typeof (Tick);
}
switch (securityType)
{
case SecurityType.Base:
case SecurityType.Equity:
case SecurityType.Cfd:
case SecurityType.Forex:
return typeof (TradeBar);
case SecurityType.Option:
if (tickType == TickType.Trade) return typeof (TradeBar);
if (tickType == TickType.Quote) return typeof (QuoteBar);
break;
}
var parameters = string.Join(" | ", securityType, resolution, tickType);
throw new NotImplementedException("LeanParser.GetDataType does has not yet implemented: " + parameters);
}
开发者ID:AlexCatarino,项目名称:Lean,代码行数:23,代码来源:LeanParser.cs
示例13: Zip
/// <summary>
/// Creates a data processor that will aggregate and zip the requested resolutions of data
/// </summary>
public static IDataProcessor Zip(string dataDirectory, IEnumerable<Resolution> resolutions, TickType tickType, bool sourceIsTick)
{
var set = resolutions.ToHashSet();
var root = new PipeDataProcessor();
// only filter tick sources
var stack = !sourceIsTick ? root
: (IDataProcessor) new FilteredDataProcessor(root, x => ((Tick) x).TickType == tickType);
if (set.Contains(Resolution.Tick))
{
// tick is filtered via trade/quote
var tick = new CsvDataProcessor(dataDirectory, Resolution.Tick, tickType);
root.PipeTo(tick);
}
if (set.Contains(Resolution.Second))
{
root = AddResolution(dataDirectory, tickType, root, Resolution.Second, sourceIsTick);
sourceIsTick = false;
}
if (set.Contains(Resolution.Minute))
{
root = AddResolution(dataDirectory, tickType, root, Resolution.Minute, sourceIsTick);
sourceIsTick = false;
}
if (set.Contains(Resolution.Hour))
{
root = AddResolution(dataDirectory, tickType, root, Resolution.Hour, sourceIsTick);
sourceIsTick = false;
}
if (set.Contains(Resolution.Daily))
{
AddResolution(dataDirectory, tickType, root, Resolution.Daily, sourceIsTick);
}
return stack;
}
开发者ID:kaffeebrauer,项目名称:Lean,代码行数:40,代码来源:IDataProcessor.cs
示例14: Tick
/// <summary>
/// Constructor for QuantConnect FXCM Data source:
/// </summary>
/// <param name="symbol">Symbol for underlying asset</param>
/// <param name="line">CSV line of data from FXCM</param>
public Tick(string symbol, string line)
{
var csv = line.Split(',');
DataType = MarketDataType.Tick;
Symbol = symbol;
Time = DateTime.ParseExact(csv[0], DateFormat.Forex, CultureInfo.InvariantCulture);
Value = (BidPrice + AskPrice) / 2;
TickType = TickType.Quote;
BidPrice = Convert.ToDecimal(csv[1], CultureInfo.InvariantCulture);
AskPrice = Convert.ToDecimal(csv[2], CultureInfo.InvariantCulture);
}
开发者ID:rchien,项目名称:Lean,代码行数:16,代码来源:Tick.cs
示例15: Tick
//In Base Class: Alias of Closing:
//public decimal Price;
//Symbol of Asset.
//In Base Class: public Symbol Symbol;
//In Base Class: DateTime Of this TradeBar
//public DateTime Time;
/// <summary>
/// Initialize tick class with a default constructor.
/// </summary>
public Tick()
{
Value = 0;
Time = new DateTime();
DataType = MarketDataType.Tick;
Symbol = Symbol.Empty;
TickType = TickType.Trade;
Quantity = 0;
Exchange = "";
SaleCondition = "";
Suspicious = false;
BidSize = 0;
AskSize = 0;
}
开发者ID:pmerrill,项目名称:Lean,代码行数:26,代码来源:Tick.cs
示例16: GenerateZipEntryName
/// <summary>
/// Creates the entry name for a QC zip data file
/// </summary>
public static string GenerateZipEntryName(string symbol, SecurityType securityType, DateTime date, Resolution resolution, TickType dataType = TickType.Trade)
{
if (securityType != SecurityType.Base && securityType != SecurityType.Equity && securityType != SecurityType.Forex && securityType != SecurityType.Cfd)
{
throw new NotImplementedException("This method only implements base, equity, forex and cfd security type.");
}
symbol = symbol.ToLower();
if (resolution == Resolution.Hour || resolution == Resolution.Daily)
{
return symbol + ".csv";
}
//All fx is quote data.
if (securityType == SecurityType.Forex || securityType == SecurityType.Cfd)
{
dataType = TickType.Quote;
}
return string.Format("{0}_{1}_{2}_{3}.csv", date.ToString(DateFormat.EightCharacter), symbol, resolution.ToLower(), dataType.ToLower());
}
开发者ID:aajtodd,项目名称:Lean,代码行数:25,代码来源:LeanData.cs
示例17: GenerateRelativeZipFilePath
/// <summary>
/// Generates the relative zip file path rooted in the /Data directory
/// </summary>
public static string GenerateRelativeZipFilePath(Symbol symbol, DateTime date, Resolution resolution, TickType tickType)
{
return Path.Combine(GenerateRelativeZipFileDirectory(symbol, resolution), GenerateZipFileName(symbol, date, resolution, tickType));
}
开发者ID:aajtodd,项目名称:Lean,代码行数:7,代码来源:LeanData.cs
示例18: TickStringEventArgs
/// <summary>
/// Free Constructor
/// </summary>
/// <param name="tickerId">The ticker Id that was specified previously in the call to reqMktData().</param>
/// <param name="tickType">Specifies the type of price.</param>
/// <param name="value">The value of the specified field.</param>
public TickStringEventArgs(int tickerId, TickType tickType, string value)
{
this.tickerId = tickerId;
this.value = value;
this.tickType = tickType;
}
开发者ID:yixin-xie,项目名称:ib-csharp,代码行数:12,代码来源:TickStringEventArgs.cs
示例19: TickGenericEventArgs
/// <summary>
/// Full Constructor
/// </summary>
/// <param name="tickerId">The ticker Id that was specified previously in the call to reqMktData().</param>
/// <param name="tickType">Specifies the type of price.</param>
/// <param name="value">The value of the specified field.</param>
public TickGenericEventArgs(int tickerId, TickType tickType, double value)
{
this.tickerId = tickerId;
this.value = value;
this.tickType = tickType;
}
开发者ID:yixin-xie,项目名称:ib-csharp,代码行数:12,代码来源:TickGenericEventArgs.cs
示例20: GenerateZipFileName
/// <summary>
/// Creates the zip file name for a QC zip data file
/// </summary>
public static string GenerateZipFileName(string symbol, SecurityType securityType, DateTime date, Resolution resolution, TickType? tickType = null)
{
if (resolution == Resolution.Hour || resolution == Resolution.Daily)
{
return symbol.ToLower() + ".zip";
}
var zipFileName = date.ToString(DateFormat.EightCharacter);
tickType = tickType ?? (securityType == SecurityType.Forex || securityType == SecurityType.Cfd ? TickType.Quote : TickType.Trade);
var suffix = string.Format("_{0}.zip", tickType.Value.ToLower());
return zipFileName + suffix;
}
开发者ID:aajtodd,项目名称:Lean,代码行数:15,代码来源:LeanData.cs
注:本文中的TickType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论