|
|
@@ -314,7 +314,7 @@ func QueryTSData(c *gin.Context) {
|
|
|
}
|
|
|
// fmt.Printf("开始时间:%s 结束时间:%s\n", queryTSDataRsp.StartTime.Format(timeFormat), queryTSDataRsp.EndTime.Format(timeFormat))
|
|
|
|
|
|
- // 获取目标时间段的历史数据
|
|
|
+ // 获取目标时间段的历史数据(1分钟周期)
|
|
|
// 这里要注意:由于交易库和行情库由于GoodsCode大小写不一定对得上,所以在使用交易库的商品查询行情数据时间,都要使用OutGoodsCode字段
|
|
|
cycleDatas, err := models.GetHistoryCycleDatas(models.CycleTypeMinutes1, queryTSDataRsp.OutGoodsCode, &queryTSDataRsp.StartTime, &queryTSDataRsp.EndTime, 0, true)
|
|
|
if err != nil {
|
|
|
@@ -334,14 +334,14 @@ func QueryTSData(c *gin.Context) {
|
|
|
stt := time.Unix(int64(st), 0).Format("2006-01-02 15:04:05")
|
|
|
cycleDatas = append(cycleDatas, models.CycleData{
|
|
|
GC: cycleDatas[0].GC,
|
|
|
- Open: cycleDatas[0].Open,
|
|
|
- High: cycleDatas[0].High,
|
|
|
- Low: cycleDatas[0].Low,
|
|
|
+ Open: cycleDatas[0].Close,
|
|
|
+ High: cycleDatas[0].Close,
|
|
|
+ Low: cycleDatas[0].Close,
|
|
|
Close: cycleDatas[0].Close,
|
|
|
- TV: cycleDatas[0].TV,
|
|
|
- TT: cycleDatas[0].TT,
|
|
|
- HV: cycleDatas[0].HV,
|
|
|
- SP: cycleDatas[0].SP,
|
|
|
+ TV: 0,
|
|
|
+ TT: 0,
|
|
|
+ HV: 0,
|
|
|
+ SP: 0,
|
|
|
ST: st,
|
|
|
SST: stt,
|
|
|
FI: true,
|
|
|
@@ -376,14 +376,14 @@ func QueryTSData(c *gin.Context) {
|
|
|
stt := time.Unix(int64(st), 0).Format("2006-01-02 15:04:05")
|
|
|
cycleDatas = append(cycleDatas, models.CycleData{
|
|
|
GC: cycleDatas[index].GC,
|
|
|
- Open: cycleDatas[index].Open,
|
|
|
- High: cycleDatas[index].High,
|
|
|
- Low: cycleDatas[index].Low,
|
|
|
+ Open: cycleDatas[index].Close,
|
|
|
+ High: cycleDatas[index].Close,
|
|
|
+ Low: cycleDatas[index].Close,
|
|
|
Close: cycleDatas[index].Close,
|
|
|
- TV: cycleDatas[index].TV,
|
|
|
- TT: cycleDatas[index].TT,
|
|
|
- HV: cycleDatas[index].HV,
|
|
|
- SP: cycleDatas[index].SP,
|
|
|
+ TV: 0,
|
|
|
+ TT: 0,
|
|
|
+ HV: 0,
|
|
|
+ SP: 0,
|
|
|
ST: st,
|
|
|
SST: stt,
|
|
|
FI: true,
|
|
|
@@ -415,14 +415,14 @@ func QueryTSData(c *gin.Context) {
|
|
|
stt := time.Unix(int64(st), 0).Format("2006-01-02 15:04:05")
|
|
|
fillDatas = append(fillDatas, models.CycleData{
|
|
|
GC: cycleDatas[i-1].GC,
|
|
|
- Open: cycleDatas[i-1].Open,
|
|
|
- High: cycleDatas[i-1].High,
|
|
|
- Low: cycleDatas[i-1].Low,
|
|
|
+ Open: cycleDatas[i-1].Close,
|
|
|
+ High: cycleDatas[i-1].Close,
|
|
|
+ Low: cycleDatas[i-1].Close,
|
|
|
Close: cycleDatas[i-1].Close,
|
|
|
- TV: cycleDatas[i-1].TV,
|
|
|
- TT: cycleDatas[i-1].TT,
|
|
|
- HV: cycleDatas[i-1].HV,
|
|
|
- SP: cycleDatas[i-1].SP,
|
|
|
+ TV: 0,
|
|
|
+ TT: 0,
|
|
|
+ HV: 0,
|
|
|
+ SP: 0,
|
|
|
ST: st,
|
|
|
SST: stt,
|
|
|
FI: true,
|