BacktestingBrokerage charges no fee for partially filled orders that are later cancelled
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- csharp
- Área
- backend, fintech-quant
Línea de trabajo
Start in BacktestingBrokerage.Scan, where the issue says fee models run only for fills with OrderStatus.Filled; trace how partial fills and cancellation events carry order fees. Before changing behavior, resolve whether fees should be charged per partial fill or accumulated until cancellation or closure, including the stated effects on fee models. Done means the filled quantity is charged appropriately while the cancelled remainder pays nothing, with fee model assumptions addressed.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
BacktestingBrokerage.Scan only invokes fee models for fills whose status is OrderStatus.Filled:
// invoke fee models for completely filled order events
foreach (var fill in fills)
{
if (fill.Status == OrderStatus.Filled)
{
...
fill.OrderFee = legKVP.Value.FeeModel.GetOrderFee(new OrderFeeParameters(legKVP.Value, legKVP.Key));
}
}
An order that fills partially and is then cancelled emits a PartiallyFilled fill (no fee is computed) followed by a Canceled event carrying OrderFee.Zero, so the filled portion is never charged any fee. The cancelled remainder correctly pays nothing.
This is framework-level and affects every fee model, not just one.
Question for maintainers
Should the fee for a partial fill be charged at the time of the fill, or accumulated and charged when the order is cancelled/closed?
Charging per partial fill is not a drop-in change: fee models currently assume a single fee per order and use the order's full quantity. Per-trade caps (e.g. the FINRA TAF maximum), per-order minimums and flat fees would all need to be reworked if fees started arriving on PartiallyFilled events.
Steps to reproduce
Run a backtest in which an order partially fills and is then cancelled, and observe that no order fee is recorded for the filled quantity.
Expected
The filled portion should carry its share of the order fees.
Context
Raised while reviewing the Trading 212 fee model (#9983), but it is not specific to that model.
- Lenguaje dominante
- C#
- Estrellas
- 22.5k
- Forks
- 5.4k
- Merge medio
- 22 h 6 min
- PR fusionados (30 d)
- 81
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QuantConnect/Lean
-
PDF report generation can overwrite HTML when the destination extension is not lowercase .htmlAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QuantConnect/Lean#10082 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
QuantConnect/Lean#10059 ·
Los mantenedores suelen responder en 1 día
-
Library Request: highspyAbiertolibrary-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
QuantConnect/Lean#10034 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
QuantConnect/Lean#9965 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
QuantConnect/Lean#9955 ·
Los mantenedores suelen responder en 1 día
Todos los issues de QuantConnect/Lean
Issues similares
-
bug emitter:client:csharp
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/typespec#12572 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-networking
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/aspnetcore#70545 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
Los mantenedores suelen responder en 1 día