Decimals in. Decimals out.
Money, prices and quantities use decimal strings so the client does not introduce floating-point rounding.
01 / RISK API
Bring structured risk calculations to the point where a trader builds a plan. Six focused endpoints are available in the developer beta.
| Calculation | Inputs | Example result |
|---|---|---|
| Position size | Balance, risk budget, entry, stop, instrument and conversion basis | 0.33 lots · $99 modeled loss |
| Risk / reward | Entry, stop, target, direction; optional win rate | 3.0 R:R · 25% break-even win rate |
| Pip value | Lot size, pip size, contract and conversion basis | $10 per pip for one standard EURUSD lot in USD |
| Margin | Lots, entry, leverage and currency conversion | $3,616.67: one 100,000-unit EURUSD lot at 1.0850, USD account, 1:30 leverage |
| Break-even | Entry basis, spread, round-trip commission and direction | 1.08519: long entry 1.0850, spread excluded from entry, 1.2-pip spread, $7 round-trip commission per 100,000-unit lot; USD quote/account |
| ATR stop | Caller-supplied ATR, multiplier, entry and direction | 1.0760 for a 1.0850 long entry and 2 × 0.0045 ATR |
WORKED EXAMPLE / EURUSD
For a $10,000 account risking 1%, the budget is $100. The distance from 1.0850 to 1.0820 is 30 pips. At $10 per pip per standard lot, the raw size is one-third of a lot.
Flooring to a 0.01-lot step gives 0.33 lots, or 33,000 units. The modeled stop loss is $99.
Example assumes 100,000 base units per lot, USD account and quote currency, and no execution costs. This is a fixture, not a broker availability claim.
{
"account_balance": "10000.00",
"risk_percent": "1.0",
"entry_price": "1.0850",
"stop_loss_price": "1.0820",
"symbol": "EURUSD",
"instrument_type": "forex",
"contract_size": "100000",
"quote_to_account_rate": "1",
"lot_step": "0.01",
"minimum_lot": "0.01",
"account_currency": "USD",
"direction": "long"
}Money, prices and quantities use decimal strings so the client does not introduce floating-point rounding.
Quantity steps are explicit. A model must never round a position above the supplied risk budget.
Conversion rates, contract size, fees and entry basis matter. Unknown instrument metadata must not be guessed.
RELEASE BOUNDARY
Futures, stocks, crypto and broker-specific CFD models are later work. Liquidation estimates and options payoffs are outside the initial release.
Simple margin is a notional/leverage calculation. Actual broker margin, slippage, gaps and fees can differ from these examples.
Read the endpoint reference →BUILD WITH FYNX