hqchart 1.1.14947 → 1.1.14956

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55730,12 +55730,18 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55730
55730
  var symbol=data.Request.Data.symbol[0]; //请求的股票代码
55731
55731
  var callcation=data.Request.Data.callcation; //集合竞价
55732
55732
  var bBuySellBar=data.Request.Data.IsShowBuySellBar;
55733
- console.log(`[HQData::RequestMinuteData] Symbol=${symbol}`);
55733
+ console.log(`[HQData::RequestMinuteData] Symbol=${symbol}, Update=${data.Self.DataStatus.LatestDay}`);
55734
+
55735
+ if (data.Self.DataStatus.LatestDay) //增量更新模式
55736
+ {
55737
+ HQData.Minute_RequestMinuteUpdateData(data, callback);
55738
+ return;
55739
+ }
55734
55740
 
55735
55741
  setTimeout(()=>{
55736
55742
  var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
55737
55743
  var srcStock=fullData[0];
55738
- var stockItem={ date:srcStock.date, minute:srcStock.minute, yclose:srcStock.yclose, symbol:symbol, name:symbol };
55744
+ var stockItem={ date:srcStock.date, minute:srcStock.minute.slice(), yclose:srcStock.yclose, symbol:symbol, name:symbol };
55739
55745
 
55740
55746
  //盘前
55741
55747
  if (callcation.Before)
@@ -55763,6 +55769,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55763
55769
  stockItem.beforeinfo=beforeinfo;
55764
55770
  */
55765
55771
 
55772
+ /*
55766
55773
  var before=[];
55767
55774
  var beforeinfo={ totalcount:60*10, ver:2.0 }; //9:15-9:25 集合竞价15分钟 1s一个数据
55768
55775
  var price=srcStock.yclose+0.01;
@@ -55805,13 +55812,44 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55805
55812
  date.setSeconds(date.getSeconds()+1);
55806
55813
  before.push(item);
55807
55814
  }
55815
+ */
55816
+
55817
+ var before=[];
55818
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
55819
+ var price=srcStock.yclose+0.01;
55820
+
55821
+ var date=new Date(2021,5,2, 9,15, 0);
55822
+ before=
55823
+ [
55824
+ [91505,price+0.01, 400, 300, 1, 800],
55825
+ [91550,price+0.02, 550, 600, 0, 1500],
55826
+ [91603,price+0.03, 300, 600, 1, 3600],
55827
+ [91613,price+0.03, 150, 320, 1, 3600],
55828
+ [91623,price+0.04, 200, 400, 1, 3600],
55829
+ [91635,price+0.05, 100, 100, 1, 3600],
55830
+ [91640,price+0.03, 350, 210, 2, 1600],
55831
+ [91711,price+0.02, 3210, 350, 2, 3700],
55832
+ [91731,price+0.04, 110, 450, 1, 3700],
55833
+ [91825,price-0.01, 210, 650, 2, 3700],
55834
+ [91855,price-0.02, 330, 440, 1, 1000],
55835
+ [91915,price-0.03, 630, 640, 1, 1200],
55836
+ [92022,price+0.01, 260, 550, 2, 1000],
55837
+ [92304,price-0.02, 300, 100, 2, 1000],
55838
+ [92314,price-0.03, 550, 150, 2, 1000],
55839
+ [92344,price-0.04, 550, 150, 1, 1000],
55840
+ [92357,price-0.05, 250, 750, 1, 1500],
55841
+ [92405,price-0.07, 450, 50, 2, 1000],
55842
+ [92435,price-0.08, 650, 250, 1, 1000],
55843
+ [92458,price-0.12, 350, 350, 2, 1000],
55844
+ ];
55845
+
55808
55846
 
55809
55847
  stockItem.before=before;
55810
55848
  stockItem.beforeinfo=beforeinfo;
55811
55849
  }
55812
55850
 
55813
55851
  //盘中
55814
- //stockItem.minute.length=2;
55852
+ stockItem.minute.length=50;
55815
55853
  //测试用 这里可以修改数据
55816
55854
  //var lastItem=srcStock.minute[srcStock.minute.length-1];
55817
55855
  //lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
@@ -55846,9 +55884,11 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55846
55884
  }
55847
55885
 
55848
55886
  //盘后
