Etoro cash-account targets size against combined crypto inventory rather than per-instrument holdings
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read Common/Securities/CashBuyingPowerModel.cs:206-219, EtoroBrokerageModel.cs, and SecurityPortfolioModel.cs:75-79 to trace cash-account sizing and instrument holdings. Start by comparing eToro's sizing model with existing position-based sizing and check how spot exchanges use the generic cash model. Add regression coverage for zero and nonzero targets across two instruments sharing a base currency; done when those targets use each instrument's position and spot-exchange behavior remains unchanged.
由索引模型根据 Issue 内容生成。
描述
What happens
On EtoroBrokerageModel(AccountType.Cash), crypto target sizing uses the combined base-currency cash balance instead of the holdings of the requested instrument. eToro's order model treats positions as instrument-specific and rejects a market order that crosses zero, so this can either prevent a close or trade in the wrong direction.
Synthetic reproduction against Lean 2d730d56e (no brokerage connection or live trade):
- USD cash: 10,000.
- BTC cash: 2, conversion rate 10,000 USD/BTC.
- EUR cash: 0, conversion rate 1 USD/EUR.
- BTCUSD and BTCEUR: one BTC held on each, each priced at 10,000 in its quote currency.
- Both securities use the buying-power and fee models returned by
EtoroBrokerageModel(AccountType.Cash); portfolio free-value and minimum-order buffers are zero. - Total portfolio value: 30,000 USD.
Actual output:
CalculateOrderQuantity(BTCUSD, 0) = -2
CanSubmitOrder = false (cross-zero rejection; BTCUSD holds only 1)
CalculateOrderQuantity(BTCUSD, 0.5) = -0.4950495
CanSubmitOrder = true
The zero target should close the one BTCUSD unit, not also attempt to sell the BTC represented by BTCEUR. The 50% target should increase BTCUSD from 10,000 toward 15,000 USD, not reduce it.
Source
Common/Securities/CashBuyingPowerModel.cs:206-219: the zero target returns-BaseCurrency.Amount; other targets compare against the value of that same combined currency balance.Common/Brokerages/EtoroBrokerageModel.cs: inherits this cash-account buying-power model, but itsCanSubmitOrderchecks cross-zero against the instrument's holdings.Common/Securities/SecurityPortfolioModel.cs:75-79: ordinary crypto fills already add units to the shared base-currency cash balance, so this can arise in an uninterrupted running algorithm too.
What a fix must achieve
Keep the cash book's combined coin inventory and valuation, while sizing eToro portfolio targets against the requested instrument's position. Cover a zero and a nonzero target with two instruments sharing the same base currency, and leave spot-exchange behavior unchanged.
Suggestion only: evaluate a position-aware buying-power model for eToro, reusing existing position-based sizing where possible rather than changing the generic spot-cash model.
This is distinct from #1860, which addressed initial virtual holdings: here both holdings are populated and the base-currency balance is correct.
- 主要语言
- C#
- 星标
- 22.5k
- 派生
- 5.4k
- 平均合并
- 22 小时 6 分钟
- 30 天内合并 PR
- 81
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantConnect/Lean 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
QuantConnect/Lean#10082 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
QuantConnect/Lean#10059 ·
维护者通常 1 天内回复
-
library-request
难度 2/5 1-3 小时 新手友好度 76/100
QuantConnect/Lean#10034 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
QuantConnect/Lean#9965 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
QuantConnect/Lean#9955 ·
维护者通常 1 天内回复
查看 QuantConnect/Lean 的全部 Issue
相似的 Issue
-
bug emitter:client:csharp
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/typespec#12572 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
needs-area-label
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabled未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 条评论 ·
维护者通常 1 天内回复
-
area-networking
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/aspnetcore#70545 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 87/100
维护者通常 1 天内回复