hqchart 1.1.13385 → 1.1.13395

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.
@@ -135,7 +135,7 @@ function JSIndexScript()
135
135
  ['BOLL', this.BOLL],['BOLL副图', this.BOLL2],['BBI', this.BBI],
136
136
  ['DKX', this.DKX],['MIKE', this.MIKE],['PBX', this.PBX],
137
137
  ['ENE', this.ENE],['MACD', this.MACD],['KDJ', this.KDJ],["MACD2", this.MACD2],
138
- ['VOL', this.VOL],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
138
+ ['VOL', this.VOL],['VOL2', this.VOL2],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
139
139
  ['WR', this.WR],['BIAS', this.BIAS],['OBV', this.OBV],
140
140
  ['DMI', this.DMI],['CR', this.CR],['PSY', this.PSY],
141
141
  ['CCI', this.CCI],['DMA', this.DMA],['TRIX', this.TRIX],
@@ -699,6 +699,23 @@ MA2:MA(VOL,M2);'
699
699
  return data;
700
700
  }
701
701
 
702
+ JSIndexScript.prototype.VOL2=function()
703
+ {
704
+ let data=
705
+ {
706
+ Name:'VOL', Description:'成交量', IsMainIndex:false,FloatPrecision:0,
707
+ Args:[ { Name:'M1', Value:5}, { Name:'M2', Value:10} ],
708
+ OutName:[ {Name:'MA1',DynamicName:"MA{M1}" }, {Name:'MA2',DynamicName:"MA{M2}" }],
709
+ Script: //脚本
710
+ 'VOL:VOL,VOLSTICK,STICKTYPE(1);\n\
711
+ MA1:MA(VOL,M1);\n\
712
+ MA2:MA(VOL,M2);'
713
+
714
+ };
715
+
716
+ return data;
717
+ }
718
+
702
719
  JSIndexScript.prototype.VOL_OVERLAY=function()
703
720
  {
704
721
  let data=
@@ -7307,6 +7324,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7307
7324
 
7308
7325
  if (this.TryClickButton(x,y,e))
7309
7326
  {
7327
+ this.IsOnTouch=false;
7310
7328
  return;
7311
7329
  }
7312
7330
 
@@ -7339,11 +7357,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7339
7357
 
7340
7358
  if (this.TryClickCrossCursor(x,y, e))
7341
7359
  {
7360
+ this.IsOnTouch=false;
7342
7361
  return;
7343
7362
  }
7344
7363
 
7345
7364
  if (this.TryClickChartTooltipData && this.TryClickChartTooltipData(x,y,e)) //预留给外部点击图标什么用的
7346
7365
  {
7366
+ this.IsOnTouch=false;
7347
7367
  return;
7348
7368
  }
7349
7369
 
@@ -11730,6 +11750,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11730
11750
 
11731
11751
  if (this.Frame && this.Frame.SetLanguage) this.Frame.SetLanguage(this.LanguageID);
11732
11752
 
11753
+ //this.Frame.ClearYCoordinateMaxMin();
11754
+ this.ResetFrameXYSplit();
11733
11755
  this.Frame.SetSizeChage(true);
11734
11756
  this.Draw();
11735
11757
  }
@@ -27415,6 +27437,7 @@ function ChartKLine()
27415
27437
  // 15=HLC Area
27416
27438
  // 16=kagi
27417
27439
  // 17=订单流样式4
27440
+ // 18=订单流样式5
27418
27441
 
27419
27442
  this.CloseLineColor=g_JSChartResource.CloseLineColor;
27420
27443
  this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;
@@ -29077,200 +29100,7 @@ function ChartKLine()
29077
29100
  }
29078
29101
  }
29079
29102
 
