Commit Graph

6 Commits

Author SHA1 Message Date
AlexCatarino a4cd0a8412 Use bid/ask price to calculate the unrealized profit
In `SecurityHolding.TotalCloseProfit`, use the market order direction to define whether ithe method should use the bid or the ask to compute unrealized profit.

- Fix statistics of futures' algorithms.
- Adds unit test.
2018-09-21 20:32:14 +01:00
Juan José D'Ambrosio 4f320d83ac BasicTemplateFuturesFrameworkAlgorithm statistics updated 2018-09-06 14:06:38 -03:00
Stefano Raggi 454d4acf43 Add missing data files for BasicTemplateFuturesFrameworkAlgorithm 2018-08-08 18:14:40 +02:00
Michael Handschuh 4fd16f6daf Fix resolution of insight close times, allow user defined close times
Fixes a bug where we were using the security's data resolution to compute
the insight's close time. This led a case such as insight.Period == 20days
to step 20days worth of tradable minutes (assuming minute data resolution),
yielding a close time that was very far in the future.

We also add different means of specifying an insight's period/close time:
1. Specify insight period as a TimeSpan and we compute close time
2. Specify insight period and a resolution and bar count and we compute close time
3. Specify insight close time local directly and we compute the insight period

The key here is maintaining consistency between the three different approaches
which is heavily validated with the corresponding unit tests.

Edits also made to trust the insight's close time as the analysis end time in
the case where the analysis period == insight period (extra analysis period = 0).
Given the current setup (extra analysis period == 0), this guarantees that close
and analysis end times are equivalent.

Regression statistics were updated and expectedly we get many more insights that
have completed analysis, and as such, average scores have also changed.
2018-08-07 11:21:11 -04:00
AlexCatarino 0bc157a8e7 Removes logging from framework models and algorithms
Shipped modules should be silent unless error case.
2018-07-31 19:16:17 +01:00
AlexCatarino e5ed09924b Implements BasicTemplateFuturesFrameworkAlgorithm
This algorithm shows how to implement a futures strategy in a framework algorithm.
`FutureUniverseSelectionModel` portfolio selection model was implemented to provide a base class to help create other futures universe selection models.
2018-07-30 22:21:47 +01:00