blob: e4e32bad8d256f35b824f0ed3ce1ca93dfc8d1bc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
syntax = "proto3";
package idb.stock.v1;
import "google/longrunning/operations.proto";
import "google/protobuf/timestamp.proto";
import "google/type/money.proto";
// Stock represents a stock.
message Stock {
// The ticker symbol of the stock (e.g. "AAPL").
string symbol = 1;
// The name of the stock (e.g. "Apple Inc.").
string name = 2;
// The URL to the IBD page for the stock.
optional string ibd_url = 3;
// The most recent ratings for the stock.
StockRatings ratings = 4;
}
// StockListType represents the name of a stock list.
enum StockListType {
// Unspecified stock list type.
STOCK_LIST_TYPE_UNSPECIFIED = 0;
// The IBD50 stock list.
STOCK_LIST_TYPE_IBD50 = 1;
// The Cap20 stock list.
STOCK_LIST_TYPE_CAP20 = 2;
}
// LetterGrade represents a letter grade from E to A+.
enum LetterGrade {
LETTER_GRADE_UNSPECIFIED = 0;
LETTER_GRADE_A_PLUS = 1;
LETTER_GRADE_A = 2;
LETTER_GRADE_A_MINUS = 3;
LETTER_GRADE_B_PLUS = 4;
LETTER_GRADE_B = 5;
LETTER_GRADE_B_MINUS = 6;
LETTER_GRADE_C_PLUS = 7;
LETTER_GRADE_C = 8;
LETTER_GRADE_C_MINUS = 9;
LETTER_GRADE_D_PLUS = 10;
LETTER_GRADE_D = 11;
LETTER_GRADE_D_MINUS = 12;
LETTER_GRADE_E_PLUS = 13;
LETTER_GRADE_E = 14;
}
// StockRatings represents the ratings for a stock scraped from IBD.
message StockRatings {
// Unique identifier for this stock rating instance.
string id = 1;
// Ratings for the stock.
message Ratings {
// The composite rating. (1-99)
uint32 composite = 1;
// The EPS rating. (1-99)
uint32 eps = 2;
// The relative strength rating. (1-99)
uint32 relative_strength = 3;
// The group relative strength rating. (E-A+)
LetterGrade group_rel_strength = 4;
// The SMR rating. (E-A+)
LetterGrade smr = 5;
// The accumulation/distribution rating. (E-A+)
LetterGrade acc_dis = 6;
}
// The ratings for the stock.
Ratings ratings = 3;
// The price of the stock at the time of the ratings being scraped.
google.type.Money price = 4;
// The time the ratings were scraped.
google.protobuf.Timestamp last_update = 5;
// The chart analysis for the stock.
ChartAnalysis chart_analysis = 6;
}
// ChartAnalysis represents the chart analysis for a stock.
message ChartAnalysis {
// Unique identifier for this chart analysis instance.
string id = 1;
// The raw analysis.
string raw_analysis = 2;
}
message StockScrapeOperationMetadata {
string symbol = 1;
google.protobuf.Timestamp start_time = 2;
}
// StockService provides methods for interacting with stock data.
service StockService {
rpc CreateStock(CreateStockRequest) returns (CreateStockResponse) {
option (google.longrunning.operation_info) = {
response_type: "Stock"
metadata_type: "StockScrapeOperationMetadata"
};
}
// GetStock returns a stock by symbol.
rpc GetStock(GetStockRequest) returns (GetStockResponse);
// ListStocks returns a list of stocks.
rpc ListStocks(ListStocksRequest) returns (ListStocksResponse);
}
message CreateStockRequest {
string symbol = 1;
}
message CreateStockResponse {
google.longrunning.Operation operation = 1;
}
message GetStockRequest {
string symbol = 1;
}
message GetStockResponse {
Stock stock = 1;
}
message ListStocksRequest {
StockListType type = 1;
int32 page_size = 2;
string page_token = 3;
}
message ListStocksResponse {
repeated Stock stocks = 1;
google.protobuf.Timestamp last_update = 2;
string next_page_token = 3;
}
|