Skip to content

Conversation

@vb-vlb
Copy link
Contributor

@vb-vlb vb-vlb commented Feb 2, 2026

Fix weights calculation in VBaseSignalExport.

Description

In the VBaseSignalExport.BuildCsv method, prices were not taken into account when calculating weights.
This change fixes the weight calculation logic.

Related Issue

Closes #9259

Motivation and Context

This change is required because the current implementation of weight calculation is incorrect, as it does not take into account position prices.

Requires Documentation Change

As this change fixes a bug, no documentation changes are needed.

How Has This Been Tested?

Tested using a test algorithm.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

@vb-vlb vb-vlb marked this pull request as ready for review February 2, 2026 17:55
…ant to stamp. Extended the demo algorithm to use two positions to better demonstrate the intended usage of the VBaseSignalExport class.
@Martin-Molinero
Copy link
Member

Hey @vb-vlb! Thanks almost there, final comments

  • Shouldn't remove .Value, symbol to string in some cases might be the Lean security identifier version (eg AAPL R735QTJ8XC9X)
  • Minor tweak for C# regression algorithm version
  • Because ur adding AAPL the expected statistics will change, you will need to update them in the C# version, setting "regression-update-statistics" to true and running the regression test will update it automatically for you
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix incorrect portfolio weights in VBaseSignalExport

2 participants