@@ -1144,3 +1144,264 @@ func createCancelAccountUpdatesMultiRequestProto(reqID int64) *protobuf.CancelAc
11441144
11451145 return cancelAccountUpdatesMultiProto
11461146}
1147+
1148+ func createHistoricalDataRequestProto (reqID int64 , contract * Contract , endDateTime string , duration string ,
1149+ barSizeSetting string , whatToShow string , useRTH bool , formatDate int , keepUpToDate bool , chartOptionsList []TagValue ) * protobuf.HistoricalDataRequest {
1150+
1151+ historicalDataRequestProto := & protobuf.HistoricalDataRequest {}
1152+
1153+ if isValidInt64Value (reqID ) {
1154+ id := int32 (reqID )
1155+ historicalDataRequestProto .ReqId = & id
1156+ }
1157+
1158+ order := & Order {}
1159+ historicalDataRequestProto .Contract = createContractProto (contract , order )
1160+
1161+ if ! stringIsEmpty (endDateTime ) {
1162+ historicalDataRequestProto .EndDateTime = & endDateTime
1163+ }
1164+
1165+ if ! stringIsEmpty (duration ) {
1166+ historicalDataRequestProto .Duration = & duration
1167+ }
1168+
1169+ if ! stringIsEmpty (barSizeSetting ) {
1170+ historicalDataRequestProto .BarSizeSetting = & barSizeSetting
1171+ }
1172+
1173+ if ! stringIsEmpty (whatToShow ) {
1174+ historicalDataRequestProto .WhatToShow = & whatToShow
1175+ }
1176+
1177+ if useRTH {
1178+ historicalDataRequestProto .UseRTH = & useRTH
1179+ }
1180+
1181+ if isValidInt64Value (int64 (formatDate )) {
1182+ formatDate := int32 (formatDate )
1183+ historicalDataRequestProto .FormatDate = & formatDate
1184+ }
1185+
1186+ if keepUpToDate {
1187+ historicalDataRequestProto .KeepUpToDate = & keepUpToDate
1188+ }
1189+
1190+ chartOptionsMap := createStringStringMap (chartOptionsList )
1191+ if len (chartOptionsMap ) > 0 {
1192+ historicalDataRequestProto .ChartOptions = chartOptionsMap
1193+ }
1194+
1195+ return historicalDataRequestProto
1196+ }
1197+
1198+ func createRealTimeBarsRequestProto (reqID int64 , contract * Contract , barSize int , whatToShow string , useRTH bool ,
1199+ realTimeBarsOptionsList []TagValue ) * protobuf.RealTimeBarsRequest {
1200+
1201+ realTimeBarsRequestProto := & protobuf.RealTimeBarsRequest {}
1202+
1203+ if isValidInt64Value (reqID ) {
1204+ id := int32 (reqID )
1205+ realTimeBarsRequestProto .ReqId = & id
1206+ }
1207+
1208+ order := & Order {}
1209+ realTimeBarsRequestProto .Contract = createContractProto (contract , order )
1210+
1211+ if isValidInt64Value (int64 (barSize )) {
1212+ barSize := int32 (barSize )
1213+ realTimeBarsRequestProto .BarSize = & barSize
1214+ }
1215+
1216+ if ! stringIsEmpty (whatToShow ) {
1217+ realTimeBarsRequestProto .WhatToShow = & whatToShow
1218+ }
1219+
1220+ if useRTH {
1221+ realTimeBarsRequestProto .UseRTH = & useRTH
1222+ }
1223+
1224+ realTimeBarsOptionsMap := createStringStringMap (realTimeBarsOptionsList )
1225+ if len (realTimeBarsOptionsMap ) > 0 {
1226+ realTimeBarsRequestProto .RealTimeBarsOptions = realTimeBarsOptionsMap
1227+ }
1228+
1229+ return realTimeBarsRequestProto
1230+ }
1231+
1232+ func createHeadTimestampRequestProto (reqID int64 , contract * Contract , whatToShow string , useRTH bool , formatDate int ) * protobuf.HeadTimestampRequest {
1233+ headTimestampRequestProto := & protobuf.HeadTimestampRequest {}
1234+
1235+ if isValidInt64Value (reqID ) {
1236+ id := int32 (reqID )
1237+ headTimestampRequestProto .ReqId = & id
1238+ }
1239+
1240+ order := & Order {}
1241+ headTimestampRequestProto .Contract = createContractProto (contract , order )
1242+
1243+ if ! stringIsEmpty (whatToShow ) {
1244+ headTimestampRequestProto .WhatToShow = & whatToShow
1245+ }
1246+
1247+ if useRTH {
1248+ headTimestampRequestProto .UseRTH = & useRTH
1249+ }
1250+
1251+ if isValidInt64Value (int64 (formatDate )) {
1252+ formatDate := int32 (formatDate )
1253+ headTimestampRequestProto .FormatDate = & formatDate
1254+ }
1255+
1256+ return headTimestampRequestProto
1257+ }
1258+
1259+ func createHistogramDataRequestProto (reqID int64 , contract * Contract , useRTH bool , timePeriod string ) * protobuf.HistogramDataRequest {
1260+ histogramDataRequestProto := & protobuf.HistogramDataRequest {}
1261+
1262+ if isValidInt64Value (reqID ) {
1263+ id := int32 (reqID )
1264+ histogramDataRequestProto .ReqId = & id
1265+ }
1266+
1267+ order := & Order {}
1268+ histogramDataRequestProto .Contract = createContractProto (contract , order )
1269+
1270+ if useRTH {
1271+ histogramDataRequestProto .UseRTH = & useRTH
1272+ }
1273+
1274+ if ! stringIsEmpty (timePeriod ) {
1275+ histogramDataRequestProto .TimePeriod = & timePeriod
1276+ }
1277+
1278+ return histogramDataRequestProto
1279+ }
1280+
1281+ func createHistoricalTicksRequestProto (reqID int64 , contract * Contract , startDateTime string ,
1282+ endDateTime string , numberOfTicks int , whatToShow string , useRTH bool , ignoreSize bool , miscOptionsList []TagValue ) * protobuf.HistoricalTicksRequest {
1283+
1284+ historicalTicksRequestProto := & protobuf.HistoricalTicksRequest {}
1285+
1286+ if isValidInt64Value (reqID ) {
1287+ id := int32 (reqID )
1288+ historicalTicksRequestProto .ReqId = & id
1289+ }
1290+
1291+ order := & Order {}
1292+ historicalTicksRequestProto .Contract = createContractProto (contract , order )
1293+
1294+ if ! stringIsEmpty (startDateTime ) {
1295+ historicalTicksRequestProto .StartDateTime = & startDateTime
1296+ }
1297+
1298+ if ! stringIsEmpty (endDateTime ) {
1299+ historicalTicksRequestProto .EndDateTime = & endDateTime
1300+ }
1301+
1302+ if isValidInt64Value (int64 (numberOfTicks )) {
1303+ numberOfTicks := int32 (numberOfTicks )
1304+ historicalTicksRequestProto .NumberOfTicks = & numberOfTicks
1305+ }
1306+
1307+ if ! stringIsEmpty (whatToShow ) {
1308+ historicalTicksRequestProto .WhatToShow = & whatToShow
1309+ }
1310+
1311+ if useRTH {
1312+ historicalTicksRequestProto .UseRTH = & useRTH
1313+ }
1314+
1315+ if ignoreSize {
1316+ historicalTicksRequestProto .IgnoreSize = & ignoreSize
1317+ }
1318+
1319+ miscOptionsMap := createStringStringMap (miscOptionsList )
1320+ if len (miscOptionsMap ) > 0 {
1321+ historicalTicksRequestProto .MiscOptions = miscOptionsMap
1322+ }
1323+
1324+ return historicalTicksRequestProto
1325+ }
1326+
1327+ func createTickByTickRequestProto (reqID int64 , contract * Contract , tickType string , numberOfTicks int64 , ignoreSize bool ) * protobuf.TickByTickRequest {
1328+ tickByTickRequestProto := & protobuf.TickByTickRequest {}
1329+
1330+ if isValidInt64Value (reqID ) {
1331+ id := int32 (reqID )
1332+ tickByTickRequestProto .ReqId = & id
1333+ }
1334+
1335+ order := & Order {}
1336+ tickByTickRequestProto .Contract = createContractProto (contract , order )
1337+
1338+ if ! stringIsEmpty (tickType ) {
1339+ tickByTickRequestProto .TickType = & tickType
1340+ }
1341+
1342+ if isValidInt64Value (numberOfTicks ) {
1343+ numberOfTicks := int32 (numberOfTicks )
1344+ tickByTickRequestProto .NumberOfTicks = & numberOfTicks
1345+ }
1346+
1347+ if ignoreSize {
1348+ tickByTickRequestProto .IgnoreSize = & ignoreSize
1349+ }
1350+
1351+ return tickByTickRequestProto
1352+ }
1353+
1354+ func createCancelHistoricalDataProto (reqID int64 ) * protobuf.CancelHistoricalData {
1355+ cancelHistoricalDataProto := & protobuf.CancelHistoricalData {}
1356+
1357+ if isValidInt64Value (reqID ) {
1358+ id := int32 (reqID )
1359+ cancelHistoricalDataProto .ReqId = & id
1360+ }
1361+
1362+ return cancelHistoricalDataProto
1363+ }
1364+
1365+ func createCancelRealTimeBarsProto (reqID int64 ) * protobuf.CancelRealTimeBars {
1366+ cancelRealTimeBarsProto := & protobuf.CancelRealTimeBars {}
1367+
1368+ if isValidInt64Value (reqID ) {
1369+ id := int32 (reqID )
1370+ cancelRealTimeBarsProto .ReqId = & id
1371+ }
1372+
1373+ return cancelRealTimeBarsProto
1374+ }
1375+
1376+ func createCancelHeadTimestampProto (reqID int64 ) * protobuf.CancelHeadTimestamp {
1377+ cancelHeadTimestampProto := & protobuf.CancelHeadTimestamp {}
1378+
1379+ if isValidInt64Value (reqID ) {
1380+ id := int32 (reqID )
1381+ cancelHeadTimestampProto .ReqId = & id
1382+ }
1383+
1384+ return cancelHeadTimestampProto
1385+ }
1386+
1387+ func createCancelHistogramDataProto (reqID int64 ) * protobuf.CancelHistogramData {
1388+ cancelHistogramDataProto := & protobuf.CancelHistogramData {}
1389+
1390+ if isValidInt64Value (reqID ) {
1391+ id := int32 (reqID )
1392+ cancelHistogramDataProto .ReqId = & id
1393+ }
1394+
1395+ return cancelHistogramDataProto
1396+ }
1397+
1398+ func createCancelTickByTickProto (reqID int64 ) * protobuf.CancelTickByTick {
1399+ cancelTickByTickProto := & protobuf.CancelTickByTick {}
1400+
1401+ if isValidInt64Value (reqID ) {
1402+ id := int32 (reqID )
1403+ cancelTickByTickProto .ReqId = & id
1404+ }
1405+
1406+ return cancelTickByTickProto
1407+ }
0 commit comments