hqchart 1.1.14947 → 1.1.14953

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.
@@ -55712,12 +55712,18 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55712
55712
  var symbol=data.Request.Data.symbol[0]; //请求的股票代码
55713
55713
  var callcation=data.Request.Data.callcation; //集合竞价
55714
55714
  var bBuySellBar=data.Request.Data.IsShowBuySellBar;
55715
- console.log(`[HQData::RequestMinuteData] Symbol=${symbol}`);
55715
+ console.log(`[HQData::RequestMinuteData] Symbol=${symbol}, Update=${data.Self.DataStatus.LatestDay}`);
55716
+
55717
+ if (data.Self.DataStatus.LatestDay) //增量更新模式
55718
+ {
55719
+ HQData.Minute_RequestMinuteUpdateData(data, callback);
55720
+ return;
55721
+ }
55716
55722
 
55717
55723
  setTimeout(()=>{
55718
55724
  var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
55719
55725
  var srcStock=fullData[0];
55720
- var stockItem={ date:srcStock.date, minute:srcStock.minute, yclose:srcStock.yclose, symbol:symbol, name:symbol };
55726
+ var stockItem={ date:srcStock.date, minute:srcStock.minute.slice(), yclose:srcStock.yclose, symbol:symbol, name:symbol };
55721
55727
 
55722
55728
  //盘前
55723
55729
  if (callcation.Before)
@@ -55745,6 +55751,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55745
55751
  stockItem.beforeinfo=beforeinfo;
55746
55752
  */
55747
55753
 
55754
+ /*
55748
55755
  var before=[];
55749
55756
  var beforeinfo={ totalcount:60*10, ver:2.0 }; //9:15-9:25 集合竞价15分钟 1s一个数据
55750
55757
  var price=srcStock.yclose+0.01;
@@ -55787,13 +55794,44 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55787
55794
  date.setSeconds(date.getSeconds()+1);
55788
55795
  before.push(item);
55789
55796
  }
55797
+ */
55798
+
55799
+ var before=[];
55800
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
55801
+ var price=srcStock.yclose+0.01;
55802
+
55803
+ var date=new Date(2021,5,2, 9,15, 0);
55804
+ before=
55805
+ [
55806
+ [91505,price+0.01, 400, 300, 1, 800],
55807
+ [91550,price+0.02, 550, 600, 0, 1500],
55808
+ [91603,price+0.03, 300, 600, 1, 3600],
55809
+ [91613,price+0.03, 150, 320, 1, 3600],
55810
+ [91623,price+0.04, 200, 400, 1, 3600],
55811
+ [91635,price+0.05, 100, 100, 1, 3600],
55812
+ [91640,price+0.03, 350, 210, 2, 1600],
55813
+ [91711,price+0.02, 3210, 350, 2, 3700],
55814
+ [91731,price+0.04, 110, 450, 1, 3700],
55815
+ [91825,price-0.01, 210, 650, 2, 3700],
55816
+ [91855,price-0.02, 330, 440, 1, 1000],
55817
+ [91915,price-0.03, 630, 640, 1, 1200],
55818
+ [92022,price+0.01, 260, 550, 2, 1000],
55819
+ [92304,price-0.02, 300, 100, 2, 1000],
55820
+ [92314,price-0.03, 550, 150, 2, 1000],
55821
+ [92344,price-0.04, 550, 150, 1, 1000],
55822
+ [92357,price-0.05, 250, 750, 1, 1500],
55823
+ [92405,price-0.07, 450, 50, 2, 1000],
55824
+ [92435,price-0.08, 650, 250, 1, 1000],
55825
+ [92458,price-0.12, 350, 350, 2, 1000],
55826
+ ];
55827
+
55790
55828
 
55791
55829
  stockItem.before=before;
55792
55830
  stockItem.beforeinfo=beforeinfo;
55793
55831
  }
55794
55832
 
55795
55833
  //盘中
55796
- //stockItem.minute.length=2;
55834
+ stockItem.minute.length=50;
55797
55835
  //测试用 这里可以修改数据
55798
55836
  //var lastItem=srcStock.minute[srcStock.minute.length-1];
55799
55837
  //lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
@@ -55828,9 +55866,11 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55828
55866
  }
55829
55867
 
55830
55868
  //盘后
