Commit Graph

15 Commits

Author SHA1 Message Date
Gerardo Salazar f9336514fd Parameterize probability of IPO, splits, dividends, renames, and
dividends every quarter.

Check for existing directory before attempting to write in MapFile
2019-04-09 15:01:55 -07:00
Gerardo Salazar 78d6c78b36 Fixed generation of map and data files.
Previously, map files were generated with multiple rename events
and only one symbol was output. Now, data files are created for
each map file entry.

Fixed wrong formatting for IPO date
2019-04-02 21:25:10 -07:00
Gerardo Salazar 43d26a456a Removed FinancialCalendar
Fixed bug where data would only be generated in quarters instead of
a random month
2019-04-02 21:25:10 -07:00
Gerardo Salazar 5ed31b1a7d Fixed bug in DividendSplitMapGenerator where map file would delete the
first entry

Changed behavior of dividend generation. Some symbols may now be excluded
from having dividends completely.

Fix bug where we would generate the same dividend entry due to the way
the variable used to calculate the next dividend was placed.

Changed initial starting value for dividends and splits for symbols with
no splits or dividends

Remove `NormalizeMonth` method in FinancialCalendar
2019-04-02 21:25:10 -07:00
Gerardo Salazar 645bb031b3 Improved random generation to more closely match sample factor files
Fixed bug where factor file reference price output had very high
precision

Fixed bug where map file had a useless entry before the final line if
the asset was not delisted

Fixed bug where program would crash because of NextPrice reaching its
maximum attempts. Fixed by removing call to NextPrice and using another
generation method.
2019-04-02 21:25:10 -07: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
Juan José D'Ambrosio ed3c609e9e Remove start date from coarse generator
This commit removes start date in the coarse generator. This option was used in the previous version, in order to process only the newest dates.

The reason is the fact that coarse files now contains factors to estimate adjusted prices. In turn, factors are updated backward with a new corporate event (split, dividends, etc); the new coarse generator should *always* process the full symbol historical data, for all symbols.
2019-03-22 11:51:45 +00:00
Michael Handschuh 728594c277 BUG #2840: Prevent emitting trade&quote in same time step
This side steps the issue reported in #2840 by removing the desire to pass
zero for the maximum deviation. The previous issue was that we were leaning
on the trade ticks to produce the series variation and then trying to fit
quote ticks around a previously generated trade tick. This solution permits
both quote and trade ticks to produce variations and prevents the generator
from emitting both at the same time step.

A new parameter, --quote-trade-ratio, determines the relative density of each.
For example, a quote trade ratio of 1 means equal trade and quote ticks, whereas
a value of 2 means twice as many quote ticks as trade ticks.

This change also removes special treatment regarding the downsizing of the
requested deviation for quote ticks. If the consumer wants to limit the
deviation of quote ticks than the consumer can make that decision, but the
random value generator should simply follow instructions like a good little
boy.

Fixes #2840
2019-01-22 09:52:41 -05:00
Michael Handschuh 719e541558 BUG #2840: Validate --symbol-count greater than zero 2019-01-22 09:52:41 -05:00
Michael Handschuh b9d475c324 BUG #2840: Fix documentation
Higher resolution means more frequent whereas lower resolution
means less frequent. This piece of logic is picking the next
time using a higher frequency resolution to guarantee we get a
time within market hours
2019-01-22 09:52:40 -05:00
Michael Handschuh dc996c4a6d BUG #2840: Rename symbols -> _symbols
Renames the private member to follow LEAN naming conventions
2019-01-22 09:52:40 -05:00
Jared Broad d2923b3ca1 Rename start end date parameters 2019-01-19 12:38:20 -08:00
Michael Handschuh 3922dbc886 #2824: Use TickAggregator, add FilteredIdentityDataConsolidator
The existing IdentityDataConsolidator consumes all ticks, completely ignoring
the tick type. I doubt this is ever the desired behavior, but given my
reluctance to break existing regression and unit tests as well as perhaps
user algorithms, I've added a layer on top to provide the proper filtering.
Removed the stub type which mirrored the TickAggregator and also expanded
the TickAggregator implementations to provide full coverage of the possible
ticktype/resolution cases: OpenInterestTickAggregator and IdentityTickAggregator
2019-01-15 14:50:45 -05:00
Michael Handschuh 743e067c60 #2824: Add RandomDataGeneratorProgram
Invoke from toolbox cli using --app=rdg or --app=randomdatagenerator

Produces random data over the requested time frame in the desired resolution,
security type and density.

Here's a few sample command line invocations:

--app=rdg --start=20190101 --end=20200101 --symbol-count=1 --resolution=Daily --data-density=Dense --include-coarse=false
--app=rdg --start=20190101 --end=20200101 --symbol-count=10 --security-type=Future --resolution=Hour --data-density=VerySparse
--app=rdg --start=20190101 --end=20200101 --symbol-count=5 --security-type=Option --resolution=Minute --data-density=Sparse
2019-01-15 14:33:45 -05:00
Michael Handschuh 22ba5d431f #2824: Add RandomValueGenerator
The random value generator aims to abstract away the generation of the
 key bits of data from the toolbox project. This provides a baseline
 implementation for anyone who wishes to customize their data randomizaton.
 Simply subclass and override the desired methods. A full test suite is
 included to ensure the data generated meets specifications.
2019-01-15 14:33:10 -05:00