About 15 margin tests pass

This commit is contained in:
Sam Germain
2021-06-27 03:38:56 -06:00
parent 6f6deae376
commit da81be9050
8 changed files with 1011 additions and 704 deletions

View File

@@ -1,7 +1,7 @@
An instance of a `Trade`/`LocalTrade` object is given either a value for `leverage` or a value for `borrowed`, but not both, on instantiation/update with a short/long.
- If given a value for `leverage`, then the `amount` value of the `Trade`/`Local` object is multiplied by the `leverage` value to obtain the new value for `amount`. The borrowed value is also calculated from the `amount` and `leverage` value
- If given a value for `borrowed`, then the `leverage` value is calculated from `borrowed` and `amount`
- If given a value for `borrowed`, then the `leverage` value is left as None
For shorts, the currency which pays the interest fee for the `borrowed` currency is purchased at the same time of the closing trade (This means that the amount purchased in short closing trades is greater than the amount sold in short opening trades).