55831
- if (callcation.After && stockItem.minute.length>=240)
55869
+ if (callcation.After)
55832
55870
  {
55833
55871
  var price=stockItem.minute[stockItem.minute.length-1].price;
55872
+
55873
+ /*
55834
55874
  var afterData=[]
55835
55875
  var afterInfo={ ver:2.0, totalcount:60*3 } //14:57-15:00
55836
55876
  var date=new Date(2021,5,2, 14,57, 0);
@@ -55865,7 +55905,29 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55865
55905
  date.setSeconds(date.getSeconds()+1);
55866
55906
  afterData.push(item);
55867
55907
  }
55908
+ */
55868
55909
 
55910
+ var afterData=[]
55911
+ var afterInfo={ ver:2.0, totalcount:60*3, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} } //14:57-15:00
55912
+ if (stockItem.minute.length>=240)
55913
+ {
55914
+ afterData=
55915
+ [
55916
+ [145708,price+0.01, 400, 300, 1, 800],
55917
+ [145718,price+0.02, 550, 600, 0, 1500],
55918
+ [145738,price+0.02, 150, 800, 0, 1500],
55919
+ [145748,price+0.02, 150, 800, 0, 1500],
55920
+ [145803,price+0.03, 300, 600, 1, 3600],
55921
+ [145815,price+0.03, 350, 210, 2, 1600],
55922
+ [145826,price+0.02, 1210, 350, 2, 2700],
55923
+ [145833,price+0.01, 260, 550, 2, 1000],
55924
+ [145845,price+0.02, 160, 750, 2, 1000],
55925
+ [145858,price-0.01, 460, 650, 2, 1500],
55926
+ [145905,price-0.02, 160, 450, 1, 1500],
55927
+ [145928,price-0.02, 260, 250, 1, 1500],
55928
+ [145948,price-0.02, 860, 150, 1, 1500],
55929
+ ];
55930
+ }
55869
55931
  stockItem.after=afterData;
55870
55932
  stockItem.afterinfo=afterInfo;
55871
55933
  }
@@ -55881,6 +55943,90 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55881
55943
  }, 50);
55882
55944
  }
55883
55945
 
55946
+ //增量更新
55947
+ HQData.Minute_RequestMinuteUpdateData=function(data, callback)
55948
+ {
55949
+ data.PreventDefault=true;
55950
+ var symbol=data.Request.Data.symbol[0]; //请求的股票代码
55951
+ var callcation=data.Request.Data.callcation; //集合竞价
55952
+ var bBuySellBar=data.Request.Data.IsShowBuySellBar;
55953
+ console.log(`[HQData::Minute_RequestMinuteUpdateData] Symbol=${symbol}`);
55954
+
55955
+ var endTime=0;
55956
+ if (data.DateRange)
55957
+ {
55958
+ endTime=data.DateRange.End.Time;
55959
+ }
55960
+
55961
+ setTimeout(()=>
55962
+ {
55963
+ var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
55964
+ var srcStock=fullData[0];
55965
+ var stockItem={ date:srcStock.date, minute:[], yclose:srcStock.yclose, symbol:symbol, name:symbol };
55966
+
55967
+ for(var i=0;i<srcStock.minute.length;++i)
55968
+ {
55969
+ var item=srcStock.minute[i];
55970
+ if (item.time>=endTime)
55971
+ {
55972
+ //0=日期 1=时间 2=开 3=高 4=低 5=收 6=均价 7=量 8=金额 9=涨幅 10=涨跌
55973
+ var minItem=[srcStock.date, item.time, item.open, item.high, item.low, item.price, item.avprice , item.vol, item.amount ];
55974
+ stockItem.minute.push(minItem);
55975
+ if (stockItem.minute.length>3) break;
55976
+ }
55977
+ }
55978
+
55979
+
55980
+ if (callcation.Before)
55981
+ {
55982
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
55983
+ var price=srcStock.yclose-0.01;
55984
+ var before=
55985
+ [
55986
+ [92344,price-0.03, 150, 150, 2, 1000],
55987
+ [92357,price-0.04, 250, 250, 2, 1500],
55988
+ [92405,price-0.05, 350, 350, 1, 1000],
55989
+ [92435,price-0.06, 450, 450, 1, 1000],
55990
+ [92458,price-0.07, 550, 550, 2, 1000],
55991
+ ];
55992
+
55993
+ stockItem.before=before;
55994
+ stockItem.beforeinfo=beforeinfo;
55995
+ }
55996
+
55997
+ if (callcation.After)
55998
+ {
55999
+ var afterInfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56000
+
56001
+ var afterData=
56002
+ [
56003
+ [145708,price+0.01, 400, 300, 1, 800],
56004
+ [145718,price+0.02, 550, 600, 0, 1500],
56005
+ [145738,price+0.02, 150, 800, 0, 1500],
56006
+ [145748,price+0.02, 150, 800, 0, 1500],
56007
+ [145803,price+0.03, 300, 600, 1, 3600],
56008
+ [145815,price+0.03, 350, 210, 2, 1600],
56009
+ [145826,price+0.02, 1210, 350, 2, 2700],
56010
+ [145833,price+0.01, 260, 550, 2, 1000],
56011
+ [145845,price+0.02, 160, 750, 2, 1000],
56012
+ [145858,price-0.01, 460, 650, 2, 1500],
56013
+ [145905,price-0.02, 160, 450, 1, 1500],
56014
+ [145928,price-0.02, 260, 250, 1, 1500],
56015
+ [145948,price-0.02, 860, 150, 1, 1500],
56016
+ ];
56017
+
56018
+ stockItem.after=afterData;
56019
+ stockItem.afterinfo=afterInfo;
56020
+ }
56021
+
56022
+ var hqchartData={code:0, stock:[stockItem], dataType:1 };
56023
+ hqchartData.LatestPointFlash={ FlashCount:2 };
56024
+
56025
+ callback(hqchartData);
56026
+
56027
+ }, 50);
56028
+ }
56029
+
55884
56030
  HQData.Minute_RequestMinuteDataV2=function(data, callback)