55849
- if (callcation.After && stockItem.minute.length>=240)
55887
+ if (callcation.After)
55850
55888
  {
55851
55889
  var price=stockItem.minute[stockItem.minute.length-1].price;
55890
+
55891
+ /*
55852
55892
  var afterData=[]
55853
55893
  var afterInfo={ ver:2.0, totalcount:60*3 } //14:57-15:00
55854
55894
  var date=new Date(2021,5,2, 14,57, 0);
@@ -55883,7 +55923,29 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55883
55923
  date.setSeconds(date.getSeconds()+1);
55884
55924
  afterData.push(item);
55885
55925
  }
55926
+ */
55886
55927
 
55928
+ var afterData=[]
55929
+ var afterInfo={ ver:2.0, totalcount:60*3, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} } //14:57-15:00
55930
+ if (stockItem.minute.length>=240)
55931
+ {
55932
+ afterData=
55933
+ [
55934
+ [145708,price+0.01, 400, 300, 1, 800],
55935
+ [145718,price+0.02, 550, 600, 0, 1500],
55936
+ [145738,price+0.02, 150, 800, 0, 1500],
55937
+ [145748,price+0.02, 150, 800, 0, 1500],
55938
+ [145803,price+0.03, 300, 600, 1, 3600],
55939
+ [145815,price+0.03, 350, 210, 2, 1600],
55940
+ [145826,price+0.02, 1210, 350, 2, 2700],
55941
+ [145833,price+0.01, 260, 550, 2, 1000],
55942
+ [145845,price+0.02, 160, 750, 2, 1000],
55943
+ [145858,price-0.01, 460, 650, 2, 1500],
55944
+ [145905,price-0.02, 160, 450, 1, 1500],
55945
+ [145928,price-0.02, 260, 250, 1, 1500],
55946
+ [145948,price-0.02, 860, 150, 1, 1500],
55947
+ ];
55948
+ }
55887
55949
  stockItem.after=afterData;
55888
55950
  stockItem.afterinfo=afterInfo;
55889
55951
  }
@@ -55899,6 +55961,90 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55899
55961
  }, 50);
55900
55962
  }
55901
55963
 
55964
+ //增量更新
55965
+ HQData.Minute_RequestMinuteUpdateData=function(data, callback)
55966
+ {
55967
+ data.PreventDefault=true;
55968
+ var symbol=data.Request.Data.symbol[0]; //请求的股票代码
55969
+ var callcation=data.Request.Data.callcation; //集合竞价
55970
+ var bBuySellBar=data.Request.Data.IsShowBuySellBar;
55971
+ console.log(`[HQData::Minute_RequestMinuteUpdateData] Symbol=${symbol}`);
55972
+
55973
+ var endTime=0;
55974
+ if (data.DateRange)
55975
+ {
55976
+ endTime=data.DateRange.End.Time;
55977
+ }
55978
+
55979
+ setTimeout(()=>
55980
+ {
55981
+ var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
55982
+ var srcStock=fullData[0];
55983
+ var stockItem={ date:srcStock.date, minute:[], yclose:srcStock.yclose, symbol:symbol, name:symbol };
55984
+
55985
+ for(var i=0;i<srcStock.minute.length;++i)
55986
+ {
55987
+ var item=srcStock.minute[i];
55988
+ if (item.time>=endTime)
55989
+ {
55990
+ //0=日期 1=时间 2=开 3=高 4=低 5=收 6=均价 7=量 8=金额 9=涨幅 10=涨跌
55991
+ var minItem=[srcStock.date, item.time, item.open, item.high, item.low, item.price, item.avprice , item.vol, item.amount ];
55992
+ stockItem.minute.push(minItem);
55993
+ if (stockItem.minute.length>3) break;
55994
+ }
55995
+ }
55996
+
55997
+
55998
+ if (callcation.Before)
55999
+ {
56000
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56001
+ var price=srcStock.yclose-0.01;
56002
+ var before=
56003
+ [
56004
+ [92344,price-0.03, 150, 150, 2, 1000],
56005
+ [92357,price-0.04, 250, 250, 2, 1500],
56006
+ [92405,price-0.05, 350, 350, 1, 1000],
56007
+ [92435,price-0.06, 450, 450, 1, 1000],
56008
+ [92458,price-0.07, 550, 550, 2, 1000],
56009
+ ];
56010
+
56011
+ stockItem.before=before;
56012
+ stockItem.beforeinfo=beforeinfo;
56013
+ }
56014
+
56015
+ if (callcation.After)
56016
+ {
56017
+ var afterInfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56018
+
56019
+ var afterData=
56020
+ [
56021
+ [145708,price+0.01, 400, 300, 1, 800],
56022
+ [145718,price+0.02, 550, 600, 0, 1500],
56023
+ [145738,price+0.02, 150, 800, 0, 1500],
56024
+ [145748,price+0.02, 150, 800, 0, 1500],
56025
+ [145803,price+0.03, 300, 600, 1, 3600],
56026
+ [145815,price+0.03, 350, 210, 2, 1600],
56027
+ [145826,price+0.02, 1210, 350, 2, 2700],
56028
+ [145833,price+0.01, 260, 550, 2, 1000],
56029
+ [145845,price+0.02, 160, 750, 2, 1000],
56030
+ [145858,price-0.01, 460, 650, 2, 1500],
56031
+ [145905,price-0.02, 160, 450, 1, 1500],
56032
+ [145928,price-0.02, 260, 250, 1, 1500],
56033
+ [145948,price-0.02, 860, 150, 1, 1500],
56034
+ ];
56035
+
56036
+ stockItem.after=afterData;
56037
+ stockItem.afterinfo=afterInfo;
56038
+ }
56039
+
56040
+ var hqchartData={code:0, stock:[stockItem], dataType:1 };
56041
+ hqchartData.LatestPointFlash={ FlashCount:2 };
56042
+
56043
+ callback(hqchartData);
56044
+
56045
+ }, 50);
56046
+ }
56047
+
55902
56048
  HQData.Minute_RequestMinuteDataV2=function(data, callback)
