Commit Graph

12 Commits

Author SHA1 Message Date
Martin Molinero cfa08a11fb Address reviews
- Removing `using QCAlgorithmFramework = QuantConnect.Algorithm.QCAlgorithm`
- Removing `QCAlgorithmFrameworkBridge`
- Removing `IsFrameworkAlgorithm`
- Making `EmitInsightBasedOnFill` private. Adding new
`IOrderEventProvider` exposing an `event` to which `QCAlgorithm` will
subscribe.
- `AccountType.Cash` algorithms will be allowed to manually trade and
emight insights manually or with alpha model.
2019-04-03 21:55:44 -03:00
Martin Molinero 19f1806ddc Address review: readd Framework project 2019-04-03 21:55:43 -03:00
Martin Molinero 32ac3146b4 Merge Framework and Classic Algorithms
- Merging Framework and Bridge algorithms into classic QCAlgorithm
class.
- Removing Framework project, VS17 and VS15
2019-04-03 21:54:32 -03:00
Michael Handschuh d818b56d6e Add MaximumUnrealizedProfitPerSecurity risk model
This is the inverse of the MaximumDrawdownPercentPerSecurity risk model.
It's goal is to liquidate holdings for a security when the unrealized profit
passes a specified threshold. This can viewed as a 'take the money and run'
risk model.
2018-10-13 03:30:13 -04:00
Michael Handschuh 2bb99a595b Add base class for risk management models
Update existing models to derive from new base class
2018-05-11 01:55:16 -04:00
Michael Handschuh d3d331f100 Make risk management models overrideable 2018-05-07 16:14:13 -04:00
Michael Handschuh 3d7c49d6d2 Add targets parameter to IRiskManagementModel.ManageRisk
The current targets are passed into the risk model for risk assessment.
The risk model is only required to return any changes required from the
point of view of the risk model. The risk adjusted targets are given
priority, and if no risk adjusted target is specified for a symbol than
the target produced by porfolio construction will be used.
2018-04-10 19:38:17 -04:00
Michael Handschuh b40b873edb Set default ctor args for MaximumDrawdownPercentPerSecurity 2018-04-03 16:20:39 -04:00
Michael Handschuh e73a3eb3db Update ManageRisk to return portfolio targets
These targets act as overrides and get sent into the execution model just
the same as the ones emitted from the construction model.
2018-03-27 17:48:22 -04:00
Stefano Raggi f37d0cc962 Optimize loops for performance on cashbook and securities 2017-12-20 21:58:59 +01:00
Stefano Raggi c6aba7bfec Reduce full locking on ConcurrentDictionary objects
This PR is an attempt to reduce contention in concurrent dictionaries, replacing method calls using full locks with lock-free equivalents:

- dictionary.Count -> dictionary.Skip(0).Count()
- dictionary.Keys -> dictionary.Select(x => x.Key)
- dictionary.Values -> dictionary.Select(x => x.Value)

The most frequent usages of these methods are: CashBook, SecurityManager, UniverseManager and indirectly, SecurityPortfolioManager.

The reasons for this update are explained very clearly in this article:
https://arbel.net/2013/02/03/best-practices-for-using-concurrentdictionary/
2017-12-20 17:18:54 +01:00
Michael Handschuh 755dcb30ab Add IRiskManagementModel
The risk management model is intended to check the algorithm's positions
at the end of each time step to potentially exit positions that are losing
too much.
2017-12-08 10:07:54 -05:00