29080
- /*
29081
- this.DrawKBarV2=function(data, colorData, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29082
- {
29083
- var isDrawBorder=false;
29084
- var isEmptyBar=false;
29085
- if (colorData.border) isDrawBorder=true;
29086
- if (colorData.Type===0) isEmptyBar=true;
29087
-
29088
- if (dataWidth>=4)
29089
- {
29090
- if (isDrawBorder)
29091
- {
29092
- if ((dataWidth%2)!=0) dataWidth-=1;
29093
- }
29094
-
29095
- if (data.High>data.Close) //上影线
29096
- {
29097
- if (colorData.Line)
29098
- {
29099
- this.Canvas.strokeStyle=colorData.Line.Color;
29100
- this.Canvas.beginPath();
29101
- if (isHScreen)
29102
- {
29103
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
29104
- this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
29105
- }
29106
- else
29107
- {
29108
- if (isDrawBorder)
29109
- {
29110
- var xFixed=left+dataWidth/2;
29111
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
29112
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
29113
- }
29114
- else
29115
- {
29116
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));
29117
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));
29118
- }
29119
- }
29120
- this.Canvas.stroke();
29121
- }
29122
-
29123
- y=yClose;
29124
- }
29125
- else
29126
- {
29127
- y=yClose;
29128
- }
29129
-
29130
- if (isHScreen)
29131
- {
29132
- //实心
29133
- if (!isEmptyBar && colorData.BarColor)
29134
- {
29135
- this.Canvas.fillStyle=colorData.BarColor;
29136
- if (Math.abs(yOpen-y)<1)
29137
- {
29138
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29139
- }
29140
- else
29141
- {
29142
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29143
- }
29144
- }
29145
-
29146
- if (colorData.Border) //空心
29147
- {
29148
- if (Math.abs(yOpen-y)<1)
29149
- {
29150
- this.Canvas.fillStyle=colorData.Border.Color;
29151
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29152
- }
29153
- else
29154
- {
29155
- this.Canvas.strokeStyle=colorData.Border.Color;
29156
- this.Canvas.beginPath();
29157
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29158
- this.Canvas.stroke();
29159
- }
29160
- }
29161
- }
29162
- else
29163
- {
29164
-
29165
- //实心
29166
- if (!isEmptyBar && colorData.BarColor)
29167
- {
29168
- this.Canvas.fillStyle=colorData.BarColor;
29169
- if (Math.abs(yOpen-y)<1)
29170
- {
29171
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29172
- }
29173
- else
29174
- {
29175
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));
29176
- }
29177
- }
29178
-
29179
- if (colorData.Border) //空心
29180
- {
29181
- if (Math.abs(yOpen-y)<1)
29182
- {
29183
- this.Canvas.fillStyle=colorData.Border.Color;
29184
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29185
- }
29186
- else
29187
- {
29188
- this.Canvas.strokeStyle=colorData.Border.Color;
29189
- this.Canvas.beginPath();
29190
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));
29191
- this.Canvas.stroke();
29192
- }
29193
- }
29194
- }
29195
-
29196
- if (data.Open>data.Low) //下影线
29197
- {
29198
- if (colorData.Line)
29199
- {
29200
- this.Canvas.strokeStyle=colorData.Line.Color;
29201
- this.Canvas.beginPath();
29202
- if (isHScreen)
29203
- {
29204
- this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
29205
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
29206
- }
29207
- else
29208
- {
29209
- if (isDrawBorder)
29210
- {
29211
- var xFixed=left+dataWidth/2;
29212
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
29213
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
29214
- }
29215
- else
29216
- {
29217
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));
29218
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));
29219
- }
29220
- }
29221
- this.Canvas.stroke();
29222
- }
29223
- }
29224
- }
29225
- else
29226
- {
29227
- var lineColor;
29228
- if (isEmptyBar && colorData.Border)
29229
- {
29230
- lineColor=colorData.Border.Color;
29231
- }
29232
- else if (!isEmptyBar && colorData.BarColor)
29233
- {
29234
- lineColor=colorData.BarColor;
29235
- }
29236
-
29237
- if (lineColor)
29238
- {
29239
- this.Canvas.strokeStyle=lineColor;
29240
- this.Canvas.beginPath();
29241
- if (isHScreen)
29242
- {
29243
- if (data.High==data.Low)
29244
- {
29245
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29246
- this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
29247
- }
29248
- else
29249
- {
29250
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29251
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
29252
- }
29253
- }
29254
- else
29255
- {
29256
- if (data.High==data.Low)
29257
- {
29258
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29259
- this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
29260
- }
29261
- else
29262
- {
29263
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29264
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
29265
- }
29266
-
29267
- }
29268
- this.Canvas.stroke();
29269
- }
29270
- }
29271
- }
29272
- */
29273
-
29103
+
29274
29104
  this.DrawVirtualBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29275
