Skip to content

Formulas and Calculations

TrGo TradeControl Try for free Start Free 14-Day Trial

Calculations use the active instrument’s PointValue and instrument rules. PointValue is the cash value of a one-point price movement per contract or unit; tickSize is the minimum price increment. These are NinjaTrader MasterInstrument properties.

  • tick_distance = abs(price_a - price_b) / tickSize
  • risk_per_unit = abs(entry - stop) * PointValue
  • reward_per_unit = abs(target - entry) * PointValue
  • tickValue = tickSize * PointValue; the equivalent tick-based calculation is tick_distance * tickValue.
  • rr = reward_per_unit / risk_per_unit, when both values are available and risk is greater than zero.

Without a stop, stop-based risk and R:R cannot be calculated. This does not by itself prevent Qty or manual trading; the selected sizing mode and enabled risk rules determine whether a stop is required.

Risk-based sizing first calculates a raw quantity, then normalizes it using the instrument’s quantity increment and minimum:

  • raw_quantity = risk_budget_cash / risk_per_unit
  • quantity = normalize(raw_quantity, quantity_increment, minimum_quantity)
  • risk_total_cash = risk_per_unit * quantity

normalize here describes the instrument’s sizing rules, not a universal floor() to whole contracts. The calculation engine supports fractional increments. The current TradeControl form for NinjaTrader separately requires a positive integer quantity when sending. Calculation and submission have distinct quantity rules; the normalized quantity must satisfy the applicable rules before submission.

A displayed percentage of 1 means 1%, or the decimal fraction 0.01:

  • risk_fraction = risk_total_cash / account_balance
  • risk_pct_display = 100 * risk_fraction
  • risk_budget_cash = account_balance * (risk_pct_budget_display / 100)

For example, a balance of 10,000 and a displayed budget of 1% gives a cash budget of 100. A cash risk of 100 is displayed as 1%, not 0.01%. Percentage calculations require a valid, positive balance and monetary amounts in the same currency.

The instrument calculations above produce amounts in the instrument’s currency. Account-based budgets and limits must use compatible monetary values. When the instrument and account currencies differ, explicit conversion data is required. TradeControl does not assume an FX rate or perform an implicit FX conversion; unavailable conversion data leaves the affected calculation or check Pending/Warning and prevents submission when it is required.

  • Direction: long if target > entry; short if target < entry; if Stop crosses Entry, the role is flipped to stay consistent.
  • Market vs Pending is selected explicitly by the user in Order Type. Moving Entry closer to or farther from the market does not change that selection.
  • For Pending, the entry price relative to the market and the trade direction determine whether the order is Limit or Stop. The stop-limit option applies to stop orders.

Required data depends on the selected mode. Enabled risk rules can add requirements beyond sizing:

  • Qty / Contracts and manual trading: can operate without a stop. Qty sizing does not require account balance or monetary instrument metadata; a valid quantity and the applicable order and instrument rules still apply.
  • Risk amount / Risk $: requires a valid stop with a nonzero entry-to-stop distance, the cash budget, and the instrument data needed to calculate monetary risk, primarily PointValue and quantity rules. Balance is not required for cash sizing itself.
  • Risk %: requires the Risk amount inputs plus a valid, positive account balance. The displayed percentage is divided by 100.
  • Max risk per trade and Risk vs equity: require a stop when enabled, including in Qty or manual mode. Risk vs equity also requires equity and existing stop-risk data; a percentage limit for per-trade risk requires balance.

Quantities must be finite, positive, and compatible with the instrument’s increment and minimum. NaN, Infinity, negative values, and zero quantities cannot be submitted. The current TradeControl form for NinjaTrader also validates integer quantity at submission.

Missing required market, instrument, account, or conversion data is Pending/Warning. It prevents submission until the required data is available, but it is not a confirmed rule violation and does not trigger the circuit breaker. Unneeded monetary or balance data does not make Qty sizing invalid.

An enabled numerical risk rule uses the entered value as its limit, including zero. Only disabling the rule skips it. A zero risk limit still requires the data needed to evaluate the rule.

  • Risk and reward are based on active NinjaTrader 8 instrument values; they do not include commissions or slippage.
  • The circuit breaker latches only when it is enabled and an attempted operation violates a risk rule. Editing inputs, recalculating, repainting, or inspecting Preflight does not latch it. Missing data does not latch it either.
  • A latched breaker blocks trading until Reset. Reset clears the latch; the operation must still pass the current checks. See Risk Gate Summary.
  • Panic cancels working/accepted orders and closes the position in the active instrument at market.
  • Measures: risk and reward from Entry/Stop/Target with instrument point values; quantity calculated from a budget and normalized to instrument rules; enabled checks for per-trade risk, risk vs equity, position size, nominal exposure, daily realized loss, stop coverage, and daily trend; Preflight and Risk Gate results and the separate circuit breaker state.
  • 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.