55885
56031
  {
55886
56032
  data.PreventDefault=true;
@@ -56072,8 +56218,69 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
56072
56218
  aryDay=fullData.slice(0,dayCount);
56073
56219
  for(var i=0; i<aryDay.length; ++i)
56074
56220
  {
56075
- var item=aryDay[i];
56221
+ var stockItem=aryDay[i];
56222
+
56223
+ if (callcation.Before)
56224
+ {
56225
+ var before=[];
56226
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:stockItem.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56227
+ var price=stockItem.yclose+0.01;
56228
+
56229
+ before=
56230
+ [
56231
+ [91505,price+0.01, 400, 300, 1, 800],
56232
+ [91550,price+0.02, 550, 600, 0, 1500],
56233
+ [91603,price+0.03, 300, 600, 1, 3600],
56234
+ [91613,price+0.03, 150, 320, 1, 3600],
56235
+ [91623,price+0.04, 200, 400, 1, 3600],
56236
+ [91635,price+0.05, 100, 100, 1, 3600],
56237
+ [91640,price+0.03, 350, 210, 2, 1600],
56238
+ [91711,price+0.02, 3210, 350, 2, 3700],
56239
+ [91731,price+0.04, 110, 450, 1, 3700],
56240
+ [91825,price-0.01, 210, 650, 2, 3700],
56241
+ [91855,price-0.02, 330, 440, 1, 1000],
56242
+ [91915,price-0.03, 630, 640, 1, 1200],
56243
+ [92022,price+0.01, 260, 550, 2, 1000],
56244
+ [92304,price-0.02, 300, 100, 2, 1000],
56245
+ [92314,price-0.03, 550, 150, 2, 1000],
56246
+ [92344,price-0.04, 550, 150, 1, 1000],
56247
+ [92357,price-0.05, 250, 750, 1, 1500],
56248
+ [92405,price-0.07, 450, 50, 2, 1000],
56249
+ [92435,price-0.08, 650, 250, 1, 1000],
56250
+ [92458,price-0.12, 350, 350, 2, 1000],
56251
+ ];
56252
+
56253
+ stockItem.before=before;
56254
+ stockItem.beforeinfo=beforeinfo;
56255
+ }
56256
+
56257
+ if (callcation.After)
56258
+ {
56259
+ var afterInfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:stockItem.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
56260
+ var price=stockItem.minute[stockItem.minute.length-1][4];
56261
+ var afterData=
56262
+ [
56263
+ [145708,price+0.01, 400, 300, 1, 800],
56264
+ [145718,price+0.02, 550, 600, 0, 1500],
56265
+ [145738,price+0.02, 150, 800, 0, 1500],
56266
+ [145748,price+0.02, 150, 800, 0, 1500],
56267
+ [145803,price+0.03, 300, 600, 1, 3600],
56268
+ [145815,price+0.03, 350, 210, 2, 1600],
56269
+ [145826,price+0.02, 1210, 350, 2, 2700],
56270
+ [145833,price+0.01, 260, 550, 2, 1000],
56271
+ [145845,price+0.02, 160, 750, 2, 1000],
56272
+ [145858,price-0.01, 460, 650, 2, 1500],
56273
+ [145905,price-0.02, 160, 450, 1, 1500],
56274
+ [145928,price-0.02, 260, 250, 1, 1500],
56275
+ [145948,price-0.02, 860, 150, 1, 1500],
56276
+ ];
56277
+
56278
+ stockItem.after=afterData;
56279
+ stockItem.afterinfo=afterInfo;
56280
+ }
56281
+
56076
56282
 
56283
+ /*
56077
56284
  if (callcation.Before)
56078
56285
  {
56079
56286
  var before=
@@ -56097,6 +56304,7 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
56097
56304
  item.before=before;
56098
56305
  item.beforeinfo=beforeinfo;
56099
56306
  }
56307
+ */
56100
56308
  }
56101
56309
 
56102
56310
  if (bBuySellBar) //盘口分析
@@ -56215,36 +56423,80 @@ HQData.RequestRealtimeData=function(data, callback)
56215
56423
  }
