Created
June 24, 2026 01:29
-
-
Save quantra-go-algo/cc135143874eb247b37dce718ecdb032 to your computer and use it in GitHub Desktop.
guardrailed-llm-agent — Step 6: From Policy to Position: Sizing with Volatility Targeting (snippet 1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def action_to_base_exposure(action, size): | |
| # Maps LLM output to a base exposure in [0.5, 1.0]. No shorts. | |
| if action == 'LONG': | |
| return LONG_FULL_EXP if size >= 1.0 else LONG_HALF_EXP # 1.0 or 0.8 | |
| return FLAT_EXP # 0.5: never fully exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment