Commit Graph

15 Commits

Author SHA1 Message Date
Martin Molinero 08b72c5907 Overall performance improvements v2
- Adding `LazyToUpper()` implementation, that will avoid the call to
`ToUpper` if the string is already upper.
- Reduce the timezone conversions at `Time.EachTradeableDayInTimeZone`
- `TotalPortfolioValue` will iterate over all securities once
- Adding new `SecurityIdentifier` cache, significant impact for
algorithms using coarse/fine data
2019-06-05 17:06:59 -03:00
Jared cd80c70775 Merge pull request #2868 from gsalaz98/feature-2859-rdg-delistings-mappings-splits-dividends-generator
RandomDataGenerator Mapping, Delisting, Splits, and Dividends Generator
2019-05-14 15:46:24 -07:00
Martin Molinero c39638668c Overall performance improvements
- `FactorFile` will keep an ordered reversed list with the dates.
Calling `Reverse()` on the `SortedList` is expensive.
- `MapFiles` will keep first and last date, so we don't need to call
`First()` and `Last()` multiple times.
- `Liquidate` will go through all the algorithms securities only if
necessary
- `TradeBar` parsing will not call `new T` for pure `TradeBar` which is
expensive
- Removing `Lazy` hash code and security type for the
`SecurityIdentifier`, replacing for direct initialization. Accessing the
`Lazy` value adds an overhead.
- Replacing `Enum` to string for hardcoded switch statement. `Enum.ToString` is expensive.
- `DataManager` will be lazy for counting the subscriptions for
determining if its above the limit
- Adding `AlgorithmSecurityValuesProvider.GetAllValues()`, removes the
need to fetch all the security keys twice.
- During universe selection, will not try to re add already added symbol
2019-04-22 10:47:27 -03:00
Gerardo Salazar 55f8376c53 Create mapping, IPO, delisting, splits, and dividends random generation
Created random-seed argument for rdg in order to let the user get deterministic output

Update documentation in 'FactorFileRow.cs' to accurately reflect factor
file structure

Update CSV generation for FactorFile so that it uses FactorFileRow's CSV
generator

Add FinancialCalendar to make it easier to implement logic regarding
financial quarters

Add mapping events to RandomDataGenerator

Update MapFileRow ToCsv method to correctly emit the ticker as lowercase

Fix bug in FactorFile where we would get the same initial data point twice
when we converted it to CSV

Create new method to convert a MapFile to CSV

Create new method to write MapFile to disk as CSV

Add unit test to test for successful CSV generation in MapFile

Add new files to project

Add FinancialCalendar unit tests

Create new class to handle generation of dividends, splits, and maps
2019-04-02 21:25:10 -07:00
Michael Handschuh f1960d2243 Add FactorFile.MostRecentFactorChange, bugfix for empty files
Empty factor files (whether a single 2050 line or no lines), by definition don't
have any splits or dividends.

FactorFile.MostRecentFactorChange yields the maximum date that isn't the 2050 date
2018-08-27 13:53:04 -04:00
Michael Handschuh 57affafdc2 Implement 'live' factor files
Adds reference price to dividend/split
Adds GetSplitsAndDividends to FactorFile
Adds Apply methods to FactorFile/FactorFileRow
Updates factor files to include reference prices
2018-08-14 17:58:44 -04:00
Stefano Raggi 2ff5650b4a Add price and split factors to CoarseFundamental class 2018-06-01 12:19:06 +02:00
Stefano Raggi 30316e19ab Skip duplicate rows in factor files
Some factor files contain duplicate rows causing a duplicate key exception when loaded. We now ignore these rows, allowing factors to be loaded and applied correctly.
2017-12-07 17:46:13 +01:00
Stefano Raggi 301b9e14fb Handle factor files with INF values
Before this PR, backtesting some symbols fails with an error when parsing the factor file.

Some factor files have INF split values, indicating that the stock has so many splits that prices can't be calculated with correct numerical precision.

To allow backtesting these symbols, we need to move the starting date forward when reading the data.

Known symbols: GBSN, JUNI, NEWL
2017-02-17 20:35:57 +01:00
Andrew 80dfc15fe2 Updated expected statistics for CourseFineFundamentalRegression test. Test now passes 2016-10-22 09:35:23 -04:00
Andrew 63be681027 Added IntradayDividendSplits.cs 2016-10-22 09:23:50 -04:00
Andrew Hart 75cb33f793 FactorFileGenerator now operates on BaseData 2016-10-22 09:22:58 -04:00
Juan Manuel Alvarez b3494afc47 Constants renamed to Globals.
Globals values can be reloaded from configuration.
2016-03-12 01:07:31 -03:00
snugs b1b7bdfb60 Changes to support IFactorFileProvider impls 2015-12-16 18:45:22 -05:00
QuantConnect 785e94d209 Tidy up of the ToolBox project to reduce duplicated code 2015-10-08 17:56:49 -04:00