syntax = "proto2";
package Qot_RequestHistoryKL;
option java_package = "com.futu.openapi.pb";
option go_package = "github.com/futuopen/ftapi4go/pb/qotrequesthistorykl";

import "Common.proto";
import "Qot_Common.proto";

message C2S
{
	required int32 rehabType = 1; //Qot_Common.RehabType,复权类型
	required int32 klType = 2; //Qot_Common.KLType,K线类型
	required Qot_Common.Security security = 3; //股票市场以及股票代码
	required string beginTime = 4; //开始时间字符串
	required string endTime = 5; //结束时间字符串
	optional int32 maxAckKLNum = 6; //最多返回多少根K线，如果未指定表示不限制
	optional int64 needKLFieldsFlag = 7; //指定返回K线结构体特定某几项数据，KLFields枚举值或组合，如果未指定返回全部字段
	optional bytes nextReqKey = 8; //分页请求key
	optional bool extendedTime = 9;  //是否获取美股盘前盘后数据，仅支持 60 分钟及以下级别
	optional int32 session = 10; //Qot_Common.Session, 美股盘前盘后数据，仅支持 60 分钟及以下级别
}

message S2C
{
	required Qot_Common.Security security = 1;
	optional string name = 4; // 股票名称
	repeated Qot_Common.KLine klList = 2; //K线数据
	optional bytes nextReqKey = 3; //分页请求key。一次请求没有返回所有数据时，下次请求带上这个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;
}
