12 Commits

Author SHA1 Message Date
Martin Molinero 6eb08334cd Revert GetBuyingPower removal
- Fix bug where OptioMarginModel would return 0 initial margin required
2020-02-24 14:06:16 -03:00
Martin Molinero 85f5b68972 Address reviews
- Revert `OptionMarginModel` behavior change
- Renames
- Refactor future intraday margin modelling
2020-02-04 18:41:15 -03:00
Martin Molinero 6eb45baa59 Refactor GetMaximumOrderQuantityForTargetBuyingPower
- Refactoring `GetMaximumOrderQuantityForTargetValue` into
`GetMaximumOrderQuantityForTargetBuyingPower` which algorithm uses
margin
- Reducing code duplication
- Adding unit tests
- Fixing futures margin model. Adding intra day logic.
2020-02-04 18:41:15 -03:00
Martin Molinero 936af7df7b Refactor BuyingPowerModel
- Remove unrequired `GetBuyingPower`
- Making `BuyingPowerModel.GetMaintenanceMarginRequirement` protected
instead of public
- Adding `GetMaximumOrderQuantityForDeltaBuyingPower` to replace
public `GetMaintenanceMarginRequirement` and improve API experience for
consumers like the `DefaultMarginCallModel`
- Adding new unit tests
2020-02-04 18:41:15 -03:00
Martin Molinero fa122fa809 Add missing PyObject.Dispose calls
- Adding _some_ of the missing PyObject.Dispose calls. In the cases
where C# is calling the Python side.
   - Note that Python calls to C# code is correctly handling the
   disposure of resources.
2019-04-10 15:03:10 -03:00
Jared e17184d01e Merge pull request #2719 from Martin-Molinero/refactor-2718-rename-context-to-parameters
Renaming BuyingPower..Context to BuyingPower..Parameters
2018-12-04 11:20:31 -08:00
Stefano Raggi bd4c799d2b Rename parameter classes from Context to Parameters 2018-11-29 22:05:49 +01:00
Martin Molinero 7ce09f22cb Renaming Context to Parameters
- Renaming `BuyingPowerContext` to `BuyingPowerParameters` and
`ReservedBuyingPowerForPositionContext` to
`ReservedBuyingPowerForPositionParameters`
2018-11-29 15:02:09 -03:00
Stefano Raggi 78f3b4b099 Refactor additional IBuyingPowerModel methods to use context objects 2018-11-27 22:50:15 +01:00
Michael Handschuh cb726cb60a Refactor IBuyingPowerModel.GetBuyingPower
In preparation for sweeping changes that will require adding a currency converter
parameter to this method and augmenting the return value to be a CashAmount. This
ensure the future change won't produce a compile-time breaking change. An extension
method was also added as a shim to keep any existing code functional
2018-10-16 18:44:22 -04:00
Michael Handschuh df0e19ef27 Refactor IBuyingPowerModel.GetReservedBuyingPowerForPosition
In preparation for sweeping changes that will require adding a currency converter
parameter to this method and augmenting the return value to be a CashAmount. This
ensure the future change won't produce a compile-time breaking change. An extension
method was also added as a shim to keep any existing code functional
2018-10-16 18:14:17 -04:00
AlexCatarino f1a1dd0091 Enables custom buying power model setting in python
- Adds `BuyingPowerModelPythonWrapper` to wrap a python class that represents a custom buying power model.
- Adds `SetBuyingPowerModel` and `SetMarginModel` to enable the seeting of custom buying power model.
2018-08-21 12:04:49 +01:00