Aller au contenu
GET /v1/position-size

Position size & risk-reward

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/trading-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/trading-api/v1/position-size" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/trading-api/v1/position-size", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/trading-api/v1/position-size");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/trading-api/v1/position-size",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "data": {
        "note": "Units = (account × risk%) / |entry − stop|. The most you lose if the stop hits is the risk amount, whatever the instrument.",
        "inputs": {
            "entry": 1.2,
            "stop_loss": 1.195,
            "risk_percent": 1,
            "account_balance": 10000
        },
        "target": 1.21,
        "risk_amount": 100,
        "risk_per_unit": 0.005,
        "position_units": 20000,
        "position_value": 24000,
        "reward_per_unit": 0.01,
        "potential_reward": 200,
        "risk_reward_ratio": 2
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:46.717Z",
        "request_id": "46dcc8a7-2771-4ced-9c68-27738bffa1f5"
    },
    "status": "ok",
    "message": "Position size",
    "success": true
}