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.
@@ -230,7 +230,6 @@ HQData.Minute_RequestMinuteData=function(data, callback)
230
230
 
231
231
  var lastPrice=stockItem.minute[stockItem.minute.length-1].price;
232
232
 
233
-
234
233
  if (bBuySellBar) //盘口分析
235
234
  {
236
235
  var aryBuy=[];
@@ -271,6 +270,95 @@ HQData.Minute_RequestMinuteData=function(data, callback)
271
270
  }, 50);
272
271
  }
273
272
 
273
+ HQData.Minute_RequestMinuteDataV2=function(data, callback)
274
+ {
275
+ data.PreventDefault=true;
276
+ var symbol=data.Request.Data.symbol[0]; //请求的股票代码
277
+ var callcation=data.Request.Data.callcation; //集合竞价
278
+ console.log(`[HQData::Minute_RequestMinuteDataV2] Symbol=${symbol}`);
279
+
280
+ setTimeout(()=>
281
+ {
282
+ var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
283
+ var srcStock=fullData[0];
284
+ var stockItem={ date:srcStock.date, minute:srcStock.minute, yclose:srcStock.yclose, symbol:symbol, name:symbol };
285
+
286
+ if (callcation.Before)
287
+ {
288
+ var TEST_BEFORE_DATA=
289
+ [
290
+ [8.52, 50000, 30000, 1, 200000],
291
+ [8.53, 55000, 40000, 0, 80000],
292
+ [8.52, 40000, 60000, 1, 80000],
293
+ [8.55, 30000, 21000, 2, 44000],
294
+ [8.51, 21000, 25000, 2, 40000],
295
+ [8.50, 36000, 55000, 2, 60000],
296
+ [8.49, 10000, 20000, 2, 33000],
297
+ ];
298
+
299
+ var date=new Date(parseInt(stockItem.date/10000),(stockItem.date/100%100-1),stockItem.date%100, 9, 15, 0);
300
+ var count=10*60; //9:15-9:25
301
+ var before=[];
302
+ for(var i=0;i<count;++i)
303
+ {
304
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
305
+ var testIndex=Math.floor(Math.random()*10)%TEST_BEFORE_DATA.length;
306
+ var testData=TEST_BEFORE_DATA[testIndex];
307
+ var item=[ time, null, null, null, null, null ];
308
+ if (i%20==0 || i==count-1)
309
+ {
310
+ item=[ time, testData[0], testData[1], testData[2], testData[3], (testData[1]+testData[2])*1.5 ];
311
+ }
312
+ before.push(item);
313
+ date.setSeconds(date.getSeconds()+1);
314
+ }
315
+
316
+ //before.length=200;
317
+ var beforeinfo={ totalcount:count, ver:2.0 };
318
+
319
+ stockItem.before=before;
320
+ stockItem.beforeinfo=beforeinfo;
321
+
322
+ var TEST_AFTER_DATA=
323
+ [
324
+ [8.51, 40000, 30000, 1, 80000],
325
+ [8.51, 55000, 60000, 0, 150000],
326
+ [8.51, 30000, 60000, 1, 160000],
327
+ [8.51, 35000, 21000, 2, 50000],
328
+ [8.51, 21000, 35000, 2, 70000],
329
+ [8.51, 26000, 55000, 2, 100000],
330
+ [8.51, 30000, 10000, 2, 50000],
331
+ ];
332
+
333
+ var date=new Date(parseInt(stockItem.date/10000),(stockItem.date/100%100-1),stockItem.date%100, 14, 57, 0);
334
+ var count=3*60; //14:57-15:00
335
+ var after=[];
336
+ for(var i=0;i<count;++i)
337
+ {
338
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
339
+ var testIndex=Math.floor(Math.random()*10)%TEST_AFTER_DATA.length;
340
+ var testData=TEST_AFTER_DATA[testIndex];
341
+ var item=[ time, null, null, null, null, null ];
342
+ if (i%10==0 || i==count-1)
343
+ {
344
+ item=[ time, testData[0], testData[1], testData[2], testData[3], (testData[1]+testData[2])*1.5 ];
345
+ }
346
+ after.push(item);
347
+ date.setSeconds(date.getSeconds()+1);
348
+ }
349
+
350
+ var afterinfo={ totalcount:count, ver:2.0 };
351
+ stockItem.after=after;
352
+ stockItem.afterinfo=afterinfo;
353
+ }
354
+
355
+ //stockItem.minute.length=0;
356
+
357
+ var hqchartData={code:0, stock:[stockItem] };
358
+ callback(hqchartData);
359
+ }, 50);
360
+ }
361
+
274
362
  HQData.Minute_RequestPopMinuteData=function(data, callback)
275
363
  {
276
364
  data.PreventDefault=true;