Commit Graph

5 Commits

Author SHA1 Message Date
Michael Handschuh f08184c0ae Revert class name changes from #1506
This caused several user algorithms to break. Also, its still correct to
call these margin models.
2018-02-04 14:20:38 -05:00
Stefano Raggi baced83ac4 Rename interface ISecurityMarginModel to IBuyingPowerModel
Also renamed all existing margin models to buying power models:
- SecurityMarginModel -> SecurityMarginBuyingPowerModel
- FutureMarginModel -> FutureMarginBuyingPowerModel
- OptionMarginModel -> OptionMarginBuyingPowerModel
2018-01-31 11:47:34 +01:00
Stefano Raggi 2952e30f15 Remove GetInitialMarginRequiredForOrder and GetInitialMarginRequirement from ISecurityMarginModel interface
GetInitialMarginRequiredForOrder and GetInitialMarginRequirement methods in the SecurityMarginModel class are made protected as they can still be overridden in derived classes.
2018-01-31 11:47:33 +01:00
Stefano Raggi 89357ef7aa Disable margin calls in live mode and refactor margin call models
This PR reverts and replaces PR #674 because it caused issue #678.
The margin call model has been refactored and now contains both methods for margin call order handling (generation and execution).

Disabling margin calls is now much simpler:
Portfolio.MarginCallModel = MarginCallModel.Null;

List of changes:
- Added a new IMarginCallModel interface
- Renamed MarginCallModel to DefaultMarginCallModel
- Refactored margin call models by moving the GenerateMarginCallOrder method from ISecurityMarginModel to IMarginCallModel
- Disabled margin calls by default for live trading in BrokerageSetupHandler initialization
2017-01-06 17:50:38 +01:00
Michael Handschuh 770dd714bd Adds PatternDayTradingMarginModel
Closes #108

Thanks to @AlexCatarino for the unit tests!!
2016-02-12 11:50:42 -05:00