DocsRisk ManagementRisk Per Trade

Risk Per Trade

SizingRisk Management

The Risk Per Trade node converts a time-series of account equity values into a dollar risk budget at each bar. It applies a fixed percentage to the account value, giving you the maximum amount of money you should be willing to lose on any single trade at that point in time.

Formula

Risk Amount[i]=accountValue[i] × riskPercentage

riskPercentage is a decimal (default 0.01 = 1%). Null or NaN inputs produce null outputs. The calculation is applied element-wise across the entire windowed input series.

Parameters

NameTypeDefaultDescription
riskPercentagenumber0.01Fraction of account value to risk. Stored as a decimal: 0.01 = 1%, 0.02 = 2%. Typical range: 0.005–0.03.

Inputs & Outputs

PortTypeDescription
Input
input(number | null)[]Account equity series. Each value represents total account value at that bar.
Outputs
values(number | null)[]Per-bar dollar risk budget (accountValue[i] × riskPercentage). Null where input is null/NaN.
timestampsnumber[]UNIX ms timestamps aligned 1-to-1 with values.
riskPercentagenumberThe configured fraction (mirrored for downstream reference).

Live Update Behaviour

When the chart streamer is active (live mode), the node uses an incremental update path: it updates or appends only the last bar rather than recomputing the full series. This keeps CPU usage minimal during live sessions while keeping the risk budget current in real time.

Use Cases

Adaptive sizing as equity grows

Feed a live equity curve to Risk Per Trade. As the account grows, the risk budget increases proportionally — a natural compounding effect. During drawdown periods, the budget automatically shrinks, reducing exposure when the strategy is underperforming.

Input to Position Sizing

Pipe values from Risk Per Trade into the riskAmount slot of a custom Position Sizing calculation. This keeps the two nodes loosely coupled and makes it easy to adjust the risk percentage without touching the sizing logic.