Fix CustomPartialFillModelAlgorithmFails.cs/py (#7321)
Python Virtual Environments / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled

* Fix bug

The algorithm `CustomPartialFillModelAlgorithm.cs` was not working as
expected with short orders because in its Fill model, the variable
`absoluteRemaining` instead of decrease was being increased since
the `FillQuantity` in each call to this method was negative. Therefore
when this amount was substracted to `absoluteRemaining`, instead of
substract, it was added. Hence the method created more partial orders
than expected, specifically: 580 short orders for SPY with Quantity -10.

* Fix `CustomPartialFillModelAlgorithm.py`

* Address required changes

* Nit change

* Address required changes
This commit is contained in:
Ricardo Andrés Marino Rojas
2023-06-20 08:46:11 -05:00
committed by GitHub
parent 5ddc8c3766
commit a309322ae5
3 changed files with 70 additions and 17 deletions
@@ -52,6 +52,7 @@
<Content Include="AddOptionContractExpiresRegressionAlgorithm.py" />
<Content Include="AddOptionContractFromUniverseRegressionAlgorithm.py" />
<Content Include="CustomMarginInterestRateModelAlgorithm.py" />
<Content Include="CustomPartialFillModelAlgorithm.py" />
<Content Include="AddRiskManagementAlgorithm.py" />
<Content Include="AddUniverseSelectionModelAlgorithm.py" />
<Content Include="Alphas\ContingentClaimsAnalysisDefaultPredictionAlpha.py" />
@@ -78,7 +79,6 @@
<None Include="CustomDataIconicTypesAddDataRegressionAlgorithm.py" />
<None Include="TrainingExampleAlgorithm.py" />
<None Include="LongOnlyAlphaStreamAlgorithm.py" />
<None Include="CustomPartialFillModelAlgorithm.py" />
<Content Include="BasicTemplateOptionsConsolidationAlgorithm.py" />
<None Include="BasicTemplateOptionsPriceModel.py" />
<Content Include="CoarseFineOptionUniverseChainRegressionAlgorithm.py" />