braverock / braverock/quantstrat
[R-Forge #1125] add capital/equity-aware order sizing function
- Dominant language
- R
- Stars
- 310
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
Submitted by: Brian Peterson
Assigned to: Joshua Ulrich
[R-Forge link](http://r-forge.r-project.org/tracker/index.php?func=detail&aid=1125&group_id=316&atid=1272)
quantstrat currently has two default order sizing functions:
osNoOp (no operation, tests for errors only, otherwise returns the quantity requested)
osMaxPos (allows leveling into positions up to some maximum position)
We should add a function of functions to do order sizing based on account equity.
At it's simplest, I think that this would do sizing based on either initEQ (stored as an attr in the Account), or on the current endEq (if it has been updated by a call to updateAcct)
I suppose several other options could make sense, like handling weights to apply. This could then be used for either true weight-based allocation (think portfolio optimization ala PortfolioAnalytics or LSPM), or for volatility weighting (per the original Turtles strategy, or similar).
Cheers,
- Brian
Contributor guide
Research direction
Start by reading the existing osNoOp and osMaxPos order-sizing functions, then trace the Account attributes and updateAcct path mentioned in the issue. Before implementation, clarify whether the scope includes initEQ, current endEq, and weighting options; the work is done when the agreed equity-aware sizing behavior is implemented and its sizing cases are verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- fintech-quant
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100