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; uint32 window = 2; // 指标窗口大小 SeriesRange series = 9; } message RspIndicatorSeries{ repeated double matrix = 1; repeated int64 times = 2; } message ReqStrategySeries { SeriesRange series = 1; string sigStrategy = 2; map sigParam = 3; // 策略参数 } message RspStrategySeries { repeated Side signal = 1; // 0.sell,1.buy repeated int64 times = 2; repeated bool wins = 3; // 下一根k线价格方向是否正确 double winRate = 4; }