29105
  {
29276
29106
  var yTop=Math.min(yHigh,yLow), yBottom=Math.max(yHigh,yLow);
@@ -30226,6 +30056,10 @@ function ChartKLine()
30226
30056
  {
30227
30057
  this.DrawOrderFlow_Style4();
30228
30058
  }
30059
+ else if (this.DrawType==18)
30060
+ {
30061
+ this.DrawOrderFlow_Style5();
30062
+ }
30229
30063
  else
30230
30064
  {
30231
30065
  this.DrawKBar();
@@ -31905,6 +31739,13 @@ function ChartKLine()
31905
31739
  }
31906
31740
  }
31907
31741
 
31742
+ ////////////////////////////////////////////////////////////////////////////////
31743
+ //订单流样式5
31744
+ this.DrawOrderFlow_Style5=function()
31745
+ {
31746
+
31747
+ }
31748
+
31908
31749
  //////////////////////////////////////////////////////////////
31909
31750
  // high low bar
31910
31751
  //
@@ -35714,10 +35555,11 @@ function ChartVolStick()
35714
35555
  this.DownColor=g_JSChartResource.DownBarColor;
35715
35556
  this.HistoryData; //历史数据
35716
35557
  this.KLineDrawType=0;
35558
+
35717
35559
  this.ClassName='ChartVolStick';
35718
35560
 
35719
- this.BarWidth; //固定宽度 目前只支持宽度为1
35720
-
35561
+ this.BarWidth; //固定宽度 目前只支持宽度为1
35562
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
35721
35563
  this.PtInChart=this.PtInBar;
35722
35564
  this.DrawSelectedStatus=this.DrawLinePoint;
35723
35565
 
@@ -35764,28 +35606,24 @@ function ChartVolStick()
35764
35606
  var y=this.ChartFrame.GetYFromData(value);
35765
35607
  var barColor=this.GetBarColor(kItem);
35766
35608
  var bUp=barColor.IsUp;
35767
- this.Canvas.fillStyle=barColor.Color;
35609
+
35768
35610
 
35769
35611
  var height=ToFixedRect(Math.abs(yBottom-y)>=1?yBottom-y:1);//高度调整为整数, 如果小于1, 统一使用1
35770
35612
  y=yBottom-height;
35771
- if (this.KLineDrawType==6) //完全空心柱
35613
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35614
+
35615
+ if (bSolidBar)
35772
35616
  {
35773
- this.Canvas.strokeStyle=barColor.Color;
35774
- this.Canvas.beginPath();
35775
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35776
- this.Canvas.stroke();
35617
+ this.Canvas.fillStyle=barColor.Color;
35618
+ this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35777
35619
  }
35778
- else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35620
+ else
35779
35621
  {
35780
- this.Canvas.strokeStyle=this.UpColor;
35622
+ this.Canvas.strokeStyle=barColor.Color;
35781
35623
  this.Canvas.beginPath();
35782
35624
  this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35783
35625
  this.Canvas.stroke();
35784
35626
  }
35785
- else
35786
- {
35787
- this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35788
- }
35789
35627
  }
35790
35628
  }
35791
35629
  else //太细了直接话线
@@ -35858,19 +35696,21 @@ function ChartVolStick()
35858
35696
  var y=this.ChartFrame.GetYFromData(value);
35859
35697
  var barColor=this.GetBarColor(kItem);
35860
35698
  var bUp=barColor.IsUp;
35861
- this.Canvas.fillStyle=barColor.Color;
35862
35699
 
35863
35700
  var height=ToFixedRect(y-yBottom); //高度调整为整数
35864
- if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35701
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35702
+
35703
+ if (bSolidBar)
35865
35704
  {
35866
- this.Canvas.strokeStyle=this.UpColor;
35867
- this.Canvas.beginPath();
35868
- this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35869
- this.Canvas.stroke();
35705
+ this.Canvas.fillStyle=barColor.Color;
35706
+ this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35870
35707
  }
35871
35708
  else
35872
35709
  {
35873
- this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35710
+ this.Canvas.strokeStyle=barColor.Color;
35711
+ this.Canvas.beginPath();
35712
+ this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35713
+ this.Canvas.stroke();
35874
35714
  }
35875
35715
  }
35876
35716
  }
@@ -35946,6 +35786,29 @@ function ChartVolStick()
35946
35786
  else return { Color:this.DownColor, IsUp:false };
35947
35787
  }
35948
35788
 
