hqchart 1.1.14731 → 1.1.14742

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14731",
3
+ "version": "1.1.14742",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -55744,7 +55744,6 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55744
55744
 
55745
55745
  var lastPrice=stockItem.minute[stockItem.minute.length-1].price;
55746
55746
 
55747
-
55748
55747
  if (bBuySellBar) //盘口分析
55749
55748
  {
55750
55749
  var aryBuy=[];
@@ -55785,6 +55784,95 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55785
55784
  }, 50);
55786
55785
  }
55787
55786
 
55787
+ HQData.Minute_RequestMinuteDataV2=function(data, callback)
55788
+ {
55789
+ data.PreventDefault=true;
55790
+ var symbol=data.Request.Data.symbol[0]; //请求的股票代码
55791
+ var callcation=data.Request.Data.callcation; //集合竞价
55792
+ console.log(`[HQData::Minute_RequestMinuteDataV2] Symbol=${symbol}`);
55793
+
55794
+ setTimeout(()=>
55795
+ {
55796
+ var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
55797
+ var srcStock=fullData[0];
55798
+ var stockItem={ date:srcStock.date, minute:srcStock.minute, yclose:srcStock.yclose, symbol:symbol, name:symbol };
55799
+
55800
+ if (callcation.Before)
55801
+ {
55802
+ var TEST_BEFORE_DATA=
55803
+ [
55804
+ [8.52, 50000, 30000, 1, 200000],
55805
+ [8.53, 55000, 40000, 0, 80000],
55806
+ [8.52, 40000, 60000, 1, 80000],
55807
+ [8.55, 30000, 21000, 2, 44000],
55808
+ [8.51, 21000, 25000, 2, 40000],
55809
+ [8.50, 36000, 55000, 2, 60000],
55810
+ [8.49, 10000, 20000, 2, 33000],
55811
+ ];
55812
+
55813
+ var date=new Date(parseInt(stockItem.date/10000),(stockItem.date/100%100-1),stockItem.date%100, 9, 15, 0);
55814
+ var count=10*60; //9:15-9:25
55815
+ var before=[];
55816
+ for(var i=0;i<count;++i)
55817
+ {
55818
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
55819
+ var testIndex=Math.floor(Math.random()*10)%TEST_BEFORE_DATA.length;
55820
+ var testData=TEST_BEFORE_DATA[testIndex];
55821
+ var item=[ time, null, null, null, null, null ];
55822
+ if (i%20==0 || i==count-1)
55823
+ {
55824
+ item=[ time, testData[0], testData[1], testData[2], testData[3], (testData[1]+testData[2])*1.5 ];
55825
+ }
55826
+ before.push(item);
55827
+ date.setSeconds(date.getSeconds()+1);
55828
+ }
55829
+
55830
+ //before.length=200;
55831
+ var beforeinfo={ totalcount:count, ver:2.0 };
55832
+
55833
+ stockItem.before=before;
55834
+ stockItem.beforeinfo=beforeinfo;
55835
+
55836
+ var TEST_AFTER_DATA=
55837
+ [
55838
+ [8.51, 40000, 30000, 1, 80000],
55839
+ [8.51, 55000, 60000, 0, 150000],
55840
+ [8.51, 30000, 60000, 1, 160000],
55841
+ [8.51, 35000, 21000, 2, 50000],
55842
+ [8.51, 21000, 35000, 2, 70000],
55843
+ [8.51, 26000, 55000, 2, 100000],
55844
+ [8.51, 30000, 10000, 2, 50000],
55845
+ ];
55846
+
55847
+ var date=new Date(parseInt(stockItem.date/10000),(stockItem.date/100%100-1),stockItem.date%100, 14, 57, 0);
55848
+ var count=3*60; //14:57-15:00
55849
+ var after=[];
55850
+ for(var i=0;i<count;++i)
55851
+ {
55852
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
55853
+ var testIndex=Math.floor(Math.random()*10)%TEST_AFTER_DATA.length;
55854
+ var testData=TEST_AFTER_DATA[testIndex];
55855
+ var item=[ time, null, null, null, null, null ];
55856
+ if (i%10==0 || i==count-1)
55857
+ {
55858
+ item=[ time, testData[0], testData[1], testData[2], testData[3], (testData[1]+testData[2])*1.5 ];
55859
+ }
55860
+ after.push(item);
55861
+ date.setSeconds(date.getSeconds()+1);
55862
+ }
55863
+
55864
+ var afterinfo={ totalcount:count, ver:2.0 };
55865
+ stockItem.after=after;
55866
+ stockItem.afterinfo=afterinfo;
55867
+ }
55868
+
55869
+ //stockItem.minute.length=0;
55870
+
55871
+ var hqchartData={code:0, stock:[stockItem] };
55872
+ callback(hqchartData);
55873
+ }, 50);
55874
+ }
55875
+
55788
55876
  HQData.Minute_RequestPopMinuteData=function(data, callback)
55789
55877
  {
55790
55878
  data.PreventDefault=true;