Get compression trend analysis
curl --request GET \
--url https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trendimport requests
url = "https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend', 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/stocks/{symbol}/compression/trend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"period_days": 123,
"trend_direction": "compressing",
"avg_compression_ratio": 123,
"min_compression_ratio": 123,
"max_compression_ratio": 123,
"nr7_count": 0,
"inside_day_count": 0,
"recent_avg_ratio": 123,
"earlier_avg_ratio": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Compression
Get compression trend analysis
Get volatility trend analysis for a stock.
## Trend Detection
Compares recent period (last N/2 days) to earlier period (first N/2 days):
- **compressing**: Recent avg ratio < earlier avg * 0.9
- **expanding**: Recent avg ratio > earlier avg * 1.1
- **stable**: Within 10% of earlier period
## Response Data
- Average, min, max compression ratios
- NR7 and inside day counts
- Trend direction with recent/earlier averages
## Query Parameters
- **days**: Analysis period (default: 20)
## Performance Target
<200ms response time.
GET
/
api
/
graph
/
v1
/
stocks
/
{symbol}
/
compression
/
trend
Get compression trend analysis
curl --request GET \
--url https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trendimport requests
url = "https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend', 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/stocks/{symbol}/compression/trend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/stocks/{symbol}/compression/trend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"period_days": 123,
"trend_direction": "compressing",
"avg_compression_ratio": 123,
"min_compression_ratio": 123,
"max_compression_ratio": 123,
"nr7_count": 0,
"inside_day_count": 0,
"recent_avg_ratio": 123,
"earlier_avg_ratio": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Query Parameters
Analysis period in days
Required range:
5 <= x <= 90Response
Trend analysis
Response for compression trend analysis endpoint.
Stock ticker symbol
Analysis period in days
Volatility trend: compressing (volatility decreasing), expanding (increasing), or stable
Available options:
compressing, expanding, stable Average ratio in recent half of period
Average ratio in earlier half of period