risk based position sizing builder
Converts risk parameters into deterministic position-sizing logic and code for systematic trading.
Secure checkout via Stripe
Works with the AI tools you already use
See it in action
You say
Calculate the position size for a stock trade. Equity is 50,000 USD, risk 1%, entry 150.00, stop 145.00. Give me a Python function.
Your agent does
Risk Amount: 500 USD Stop Distance: 5.00 Position Size: 100 shares
def get_size(entry=150.0, stop=145.0, equity=50000, risk_pct=1.0):
risk_amt = equity * (risk_pct / 100)
size = risk_amt / abs(entry - stop)
return int(size)
What you get
About this skill
The problem
Traders often struggle to translate abstract risk management rules into precise, executable position sizes across different asset classes. Manual calculations for futures multipliers or forex pip values are prone to human error, leading to over-leveraged accounts or broken strategy logic.
What it does
- Calculates exact position sizes for stocks, futures, forex, and crypto based on account equity and stop loss distance.
- Generates reusable Excel/Google Sheets formulas for dynamic sizing models.
- Outputs production-ready Python or JavaScript functions for automated trading bots.
- Applies strategy-specific constraints like max exposure caps, pyramiding rules, and correlation filters.
- Validates inputs to ensure stop distances are non-zero and risk percentages are positive.
Frameworks & tools
Python, JavaScript, Excel, Google Sheets.
Why this beats prompting it yourself
General LLMs often forget to account for contract multipliers in futures or specific lot step rounding in forex. This skill uses deterministic formulas to ensure financial accuracy, preventing the "hallucinated" math that ruins trading accounts.
Use cases
- Building a risk management module for a Python-based algorithmic trading bot.
- Creating a dynamic position-sizing calculator in a Google Sheets trading journal.
- Auditing existing strategy code to ensure it respects portfolio-wide risk limits.
- Converting complex pyramiding rules into code-based execution logic.
Known limitations
Does not handle nonlinear payoffs for options without delta-adjustment inputs. Requires manual entry of current account equity and instrument-specific values like pip cost.
How to install
Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean today
- 30-day refund guarantee
- One-time purchase, yours forever
- Secure checkout via Stripe