Calculate position size
curl --request POST \
--url https://api.example.com/api/graph/v1/risk/position-size \
--header 'Content-Type: application/json' \
--data '
{
"account_value": 1,
"tier": 2,
"stop_loss_pct": 0.5,
"confluence": "<string>",
"day_type": "<string>",
"vix_regime": "<string>"
}
'import requests
url = "https://api.example.com/api/graph/v1/risk/position-size"
payload = {
"account_value": 1,
"tier": 2,
"stop_loss_pct": 0.5,
"confluence": "<string>",
"day_type": "<string>",
"vix_regime": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
account_value: 1,
tier: 2,
stop_loss_pct: 0.5,
confluence: '<string>',
day_type: '<string>',
vix_regime: '<string>'
})
};
fetch('https://api.example.com/api/graph/v1/risk/position-size', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/risk/position-size",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_value' => 1,
'tier' => 2,
'stop_loss_pct' => 0.5,
'confluence' => '<string>',
'day_type' => '<string>',
'vix_regime' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/risk/position-size"
payload := strings.NewReader("{\n \"account_value\": 1,\n \"tier\": 2,\n \"stop_loss_pct\": 0.5,\n \"confluence\": \"<string>\",\n \"day_type\": \"<string>\",\n \"vix_regime\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/graph/v1/risk/position-size")
.header("Content-Type", "application/json")
.body("{\n \"account_value\": 1,\n \"tier\": 2,\n \"stop_loss_pct\": 0.5,\n \"confluence\": \"<string>\",\n \"day_type\": \"<string>\",\n \"vix_regime\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/risk/position-size")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_value\": 1,\n \"tier\": 2,\n \"stop_loss_pct\": 0.5,\n \"confluence\": \"<string>\",\n \"day_type\": \"<string>\",\n \"vix_regime\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"max_risk_dollars": 123,
"max_contracts": 123,
"combined_modifier": 123,
"rationale": "<string>",
"inputs": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Risk Management
Calculate position size
Calculate position size with all modifiers applied.
## Position Sizing Formula
max_risk_dollars = base_risk × account_value × combined_modifier
max_contracts = max_risk_dollars / (premium × stop_loss_pct)
## Modifiers Applied
1. **Confluence Grade**: EXCELLENT (1.0) → POOR (0.25)
2. **Day Type**: trending (1.0), rotational (0.75), uncertain (0.5)
3. **VIX Regime**: low_complacent (0.8), normal (1.0), elevated (0.75), fear (0.5)
4. **Conviction Level**: Based on signal scoring
## Base Risk by Tier
| Tier | Base Risk |
|------|-----------|
| 1 | 1.0% |
| 2 | 1.0% |
| 3 | 0.75% |
## Performance Target
<100ms response time.
POST
/
api
/
graph
/
v1
/
risk
/
position-size
Calculate position size
curl --request POST \
--url https://api.example.com/api/graph/v1/risk/position-size \
--header 'Content-Type: application/json' \
--data '
{
"account_value": 1,
"tier": 2,
"stop_loss_pct": 0.5,
"confluence": "<string>",
"day_type": "<string>",
"vix_regime": "<string>"
}
'import requests
url = "https://api.example.com/api/graph/v1/risk/position-size"
payload = {
"account_value": 1,
"tier": 2,
"stop_loss_pct": 0.5,
"confluence": "<string>",
"day_type": "<string>",
"vix_regime": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
account_value: 1,
tier: 2,
stop_loss_pct: 0.5,
confluence: '<string>',
day_type: '<string>',
vix_regime: '<string>'
})
};
fetch('https://api.example.com/api/graph/v1/risk/position-size', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/risk/position-size",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_value' => 1,
'tier' => 2,
'stop_loss_pct' => 0.5,
'confluence' => '<string>',
'day_type' => '<string>',
'vix_regime' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/risk/position-size"
payload := strings.NewReader("{\n \"account_value\": 1,\n \"tier\": 2,\n \"stop_loss_pct\": 0.5,\n \"confluence\": \"<string>\",\n \"day_type\": \"<string>\",\n \"vix_regime\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/graph/v1/risk/position-size")
.header("Content-Type", "application/json")
.body("{\n \"account_value\": 1,\n \"tier\": 2,\n \"stop_loss_pct\": 0.5,\n \"confluence\": \"<string>\",\n \"day_type\": \"<string>\",\n \"vix_regime\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/risk/position-size")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_value\": 1,\n \"tier\": 2,\n \"stop_loss_pct\": 0.5,\n \"confluence\": \"<string>\",\n \"day_type\": \"<string>\",\n \"vix_regime\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"max_risk_dollars": 123,
"max_contracts": 123,
"combined_modifier": 123,
"rationale": "<string>",
"inputs": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request for position sizing calculation.
Required range:
x > 0Account tier (1, 2, or 3)
Required range:
1 <= x <= 3Stop loss as decimal (0.40 = 40%)
Required range:
0 < x <= 1EXCELLENT, GOOD, MODERATE, WEAK, POOR
trending, rotational, uncertain
low_complacent, normal, elevated, fear