feat(breadth): add market breadth history chart (#2932)

This commit is contained in:
Elie Habib
2026-04-11 17:54:26 +04:00
committed by GitHub
parent d33ac8bd01
commit 46c35e6073
24 changed files with 892 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
syntax = "proto3";
package worldmonitor.market.v1;
import "sebuf/http/annotations.proto";
message GetMarketBreadthHistoryRequest {}
message BreadthSnapshot {
string date = 1;
// Optional so a missing/failed Barchart reading serializes as JSON null
// instead of collapsing to 0, which would render identically to a real 0%
// reading (severe market dislocation with no S&P stocks above SMA).
optional double pct_above_20d = 2;
optional double pct_above_50d = 3;
optional double pct_above_200d = 4;
}
message GetMarketBreadthHistoryResponse {
optional double current_pct_above_20d = 1;
optional double current_pct_above_50d = 2;
optional double current_pct_above_200d = 3;
string updated_at = 4;
repeated BreadthSnapshot history = 5;
bool unavailable = 6;
}

View File

@@ -23,6 +23,7 @@ import "worldmonitor/market/v1/get_fear_greed_index.proto";
import "worldmonitor/market/v1/list_earnings_calendar.proto";
import "worldmonitor/market/v1/get_cot_positioning.proto";
import "worldmonitor/market/v1/get_insider_transactions.proto";
import "worldmonitor/market/v1/get_market_breadth_history.proto";
// MarketService provides APIs for financial market data from Finnhub, Yahoo Finance, and CoinGecko.
service MarketService {
@@ -127,4 +128,9 @@ service MarketService {
rpc GetInsiderTransactions(GetInsiderTransactionsRequest) returns (GetInsiderTransactionsResponse) {
option (sebuf.http.config) = {path: "/get-insider-transactions", method: HTTP_METHOD_GET};
}
// GetMarketBreadthHistory retrieves historical % of S&P 500 stocks above 20/50/200-day SMAs.
rpc GetMarketBreadthHistory(GetMarketBreadthHistoryRequest) returns (GetMarketBreadthHistoryResponse) {
option (sebuf.http.config) = {path: "/get-market-breadth-history", method: HTTP_METHOD_GET};
}
}