56216
56424
  }
56217
56425
 
56218
- for(var i=0;i<data.Request.Data.symbol.length;++i)
56426
+ var bVer3=true;
56427
+ if (bVer3)
56219
56428
  {
56220
- var item=data.Request.Data.symbol[i];
56221
- var fullData=HQData.GetDayKLineDataBySymbol(item);
56222
- if (!IFrameSplitOperator.IsNonEmptyArray(fullData)) continue;
56429
+ for(var i=0;i<data.Request.Data.symbol.length;++i)
56430
+ {
56431
+ var item=data.Request.Data.symbol[i];
56432
+ var fullData=HQData.GetDayKLineDataBySymbol(item);
56433
+ if (!IFrameSplitOperator.IsNonEmptyArray(fullData)) continue;
56223
56434
 
56224
- var aryData=HQData.GetKLineDataByDate(fullData, endDate, 20999999);
56225
- if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) continue;
56435
+ var aryData=HQData.GetKLineDataByDate(fullData, endDate, 20999999);
56436
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) continue;
56226
56437
 
56227
- var kItem=aryData[0];
56228
- var price=kItem[5];
56229
- var value=Math.ceil(Math.random()*10)/1000*price;
56230
- var bUp=Math.ceil(Math.random()*10)>=5;
56231
- if (bUp) price+=value;
56232
- else price-=value;
56438
+ var stockItem={ symbol:item, name:item, data:[] };
56439
+
56233
56440
 
56234
- var stockItem={ symbol:item, name:item };
56235
- stockItem.date=kItem[0];
56236
- stockItem.yclose=kItem[1];
56237
- stockItem.open=kItem[2];
56238
- stockItem.high=Math.max(kItem[3],price);
56239
- stockItem.low=Math.min(kItem[4],price);
56240
- stockItem.price=price;
56241
- stockItem.vol=kItem[6];
56242
- stockItem.amount=kItem[7];
56243
-
56244
- aryStock.push(stockItem);
56441
+ var kItem=aryData[0];
56442
+ var price=kItem[5];
56443
+ var value=Math.ceil(Math.random()*10)/1000*price;
56444
+ var bUp=Math.ceil(Math.random()*10)>=5;
56445
+ if (bUp) price+=value;
56446
+ else price-=value;
56447
+
56448
+ var newKItem=[ ];
56449
+ newKItem[0]=kItem[0];
56450
+ newKItem[1]=kItem[1];
56451
+ newKItem[2]=kItem[2];
56452
+ newKItem[3]=Math.max(kItem[3],price);
56453
+ newKItem[4]=Math.min(kItem[4],price);
56454
+ newKItem[5]=price;
56455
+ newKItem[6]=kItem[6];
56456
+ newKItem[7]=kItem[7];
56457
+
56458
+ stockItem.data.push(newKItem);
56459
+
56460
+ aryStock.push(stockItem);
56461
+ }
56462
+
56463
+ var hqchartData={ code:0, stock:aryStock, Ver:3.0 };
56245
56464
  }
