Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Review Security SetModel Python Wrapper Handling

Open Martin-Molinero opened this issue 2 months ago • 0 comments

Expected Behavior

  • Python model wrapper is only used when required

Actual Behavior

  • if the user provides a pure C# instance we don't need a wrapper and it is being used, see SetFeeModel

Potential Solution

  • Review existing handling in QCAlgorithm, we already check in different location whether an instance is pure C# or not and handle it correctly
    • ideally we should centralize this logic in a helper method

Reproducing the Problem

security.set_fee_model(ConstantFeeModel(0))

See related https://github.com/QuantConnect/Lean/issues/7925

System Information

N/A

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

Martin-Molinero avatar Oct 21 '25 14:10 Martin-Molinero