55903
56049
  {
55904
56050
  data.PreventDefault=true;
@@ -56090,8 +56236,69 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
56090
56236
  aryDay=fullData.slice(0,dayCount);
56091
56237
  for(var i=0; i<aryDay.length; ++i)
56092
56238
  {
56093
- var item=aryDay[i];
56239
+ var stockItem=aryDay[i];
56240
+
56241
+ if (callcation.Before)
56242
+ {
56243
+ var before=[];
56244
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:stockItem.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56245
+ var price=stockItem.yclose+0.01;
56246
+
56247
+ before=
56248
+ [
56249
+ [91505,price+0.01, 400, 300, 1, 800],
56250
+ [91550,price+0.02, 550, 600, 0, 1500],
56251
+ [91603,price+0.03, 300, 600, 1, 3600],
56252
+ [91613,price+0.03, 150, 320, 1, 3600],
56253
+ [91623,price+0.04, 200, 400, 1, 3600],
56254
+ [91635,price+0.05, 100, 100, 1, 3600],
56255
+ [91640,price+0.03, 350, 210, 2, 1600],
56256
+ [91711,price+0.02, 3210, 350, 2, 3700],
56257
+ [91731,price+0.04, 110, 450, 1, 3700],
56258
+ [91825,price-0.01, 210, 650, 2, 3700],
56259
+ [91855,price-0.02, 330, 440, 1, 1000],
56260
+ [91915,price-0.03, 630, 640, 1, 1200],
56261
+ [92022,price+0.01, 260, 550, 2, 1000],
56262
+ [92304,price-0.02, 300, 100, 2, 1000],
56263
+ [92314,price-0.03, 550, 150, 2, 1000],
56264
+ [92344,price-0.04, 550, 150, 1, 1000],
56265
+ [92357,price-0.05, 250, 750, 1, 1500],
56266
+ [92405,price-0.07, 450, 50, 2, 1000],
56267
+ [92435,price-0.08, 650, 250, 1, 1000],
56268
+ [92458,price-0.12, 350, 350, 2, 1000],
56269
+ ];
56270
+
56271
+ stockItem.before=before;
56272
+ stockItem.beforeinfo=beforeinfo;
56273
+ }
56274
+
56275
+ if (callcation.After)
56276
+ {
56277
+ var afterInfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:stockItem.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56278
+ var price=stockItem.minute[stockItem.minute.length-1][4];
56279
+ var afterData=
56280
+ [
56281
+ [145708,price+0.01, 400, 300, 1, 800],
56282
+ [145718,price+0.02, 550, 600, 0, 1500],
56283
+ [145738,price+0.02, 150, 800, 0, 1500],
56284
+ [145748,price+0.02, 150, 800, 0, 1500],
56285
+ [145803,price+0.03, 300, 600, 1, 3600],
56286
+ [145815,price+0.03, 350, 210, 2, 1600],
56287
+ [145826,price+0.02, 1210, 350, 2, 2700],
56288
+ [145833,price+0.01, 260, 550, 2, 1000],
56289
+ [145845,price+0.02, 160, 750, 2, 1000],
56290
+ [145858,price-0.01, 460, 650, 2, 1500],
56291
+ [145905,price-0.02, 160, 450, 1, 1500],
56292
+ [145928,price-0.02, 260, 250, 1, 1500],
56293
+ [145948,price-0.02, 860, 150, 1, 1500],
56294
+ ];
56295
+
56296
+ stockItem.after=afterData;
56297
+ stockItem.afterinfo=afterInfo;
56298
+ }
56299
+
56094
56300
 
56301
+ /*
56095
56302
  if (callcation.Before)
56096
56303
  {
56097
56304
  var before=
@@ -56115,6 +56322,7 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
56115
56322
  item.before=before;
56116
56323
  item.beforeinfo=beforeinfo;
56117
56324
  }
56325
+ */
56118
56326
  }
56119
56327
 
56120
56328
  if (bBuySellBar) //盘口分析
@@ -56233,36 +56441,80 @@ HQData.RequestRealtimeData=function(data, callback)
56233
56441
  }
