You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
syntax = "proto3"; |
|
|
|
import "api/pub.proto"; |
|
|
|
option go_package = "./pb"; |
|
|
|
service TradingService { |
|
rpc SubIndicator(IndicatorSubReq) returns (stream Indicator); // 订阅指标 |
|
rpc IndicatorSeries(ReqIndicatorSeries) returns (RspIndicatorSeries); // 获取指标序列 |
|
rpc StrategySeries(ReqStrategySeries) returns (RspStrategySeries); // 获取指标序列 |
|
} |
|
|
|
message IndicatorSubReq { |
|
string topic = 1; |
|
string instId = 2; |
|
int32 window = 3; |
|
} |
|
|
|
message Indicator { |
|
ExchangeType exhcange = 1; |
|
string instId = 2; |
|
string indicator = 3; |
|
string sub = 4; // 指标子标题, MA5, MA10, MA20 |
|
int64 Ts = 5; |
|
bytes payload = 8; |
|
} |
|
|
|
message ReqIndicatorSeries { |
|
string indicator = 1; |
|
int32 window = 2; // 指标窗口大小 |
|
ExchangeType exchange = 3; |
|
string instId = 4; |
|
string interval = 5; |
|
int64 before = 6; // 0表示最新 |
|
int64 after = 7; // 0表示最新 |
|
int32 count = 8; // k线条数,before或after其中一个为0时有效 |
|
} |
|
message RspIndicatorSeries{ |
|
repeated double matrix = 1; |
|
repeated int64 times = 2; |
|
} |
|
|
|
message ReqStrategySeries { |
|
string strategy = 1; |
|
ExchangeType exchange = 3; |
|
string instId = 4; |
|
string interval = 5; |
|
int64 before = 6; // 0表示最新 |
|
int64 after = 7; // 0表示最新 |
|
int32 count = 8; // k线条数,before或after其中一个为0时有效 |
|
} |
|
message RspStrategySeries { |
|
repeated int32 signal = 1; // 0.sell,1.buy |
|
repeated int64 times = 2; |
|
}
|
|
|