SYSTEM R AI

Core Tools

Position sizing, risk validation, performance evaluation, and pricing.

The 4 core tools are the foundation of System R. They cover position sizing, risk validation, and performance evaluation.

calculate_position_size

Cost: $0.003 | Calculate optimal position size using the G-formula (geometric growth optimization).

Parameters

ParameterTypeRequiredDescription
equitystringYesAccount equity in USD (e.g. "100000").
entry_pricestringYesPlanned entry price (e.g. "185.50").
stop_pricestringYesStop loss price (e.g. "180.00").
directionstringYes"long" or "short".
risk_percentstringNoRisk as decimal (e.g. "0.02" for 2%). Defaults to 2%.

Example

result = client.calculate_position_size(
    equity="100000",
    entry_price="185.50",
    stop_price="180.00",
    direction="long",
)

Response

{
  "shares": 363,
  "risk_amount": "2000.00",
  "risk_percent": "0.02",
  "notional": "67351.50",
  "one_r_dollars": "2000.00",
  "direction": "long"
}
FieldTypeDescription
sharesintNumber of shares to trade.
risk_amountstringDollar amount at risk (equity * risk_percent).
risk_percentstringActual risk fraction applied.
notionalstringTotal position value (shares * entry_price).
one_r_dollarsstringDollar value of one R-unit (risk per share * shares).
directionstringTrade direction.

check_trade_risk

Cost: $0.004 | Validate a proposed trade against Iron Fist risk rules.

Checks: single position risk, portfolio-level risk, daily loss limits, and position count constraints.

Parameters

ParameterTypeRequiredDescription
symbolstringYesInstrument symbol (e.g. "AAPL").
directionstringYes"long" or "short".
entry_pricestringYesEntry price.
stop_pricestringYesStop loss price.
quantitystringYesNumber of shares/contracts.
equitystringYesAccount equity in USD.
daily_pnlstringNoDaily P&L so far. Defaults to "0".

Example

result = client.check_risk(
    symbol="AAPL",
    direction="long",
    entry_price="185.50",
    stop_price="180.00",
    quantity="100",
    equity="100000",
)
 
if result["approved"]:
    print(f"Trade approved. Risk score: {result['score']}")
else:
    print(f"Trade rejected: {result['errors']}")

Response

{
  "approved": true,
  "score": 85,
  "errors": [],
  "warnings": [],
  "risk_amount": "550.00",
  "risk_percent": "0.0055"
}
FieldTypeDescription
approvedbooltrue if the trade passes all risk rules.
scoreintRisk score from 0 (worst) to 100 (best).
errorsstring[]Blocking issues. Non-empty means trade rejected.
warningsstring[]Non-blocking concerns. Trade approved but review recommended.
risk_amountstringDollar risk for this trade.
risk_percentstringRisk as a fraction of equity.

evaluate_performance

Cost: $0.10 (basic), $0.50 (full), $1.00 (comprehensive) | Evaluate trading system performance using G-metric analysis.

Three evaluation tiers provide increasing depth of analysis.

Parameters

ParameterTypeRequiredDescription
r_multiplesstring[]YesR-multiples from trade history (minimum 2).
tierstringNo"basic", "full", or "comprehensive". Defaults to "basic".
window_sizeintNoRolling window size. Defaults to 10.

Basic tier ($0.10)

result = client.basic_eval(
    r_multiples=["1.5", "-1.0", "2.3", "-0.5", "1.8", "-1.0", "3.2", "0.8"],
)
{
  "g": "0.0847",
  "expected_r": "0.7875",
  "variance": "2.1543",
  "volatility": "1.4678",
  "trade_count": 8,
  "verdict": "POSITIVE_EDGE"
}

Full tier ($0.50)

Adds System R Score (0 to 100 composite grade) and rolling G trend analysis.

result = client.full_eval(
    r_multiples=["1.5", "-1.0", "2.3", "-0.5", "1.8", "-1.0", "3.2", "0.8"],
    window_size=5,
)
{
  "g": "0.0847",
  "expected_r": "0.7875",
  "variance": "2.1543",
  "volatility": "1.4678",
  "trade_count": 8,
  "verdict": "POSITIVE_EDGE",
  "score": 72,
  "score_grade": "B",
  "rolling_g_trend": "IMPROVING",
  "rolling_g_slope": "0.0032"
}

Comprehensive tier ($1.00)

Adds score component breakdown and next-trade G impact analysis.

{
  "g": "0.0847",
  "expected_r": "0.7875",
  "variance": "2.1543",
  "volatility": "1.4678",
  "trade_count": 8,
  "verdict": "POSITIVE_EDGE",
  "score": 72,
  "score_grade": "B",
  "score_components": {
    "g_metric": 18,
    "consistency": 15,
    "risk_management": 14,
    "expectancy": 13,
    "drawdown_resilience": 12
  },
  "rolling_g_trend": "IMPROVING",
  "rolling_g_slope": "0.0032",
  "g_impact_next_win": "0.0912",
  "g_impact_next_loss": "0.0783"
}

get_pricing

Cost: Free | Get current pricing for all operations. No authentication required.

Example

pricing = client.get_pricing()
for operation, cost in pricing["prices"].items():
    print(f"{operation}: ${cost}")

Response

{
  "prices": {
    "position_sizing": "0.003",
    "risk_check": "0.004",
    "basic_eval": "0.10",
    "full_eval": "0.50",
    "comprehensive_eval": "1.00",
    "pre_trade_gate": "0.01",
    "assess_trading_system": "2.00",
    "...": "..."
  },
  "currency": "USDC"
}
System R AI
Python SDKpip install systemr
MCP Serveragents.systemr.ai/mcp/sse
OpenAPI Specagents.systemr.ai/openapi.json
Machine Docsagents.systemr.ai/llms.txt
GitHubSystem-R-AI
X@Systemrai
YouTube@systemr_ai
Emailhello@systemr.ai
Phone628 333 6693
Address7901 4TH ST N, STE 28529, ST PETERSBURG, FL 33702
TermsTerms of Service
PrivacyPrivacy Policy
SecuritySecurity Policy
© 2026 System R AI. Software platform. Not financial advice.

On this page