Get Position Size
get_position_sizeTurn a signal + bankroll into a concrete position: fractional-Kelly size capped by orderbook liquidity, ATR-based stop, liquidation price at chosen leverage, funding carry cost, and % bankroll at risk. Warns when liquidation sits inside the stop. Ground win_rate_pct with get_signal_performance or get_signal_backtest first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset | Yes | Asset, e.g. "BTC" | |
| leverage | No | Intended leverage (default 3x) | |
| direction | Yes | Trade direction | |
| payoff_ratio | No | Avg win / avg loss ratio (default 1.5) | |
| win_rate_pct | No | Estimated win probability % (use get_signal_performance or get_signal_backtest to ground this) | |
| bankroll_usdc | Yes | Total capital available in USDC | |
| kelly_fraction | No | Fraction of full Kelly to use (default 0.25 — quarter Kelly) | |
| max_slippage_pct | No | Max acceptable slippage % — caps size by orderbook depth |