Lean
$LEAN_TAG$
|
Provides methods for generating lean data file content More...
Static Public Member Functions | |
static string | GenerateLine (IBaseData data, Resolution resolution, DateTimeZone exchangeTimeZone, DateTimeZone dataTimeZone) |
Converts the specified base data instance into a lean data file csv line. This method takes into account the fake that base data instances typically are time stamped in the exchange time zone, but need to be written to disk in the data time zone. More... | |
static DateTime | ParseTime (string line, DateTime date, Resolution resolution) |
Helper method that will parse a given data line in search of an associated date time More... | |
static string | GenerateLine (IBaseData data, SecurityType securityType, Resolution resolution) |
Converts the specified base data instance into a lean data file csv line More... | |
static Type | GetDataType (Resolution resolution, TickType tickType) |
Gets the data type required for the specified combination of resolution and tick type More... | |
static bool | IsCommonLeanDataType (Type baseDataType) |
Determines if the Type is a 'common' type used throughout lean This method is helpful in creating SubscriptionDataConfig More... | |
static bool | IsValidConfiguration (SecurityType securityType, Resolution resolution, TickType tickType) |
Helper method to determine if a configuration set is valid More... | |
static string | GenerateZipFilePath (string dataDirectory, Symbol symbol, DateTime date, Resolution resolution, TickType tickType) |
Generates the full zip file path rooted in the dataDirectory More... | |
static string | GenerateZipFilePath (string dataDirectory, string symbol, SecurityType securityType, string market, DateTime date, Resolution resolution) |
Generates the full zip file path rooted in the dataDirectory More... | |
static string | GenerateRelativeZipFileDirectory (Symbol symbol, Resolution resolution) |
Generates the relative zip directory for the specified symbol/resolution More... | |
static string | GenerateRelativeFactorFilePath (Symbol symbol) |
Generates relative factor file paths for equities More... | |
static string | GenerateRelativeZipFilePath (Symbol symbol, DateTime date, Resolution resolution, TickType tickType) |
Generates the relative zip file path rooted in the /Data directory More... | |
static string | GenerateRelativeZipFilePath (string symbol, SecurityType securityType, string market, DateTime date, Resolution resolution) |
Generates the relative zip file path rooted in the /Data directory More... | |
static string | GenerateZipEntryName (Symbol symbol, DateTime date, Resolution resolution, TickType tickType) |
Generate's the zip entry name to hold the specified data. More... | |
static string | GenerateZipFileName (Symbol symbol, DateTime date, Resolution resolution, TickType tickType) |
Generates the zip file name for the specified date of data. More... | |
static string | GenerateZipFileName (string symbol, SecurityType securityType, DateTime date, Resolution resolution, TickType? tickType=null) |
Creates the zip file name for a QC zip data file More... | |
static TickType | GetCommonTickType (SecurityType securityType) |
Gets the tick type most commonly associated with the specified security type More... | |
static Symbol | ReadSymbolFromZipEntry (Symbol symbol, Resolution resolution, string zipEntryName) |
Creates a symbol from the specified zip entry name More... | |
static TickType | GetCommonTickTypeForCommonDataTypes (Type type, SecurityType securityType) |
Get the TickType for common Lean data types. If not a Lean common data type, return a TickType of Trade. More... | |
static SecurityType | ParseDataSecurityType (string securityType) |
Matches a data path security type with the SecurityType More... | |
static bool | TryParseSecurityType (string fileName, out SecurityType securityType, out string market) |
Parses file name into a Security and DateTime More... | |
static bool | TryParsePath (string filePath, out Symbol symbol, out DateTime date, out Resolution resolution, out TickType tickType, out Type dataType) |
Parses file name into a Security and DateTime More... | |
static bool | TryParsePath (string fileName, out Symbol symbol, out DateTime date, out Resolution resolution) |
Parses file name into a Security and DateTime More... | |
static IEnumerable< TradeBar > | AggregateTradeBars (IEnumerable< TradeBar > bars, Symbol symbol, TimeSpan resolution) |
Aggregates a list of second/minute bars at the requested resolution More... | |
static IEnumerable< QuoteBar > | AggregateQuoteBars (IEnumerable< QuoteBar > bars, Symbol symbol, TimeSpan resolution) |
Aggregates a list of second/minute bars at the requested resolution More... | |
static IEnumerable< QuoteBar > | AggregateTicks (IEnumerable< Tick > ticks, Symbol symbol, TimeSpan resolution) |
Aggregates a list of ticks at the requested resolution More... | |
static IEnumerable< TradeBar > | AggregateTicksToTradeBars (IEnumerable< Tick > ticks, Symbol symbol, TimeSpan resolution) |
Aggregates a list of ticks at the requested resolution More... | |
static void | ParseKey (string key, out string fileName, out string entryName) |
Helper to separate filename and entry from a given key for DataProviders More... | |
Static Public Attributes | |
static HashSet< string > | SecurityTypeAsDataPath |
The different SecurityType used for data paths More... | |
Provides methods for generating lean data file content
Definition at line 38 of file LeanData.cs.
|
static |
Converts the specified base data instance into a lean data file csv line. This method takes into account the fake that base data instances typically are time stamped in the exchange time zone, but need to be written to disk in the data time zone.
Definition at line 53 of file LeanData.cs.
|
static |
Helper method that will parse a given data line in search of an associated date time
Definition at line 63 of file LeanData.cs.
|
static |
Converts the specified base data instance into a lean data file csv line
Definition at line 83 of file LeanData.cs.
|
static |
Gets the data type required for the specified combination of resolution and tick type
resolution | The resolution, if Tick, the Type returned is always Tick |
tickType | The TickType that primarily dictates the type returned |
Definition at line 481 of file LeanData.cs.
|
static |
Determines if the Type is a 'common' type used throughout lean This method is helpful in creating SubscriptionDataConfig
baseDataType | The Type to check |
Definition at line 497 of file LeanData.cs.
|
static |
Helper method to determine if a configuration set is valid
Definition at line 513 of file LeanData.cs.
|
static |
Generates the full zip file path rooted in the dataDirectory
Definition at line 525 of file LeanData.cs.
|
static |
Generates the full zip file path rooted in the dataDirectory
Definition at line 534 of file LeanData.cs.
|
static |
Generates the relative zip directory for the specified symbol/resolution
Definition at line 542 of file LeanData.cs.
|
static |
Generates relative factor file paths for equities
Definition at line 590 of file LeanData.cs.
|
static |
Generates the relative zip file path rooted in the /Data directory
Definition at line 602 of file LeanData.cs.
|
static |
Generates the relative zip file path rooted in the /Data directory
Definition at line 610 of file LeanData.cs.
|
static |
Generate's the zip entry name to hold the specified data.
Definition at line 624 of file LeanData.cs.
|
static |
Generates the zip file name for the specified date of data.
Definition at line 750 of file LeanData.cs.
|
static |
Creates the zip file name for a QC zip data file
Definition at line 815 of file LeanData.cs.
|
static |
Gets the tick type most commonly associated with the specified security type
securityType | The security type |
Definition at line 844 of file LeanData.cs.
|
static |
Creates a symbol from the specified zip entry name
symbol | The root symbol of the output symbol |
resolution | The resolution of the data source producing the zip entry name |
zipEntryName | The zip entry name to be parsed |
Definition at line 860 of file LeanData.cs.
|
static |
Get the TickType for common Lean data types. If not a Lean common data type, return a TickType of Trade.
type | A Type used to determine the TickType |
securityType | The SecurityType used to determine the TickType |
Definition at line 970 of file LeanData.cs.
|
static |
Matches a data path security type with the SecurityType
This includes 'alternative'
securityType | The data path security type |
Definition at line 1002 of file LeanData.cs.
|
static |
Parses file name into a Security and DateTime
fileName | File name to be parsed |
securityType | The securityType as parsed from the fileName |
market | The market as parsed from the fileName |
Definition at line 1017 of file LeanData.cs.
|
static |
Parses file name into a Security and DateTime
filePath | File path to be parsed |
symbol | The symbol as parsed from the fileName |
date | Date of data in the file path. Only returned if the resolution is lower than Hourly |
resolution | The resolution of the symbol as parsed from the filePath |
tickType | The tick type |
dataType | The data type |
Definition at line 1055 of file LeanData.cs.
|
static |
Parses file name into a Security and DateTime
fileName | File name to be parsed |
symbol | The symbol as parsed from the fileName |
date | Date of data in the file path. Only returned if the resolution is lower than Hourly |
resolution | The resolution of the symbol as parsed from the filePath |
Definition at line 1103 of file LeanData.cs.
|
static |
Aggregates a list of second/minute bars at the requested resolution
bars | List of TradeBars |
symbol | Symbol of all tradeBars |
resolution | Desired resolution for new TradeBars |
Definition at line 1285 of file LeanData.cs.
|
static |
Aggregates a list of second/minute bars at the requested resolution
bars | List of QuoteBars |
symbol | Symbol of all QuoteBars |
resolution | Desired resolution for new QuoteBars |
Definition at line 1297 of file LeanData.cs.
|
static |
Aggregates a list of ticks at the requested resolution
ticks | List of quote ticks |
symbol | Symbol of all ticks |
resolution | Desired resolution for new QuoteBars |
Definition at line 1309 of file LeanData.cs.
|
static |
Aggregates a list of ticks at the requested resolution
ticks | List of trade ticks |
symbol | Symbol of all ticks |
resolution | Desired resolution for new TradeBars |
Definition at line 1321 of file LeanData.cs.
|
static |
Helper to separate filename and entry from a given key for DataProviders
key | The key to parse |
fileName | File name extracted |
entryName | Entry name extracted |
Definition at line 1332 of file LeanData.cs.
|
static |
The different SecurityType used for data paths
This includes 'alternative'
Definition at line 44 of file LeanData.cs.