Commit Graph

17 Commits

Author SHA1 Message Date
Juan José D'Ambrosio a26414d273 Add decimal places as parameters to get dividends with arbitrary precision (#4883)
* Add decimal places as parameters to get dividends with arbitrary precision

 
Also, increase precision when generating strings from factor files rows.

* Add xml documentation entries for new optional arguments.
2020-10-27 20:30:17 -03:00
Martin Molinero 69194bfbe9 Minor improvements
- Makeing FactorFileRow.Parse private to avoid wrong usages
- Avoid end of stream check while unzipping
2020-06-08 14:33:52 -03:00
Juan José D'Ambrosio 4d0009df86 Address review 2019-12-12 12:09:42 +00:00
Juan José D'Ambrosio 3227ee982a Fix handling of inf and exponential notation in factor files
Previously, if there is an `inf` or exponential notation in a factor file row, the FactorFile.Row method will add a new line with a date equal to the original row date less one day. This is a bug because the dates in factor files row should always be a trading day, the previous logic didn't assure that.

Even more, that new line is useless, without that line addition, the parser still parses the latest row with valid factors and use it as the first row.

This commit removes the addition of a new line. Also, updates the test cases, now the FactorFile minimum date will be the latest row without inf or exponential notation less one day.
2019-12-11 15:29:21 +00:00
Juan José D'Ambrosio 94c957b3c9 Add support for QQ exponential notation in factor files 2019-12-10 15:39:23 +00:00
Michael Handschuh d709d1c4e0 Update Common to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 14:13:24 -04:00
Martin Molinero 7aafdef827 MapFile and FactorFile data feed resolution
- Moving `MapFile` and `FactorFile` resolution to the data feed stack so
that they do not add a performance overhead to the algorithm thread.
- Create logging string messaged only if required.
- Calculate `FactorFileRow.PriceScaleFactor` the least amount of times
2019-06-12 17:48:47 -03: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
Michael Handschuh d04666f690 Round factors using quantquote precision
Adds rounding of price and scale factors when writing a factor file
row to csv. The precision provided is the same that is used by quant
quote in their raw files
2018-08-27 14:10:41 -04:00
Michael Handschuh 9e306e76c7 Add FactorFileRow.ToCsv(source) and fix Apply(Dividend) bug
The time check in FactorFileRow.Apply(Dividend) was not using the previous
trading date for comparison.

Added a 'source' parameter to FactorFileRow.ToCsv() for tracking each row's
data source.
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
Andrew efd5845a3e Added ability to specify cache data folder 2017-09-14 16:31:43 -04: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
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