56465
+ else
56466
+ {
56467
+ for(var i=0;i<data.Request.Data.symbol.length;++i)
56468
+ {
56469
+ var item=data.Request.Data.symbol[i];
56470
+ var fullData=HQData.GetDayKLineDataBySymbol(item);
56471
+ if (!IFrameSplitOperator.IsNonEmptyArray(fullData)) continue;
56472
+
56473
+ var aryData=HQData.GetKLineDataByDate(fullData, endDate, 20999999);
56474
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) continue;
56475
+
56476
+ var kItem=aryData[0];
56477
+ var price=kItem[5];
56478
+ var value=Math.ceil(Math.random()*10)/1000*price;
56479
+ var bUp=Math.ceil(Math.random()*10)>=5;
56480
+ if (bUp) price+=value;
56481
+ else price-=value;
56482
+
56483
+ var stockItem={ symbol:item, name:item };
56484
+ stockItem.date=kItem[0];
56485
+ stockItem.yclose=kItem[1];
56486
+ stockItem.open=kItem[2];
56487
+ stockItem.high=Math.max(kItem[3],price);
56488
+ stockItem.low=Math.min(kItem[4],price);
56489
+ stockItem.price=price;
56490
+ stockItem.vol=kItem[6];
56491
+ stockItem.amount=kItem[7];
56492
+
56493
+ aryStock.push(stockItem);
56494
+ }
56246
56495
 
56247
- var hqchartData={ code:0, stock:aryStock };
56496
+ var hqchartData={ code:0, stock:aryStock, };
56497
+ }
56498
+
56499
+
56248
56500
 
56249
56501
  var time=new Date();
56250
56502
  //if (time.getSeconds()%3==1)
@@ -58888,17 +59140,18 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
58888
59140
  DrawType:'KLINE_TABLE',
58889
59141
  DrawData:[ ] , //数据 [ [ { Text, Color: BGColor }, ...... ], [],]
58890
59142
  RowCount:4,
58891
- RowName:[ {Name:"账户1",TextAlign:"center"}, {Name:"账户2",TextAlign:"center"}, {Name:"账户3",TextAlign:"center"},{Name:"账户4", TextAlign:"center"}],
59143
+ 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"}],
58892
59144
 
58893
59145
  Config:
58894
59146
  {
58895
- BGColor:"rgb(0,0,0)",
59147
+ BGColor:"rgba(238,232,205,0.5)",
58896
59148
  BorderColor:"rgb(220,220,220)",
58897
59149
  TextColor:"rgb(250,250,250)",
58898
59150
  ItemMergin:{ Left:2, Right:2, Top:4, Bottom:4, YOffset:3 },
58899
59151
  RowNamePosition:3,
58900
59152
  TextFont:{ Family:'微软雅黑' , FontMaxSize:14*GetDevicePixelRatio(), },
58901
- RowHeightType:1,
59153
+ RowHeightType:0,
59154
+ Style:1
58902
59155
  }
58903
59156
  },
58904
59157
 
@@ -59161,7 +59414,7 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
59161
59414
  Name:"BASELINE_BAR",
59162
59415
  DrawType:"BASELINE_BAR",
59163
59416
  DrawData:[],
59164
- Config:{ UpColor:"rgb(255,0,255)", DownColor:"rgb(255,165,0)"},
59417
+ Config:{ UpColor:"rgb(255,0,255)", DownColor:"rgb(255,165,0)", UpName:"上涨", DownName:"下跌"},
59165
59418
  },
59166
59419
  };
59167
59420
 
@@ -59199,6 +59452,7 @@ HQData.APIIndex_VERTLINE=function(data, callback)
59199
59452
  Name:"VERTLINE",
59200
59453
  DrawType:"VERTLINE",
59201
59454
  DrawData:{ Data:[] },
59455
+ Config:{ LineWidth:"LINETHICK1", LineType:1 , Color:"rgb(10,200,10)"},
59202
59456
  },
59203
59457
  };
59204
59458