56234
56442
  }
56235
56443
 
56236
- for(var i=0;i<data.Request.Data.symbol.length;++i)
56444
+ var bVer3=true;
56445
+ if (bVer3)
56237
56446
  {
56238
- var item=data.Request.Data.symbol[i];
56239
- var fullData=HQData.GetDayKLineDataBySymbol(item);
56240
- if (!IFrameSplitOperator.IsNonEmptyArray(fullData)) continue;
56447
+ for(var i=0;i<data.Request.Data.symbol.length;++i)
56448
+ {
56449
+ var item=data.Request.Data.symbol[i];
56450
+ var fullData=HQData.GetDayKLineDataBySymbol(item);
56451
+ if (!IFrameSplitOperator.IsNonEmptyArray(fullData)) continue;
56241
56452
 
56242
- var aryData=HQData.GetKLineDataByDate(fullData, endDate, 20999999);
56243
- if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) continue;
56453
+ var aryData=HQData.GetKLineDataByDate(fullData, endDate, 20999999);
56454
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) continue;
56244
56455
 
56245
- var kItem=aryData[0];
56246
- var price=kItem[5];
56247
- var value=Math.ceil(Math.random()*10)/1000*price;
56248
- var bUp=Math.ceil(Math.random()*10)>=5;
56249
- if (bUp) price+=value;
56250
- else price-=value;
56456
+ var stockItem={ symbol:item, name:item, data:[] };
56457
+
56251
56458
 
56252
- var stockItem={ symbol:item, name:item };
56253
- stockItem.date=kItem[0];
56254
- stockItem.yclose=kItem[1];
56255
- stockItem.open=kItem[2];
56256
- stockItem.high=Math.max(kItem[3],price);
56257
- stockItem.low=Math.min(kItem[4],price);
56258
- stockItem.price=price;
56259
- stockItem.vol=kItem[6];
56260
- stockItem.amount=kItem[7];
56261
-
56262
- aryStock.push(stockItem);
56459
+ var kItem=aryData[0];
56460
+ var price=kItem[5];
56461
+ var value=Math.ceil(Math.random()*10)/1000*price;
56462
+ var bUp=Math.ceil(Math.random()*10)>=5;
56463
+ if (bUp) price+=value;
56464
+ else price-=value;
56465
+
56466
+ var newKItem=[ ];
56467
+ newKItem[0]=kItem[0];
56468
+ newKItem[1]=kItem[1];
56469
+ newKItem[2]=kItem[2];
56470
+ newKItem[3]=Math.max(kItem[3],price);
56471
+ newKItem[4]=Math.min(kItem[4],price);
56472
+ newKItem[5]=price;
56473
+ newKItem[6]=kItem[6];
56474
+ newKItem[7]=kItem[7];
56475
+
56476
+ stockItem.data.push(newKItem);
56477
+
56478
+ aryStock.push(stockItem);
56479
+ }
56480
+
56481
+ var hqchartData={ code:0, stock:aryStock, Ver:3.0 };
56263
56482
  }
