DocsRisk ManagementRisk / Reward

Risk / Reward

RatioRisk Management

The Risk/Reward node derives a stop-loss price and a take-profit price from the current entry price so that the trade has a defined R:R ratio. Given a stop-loss distance, the take-profit is placed at a proportionally larger distance on the profitable side. Default is 1:3.

Formula

TP %=stopLossPercent × (rewardRatio / riskRatio)
Stop Loss Price=close × (1 − stopLossPercent / 100)
Take Profit Price=close × (1 + TP% / 100)

With defaults (SL = 2%, risk = 1, reward = 3): TP% = 2 × (3/1) = 6%. On a $100 entry: SL = $98, TP = $106, risk = $2, reward = $6.

Parameters

NameTypeDefaultDescription
stopLossPercentnumber2.0Percentage below entry where the stop loss is placed. Controls the risk side of the ratio.
riskRationumber1Risk side of the ratio (numerator). Typically 1.
rewardRationumber3Reward side of the ratio (denominator). Higher values push the TP further from entry.

Inputs & Outputs

PortTypeDescription
Input
input(number | null)[]Close price series used as entry reference.
Outputs
entryPricenumber | nullLast valid close price.
stopLossPricenumber | nullStop level at the most recent bar.
takeProfitPricenumber | nullTake profit level at the most recent bar.
riskRewardRatiostringFormatted ratio string, e.g. "1:3".
riskAmountnumber | nullentryPrice − stopLossPrice (per-unit risk in price terms).
rewardAmountnumber | nulltakeProfitPrice − entryPrice (per-unit reward in price terms).
values(number | null)[]Per-bar stop loss price array (same index as input).
timestampsnumber[]UNIX ms timestamps.

Use Cases

Enforce minimum R:R before entry

Compare rewardAmount / riskAmount against a minimum threshold (e.g. 2.5). Only allow trades where the calculated ratio meets the floor, filtering setups that don't justify the risk.

Combined with Position Sizing

Use Risk/Reward to get the stop-loss price, then feed riskAmount into a Position Sizing calculation together with account equity to determine how many units to trade at the defined R:R.