Skip to content

Add HOSE lot-aware position sizing helper#55

Open
toreleon wants to merge 1 commit into
masterfrom
openjules/eng-1-cmqmjg
Open

Add HOSE lot-aware position sizing helper#55
toreleon wants to merge 1 commit into
masterfrom
openjules/eng-1-cmqmjg

Conversation

@toreleon

Copy link
Copy Markdown
Owner

What changed

  • Added src/risk/positionSizing.ts with a pure calculatePositionSize helper for risk-based long sizing.
  • The helper validates equity, risk fraction, entry/stop prices, and lot size with clear error messages.
  • Added tests/positionSizing.test.ts covering the worked example, lot rounding, zero-share rounding, and all validation branches.

Verification

  • pnpm install
  • pnpm typecheck
  • pnpm test

Both checks passed after the implementation.

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.

1 participant