* 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.
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.
- 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
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.
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
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
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.
Adds reference price to dividend/split
Adds GetSplitsAndDividends to FactorFile
Adds Apply methods to FactorFile/FactorFileRow
Updates factor files to include reference prices
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