35789
+ //true=实心 false=空心
35790
+ this.IsSolidBar=function(bUp)
35791
+ {
35792
+ var bSolidBar=true; //实心柱子
35793
+
35794
+ if (this.BarType===0 || this.BarType===1 || this.BarType===2)
35795
+ {
35796
+ if (this.BarType===0) //空心
35797
+ bSolidBar=false;
35798
+ else if (this.BarType===2) //涨实跌空
35799
+ bSolidBar=bUp;
35800
+ }
35801
+ else
35802
+ {
35803
+ if (this.KLineDrawType==6) //完全空心柱
35804
+ bSolidBar=false;
35805
+ else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35806
+ bSolidBar=false;
35807
+ }
35808
+
35809
+ return bSolidBar;
35810
+ }
35811
+
35949
35812
  this.GetMinuteBarColor=function(kItem, preItem)
35950
35813
  {
35951
35814
  var prePrice=kItem.YClose;
@@ -106723,6 +106586,11 @@ function JSDraw(errorHandler,symbolData)
106723
106586
  return color;
106724
106587
  }
106725
106588
 
106589
+ this.STICKTYPE=function(value)
106590
+ {
106591
+ return value;
106592
+ }
106593
+
106726
106594
  //数据左右偏移
106727
106595
  this.XMOVE=function(offset)
106728
106596
  {
@@ -113478,7 +113346,7 @@ function JSExecute(ast,option)
113478
113346
  {
113479
113347
  let varName;
113480
113348
  let draw;
113481
- let color, upColor, downColor;
113349
+ let color, upColor, downColor, stickType;
113482
113350
  let lineWidth;
113483
113351
  let colorStick=false;
113484
113352
  let pointDot=false;
@@ -113623,6 +113491,10 @@ function JSExecute(ast,option)
113623
113491
  {
113624
113492
  downColor=itemExpression.Out;
113625
113493
  }
113494
+ else if (itemExpression.Callee.Name=="STICKTYPE")
113495
+ {
113496
+ stickType=itemExpression.Out;
113497
+ }
113626
113498
  else if (itemExpression.Callee.Name=="XMOVE")
113627
113499
  {
113628
113500
  xOffset=itemExpression.Out;
@@ -113763,6 +113635,7 @@ function JSExecute(ast,option)
113763
113635
  if (upColor) value.UpColor=upColor;
113764
113636
  if (downColor) value.DownColor=downColor;
113765
113637
  if (lineWidth) value.LineWidth=lineWidth;
113638
+ if (IFrameSplitOperator.IsNumber(stickType)) value.StickType=stickType;
113766
113639
  this.OutVarTable.push(value);
113767
113640
  }
113768
113641
  else if (lineArea && varName) //LINEAREA 面积
@@ -114297,6 +114170,9 @@ function JSExecute(ast,option)
114297
114170
  case "DOWNCOLOR":
114298
114171
  node.Out=this.Draw.DOWNCOLOR(args[0]);
114299
114172
  break;
114173
+ case "STICKTYPE": //柱子类型
114174
+ node.Out=this.Draw.STICKTYPE(args[0]);
114175
+ break;
114300
114176
  case "XMOVE":
114301
114177
  node.Out=this.Draw.XMOVE(args[0]);
114302
114178
  break;
@@ -115450,6 +115326,7 @@ function JSExplainer(ast,option)
115450
115326
  return `上涨颜色${args[0]}`;
115451
115327
  case "DOWNCOLOR":
115452
115328
  return `下跌颜色${args[0]}`;
115329
+ case "STICKTYPE":
115453
115330
  case "FIRSTDRAW":
115454
115331
  return "";
115455
115332
 
@@ -116978,6 +116855,7 @@ function ScriptIndex(name,script,args,option)
116978
116855
 
116979
116856
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
116980
116857
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
116858
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
116981
116859
  if (varItem.LineWidth)
116982
116860
  {
116983
116861
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -118889,6 +118767,7 @@ function OverlayScriptIndex(name,script,args,option)
118889
118767
 
118890
118768
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
118891
118769
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
118770
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
118892
118771
  if (varItem.LineWidth)
118893
118772
  {
118894
118773
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -137567,7 +137446,7 @@ function HQChartScriptWorker()
137567
137446
 
137568
137447
 
137569
137448
 
137570
- var HQCHART_VERSION="1.1.13384";
137449
+ var HQCHART_VERSION="1.1.13395";
137571
137450
 
137572
137451
  function PrintHQChartVersion()
137573
137452
  {