56483
+ else
56484
+ {
56485
+ for(var i=0;i<data.Request.Data.symbol.length;++i)
56486
+ {
56487
+ var item=data.Request.Data.symbol[i];
56488
+ var fullData=HQData.GetDayKLineDataBySymbol(item);
56489
+ if (!IFrameSplitOperator.IsNonEmptyArray(fullData)) continue;
56490
+
56491
+ var aryData=HQData.GetKLineDataByDate(fullData, endDate, 20999999);
56492
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) continue;
56493
+
56494
+ var kItem=aryData[0];
56495
+ var price=kItem[5];
56496
+ var value=Math.ceil(Math.random()*10)/1000*price;
56497
+ var bUp=Math.ceil(Math.random()*10)>=5;
56498
+ if (bUp) price+=value;
56499
+ else price-=value;
56500
+
56501
+ var stockItem={ symbol:item, name:item };
56502
+ stockItem.date=kItem[0];
56503
+ stockItem.yclose=kItem[1];
56504
+ stockItem.open=kItem[2];
56505
+ stockItem.high=Math.max(kItem[3],price);
56506
+ stockItem.low=Math.min(kItem[4],price);
56507
+ stockItem.price=price;
56508
+ stockItem.vol=kItem[6];
56509
+ stockItem.amount=kItem[7];
56510
+
56511
+ aryStock.push(stockItem);
56512
+ }
56264
56513
 
56265
- var hqchartData={ code:0, stock:aryStock };
56514
+ var hqchartData={ code:0, stock:aryStock, };
56515
+ }
56516
+
56517
+
56266
56518
 
56267
56519
  var time=new Date();
56268
56520
  //if (time.getSeconds()%3==1)
@@ -58906,17 +59158,18 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
58906
59158
  DrawType:'KLINE_TABLE',
58907
59159
  DrawData:[ ] , //数据 [ [ { Text, Color: BGColor }, ...... ], [],]
58908
59160
  RowCount:4,
58909
- RowName:[ {Name:"账户1",TextAlign:"center"}, {Name:"账户2",TextAlign:"center"}, {Name:"账户3",TextAlign:"center"},{Name:"账户4", TextAlign:"center"}],
59161
+ RowName:[ {Name:"账户[*9993]",TextAlign:"center", Color:"rgb(124, 252, 0)"}, {Name:"账户[*8881]",TextAlign:"center", Color:"rgb(238, 99, 9)"}, {Name:"账户3",TextAlign:"center"},{Name:"账户4", TextAlign:"center"}],
58910
59162
 
58911
59163
  Config:
58912
59164
  {
58913
- BGColor:"rgb(0,0,0)",
59165
+ BGColor:"rgba(238,232,205,0.5)",
58914
59166
  BorderColor:"rgb(220,220,220)",
58915
59167
  TextColor:"rgb(250,250,250)",
58916
59168
  ItemMergin:{ Left:2, Right:2, Top:4, Bottom:4, YOffset:3 },
58917
59169
  RowNamePosition:3,
58918
59170
  TextFont:{ Family:'微软雅黑' , FontMaxSize:14*GetDevicePixelRatio(), },
58919
- RowHeightType:1,
59171
+ RowHeightType:0,
59172
+ Style:1
58920
59173
  }
58921
59174
  },
58922
59175
 
@@ -59179,7 +59432,7 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
59179
59432
  Name:"BASELINE_BAR",
59180
59433
  DrawType:"BASELINE_BAR",
59181
59434
  DrawData:[],
59182
- Config:{ UpColor:"rgb(255,0,255)", DownColor:"rgb(255,165,0)"},
59435
+ Config:{ UpColor:"rgb(255,0,255)", DownColor:"rgb(255,165,0)", UpName:"上涨", DownName:"下跌"},
59183
59436
  },
59184
59437
  };
59185
59438
 
@@ -59217,6 +59470,7 @@ HQData.APIIndex_VERTLINE=function(data, callback)
59217
59470
  Name:"VERTLINE",
59218
59471
  DrawType:"VERTLINE",
59219
59472
  DrawData:{ Data:[] },
59473
+ Config:{ LineWidth:"LINETHICK1", LineType:1 , Color:"rgb(10,200,10)"},
59220
59474
  },
59221
59475
  };
59222
59476