syntax = "proto2";
package Qot_GetOptionUnderlyingHisStatistic;
option java_package = "com.futu.openapi.pb";

import "Common.proto";
import "Qot_Common.proto";
import "Qot_OptionCommon.proto";

//每日统计数据
message DailyStatistic
{
    required string time = 1; //交易日时间字符串
    optional double timestamp = 2; //交易日时间戳
    optional int64 optionVolume = 3; //期权总成交量（callVolume + putVolume）
    required int64 callVolume = 4; //看涨期权成交量
    required int64 putVolume = 5; //看跌期权成交量
    optional double putCallVolumeRatio = 6; //Put/Call成交量比（putVolume / callVolume）
    optional int64 optionOpenInterest = 7; //期权总持仓量（callOpenInterest + putOpenInterest）
    required int64 callOpenInterest = 8; //看涨期权持仓量（T-1延迟）
    required int64 putOpenInterest = 9; //看跌期权持仓量（T-1延迟）
    optional double putCallOpenInterestRatio = 10; //Put/Call持仓量比（putOpenInterest / callOpenInterest）
    optional double underlyingPrice = 11; //标的价格
}

message C2S
{
    required Qot_Common.Security owner = 1; //期权标的股
    optional int32 indexOptionType = 2; //Qot_Common.IndexOptionType，指数期权的类型，仅用于恒指国指
    required string beginTime = 3; //开始时间字符串
    required string endTime = 4; //结束时间字符串
    optional bytes nextPageKey = 5; //分页请求的key，如果不是翻页请求，不需要填
}

message S2C
{
    required Qot_Common.Security owner = 1; //期权标的股
    optional string code = 2; //股票代码
    optional string name = 3; //股票名称
    repeated DailyStatistic statisticList = 4; //统计数据列表，按交易日降序排列
    optional bytes nextPageKey = 5; //分页请求的key，如果还有更多数据，会返回此字段
}

message Request
{
    required C2S c2s = 1;
}

message Response
{
    required int32 retType = 1 [default = -400]; //RetType，返回结果
    optional string retMsg = 2;
    optional int32 errCode = 3;
    optional S2C s2c = 4;
}
