Skip to content

Formulas and Calculations

TrGo TradeControl Try for free Start Free 30-Day Trial
  • tick_distance = abs(price_a - price_b) / tickSize
  • risk_per_contract = (abs(entry - stop) / tickSize) * tickValue
  • reward_per_contract = (abs(target - entry) / tickSize) * tickValue
  • rr = reward_per_contract / risk_per_contract (if risk is 0, result is invalid)
  • quantity_from_cash = floor(risk_budget_cash / risk_per_contract)
  • risk_total_cash = risk_per_contract * quantity
  • risk_pct = risk_total_cash / account_balance
  • Budget by %: risk_budget_cash = account_balance * risk_pct_budget
  • Direction: long if target > entry; short if target < entry; if Stop crosses Entry, the role is flipped to stay consistent.
  • Market vs Pending: near-market sends a Market order; distant entries use a pending order (limit/stop) with optional StopLimit enforcement.
  • Stop required and minimum distance > 0.
  • Quantity must be an integer and > 0; NaN, Infinity, and negatives are rejected.
  • If tickSize, tickValue, or account data is missing, Preflight is marked invalid and Risk Gate blocks submission.
  • Risk and reward are based on active NinjaTrader 8 instrument values; they do not include commissions or slippage.
  • The circuit breaker activates when a critical rule fails and blocks until you press Reset.
  • Panic cancels working/accepted orders and closes the position in the active instrument at market.
  • Measures: risk and reward from Entry/Stop/Target with official tick/point values; suggested quantity by budget; guardrail checks (margin, position, exposure, daily loss, stop present); Preflight and Risk Gate states.
  • Does not measure: slippage, commissions, or taxes; correlation between instruments or multi-symbol hedging; network latency or broker availability (if data is missing it is marked unavailable, not OK); licensing, versions, or diagnostics.