Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save quantra-go-algo/558942d8946a0db8da14bbcbfc5a2428 to your computer and use it in GitHub Desktop.

Select an option

Save quantra-go-algo/558942d8946a0db8da14bbcbfc5a2428 to your computer and use it in GitHub Desktop.
guardrailed-llm-agent — Step 6: From Policy to Position: Sizing with Volatility Targeting (snippet 3)
def mom_tilt(base, m):
if pd.isna(m): return base
tilt = 1.15 if float(m) >= 0 else 0.85
return base * tilt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment