Commit Graph

18 Commits

Author SHA1 Message Date
Martin Molinero e73e927c0f Enable parallel unit testing 2020-04-27 17:45:53 -03:00
Martin Molinero 886e5e6445 Test fixes and updates 2020-04-23 09:59:31 -03:00
Martin Molinero c9e6268cbd Remove OrderFeeParameters.AccountCurrency
- Removing OrderFeeParameters.AccountCurrency. Where required replacing
for constructor parameter defaulting to USD.
- Updating IB fee model to use to correct fee currency
2018-12-28 15:57:53 -03:00
Martin Molinero 0af7ba14f5 Address reviews
- `CashBook[NullCurrency] { get; }` will throw an exception
- Revert `Currencies.USD` changes in user facing algorithms
- Improve some documentation
- Revert some format changes
- Adding more asserts for regression test
- Adding new regression tests using a custom fee model which returns
`OrderFee.Zero`
- Adding a non-usd account currency test to the cash book tests
- Adding some unit tests for `NullCurrency` and `OrderFee.Zero`
2018-12-14 12:38:55 -03:00
Martin Molinero 0933da9303 Refactor previous commits
- Removing `AccountCurrency` from `Cash` and `Brokerage` classes.
`ICurrencyConverter` will now provide the `AccountCurrency`
- Adding new static `OrderFee.Zero` which will return a 0 order fee in
`NullCurrency`
- Adding static `Currencies.USD` value, replacing all "USD".
- Addin new static `Currencies.NullCurrency`
- Updating Bitfinex `FeeModel` so it return fees in quote currency.
Adding unit tests
2018-12-13 11:30:40 -03:00
Martin Molinero b7bcdbef04 Adding OrderFee to OrderEvent
- Replacing `decimal` for `OrderFee` at the `OrderEvent`.
- Adding `FeeModelNotUsingAccountCurrency` regression test
- Adding unit tests for `CashBuyingPowerModel` and `SecurityMarginModel`
with non account currency fees
2018-12-10 13:18:41 -03:00
Martin Molinero c5daf9ac9a Refactor IFeeModel
- Refactoring `IFeeModel`. *This is a breaking change* for implementations
inheriting directly from the interface. Deleting old and adding a new method
`OrderFee GetOrderFee(OrderFeeParameters parameters)` that will use a parameter
and a result object.
- Refactoring `CashAmount` so it does not embed a `ICurrencyConverter`
instance.
- Updating unit tests
- The `Security.QuoteCurrency`, a `Cash` instance, will provide access
to the `AccountCurrency` as a property.
- Will maintain backwards compatibility with old python custom
FeeModels, Adding unit test.

> Note that for now, consumers will ignore the currency, as before, and
directly consume the amount
2018-12-06 16:20:36 -03:00
Martin Molinero 6bbc8a304e BuyingPowerModel.GetInitialMarginRequiredForOrder
- `BuyingPowerModel.GetInitialMarginRequiredForOrder` will now receive
the new `InitialMarginRequiredForOrderParameters` object containing an
`ICurrencyConverter` instance.
2018-12-04 17:50:00 -03:00
Martin Molinero 1997197f47 Fix failing unit tests 2018-09-18 12:10:42 -03:00
Martin Molinero 41873b2315 Fixing unit tests 2018-08-31 16:06:41 -03:00
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 5b5a56102b Remove IBuyingPowerModel.GetMarginRemaining, add GetBuyingPower
The GetMarginRemaining method in SecurityMarginBuyingPowerModel class is made protected as it can still be overridden in derived classes.
2018-01-31 11:47:35 +01:00
Stefano Raggi acb5db6cf5 Rename Security.MarginModel to BuyingPowerModel 2018-01-31 11:47:34 +01: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
jameschch@outlook.com 7763efdc83 Changes related to #330 order quantity decimalized 2016-06-24 11:28:21 +01:00
Stefano Raggi c6ab064ef4 Commented out console output in AlgorithmSetHoldingsTests 2016-03-23 10:53:45 +01:00
Stefano Raggi 9bba569bff Adds new tests for CalculateOrderQuantity
These tests include 240 combinations generated using different positions, order fees, price movements and leverages
2016-03-15 01:06:59 +01:00