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.
@@ -91,7 +91,7 @@ function JSIndexScript()
91
91
  ['BOLL', this.BOLL],['BOLL副图', this.BOLL2],['BBI', this.BBI],
92
92
  ['DKX', this.DKX],['MIKE', this.MIKE],['PBX', this.PBX],
93
93
  ['ENE', this.ENE],['MACD', this.MACD],['KDJ', this.KDJ],["MACD2", this.MACD2],
94
- ['VOL', this.VOL],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
94
+ ['VOL', this.VOL],['VOL2', this.VOL2],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
95
95
  ['WR', this.WR],['BIAS', this.BIAS],['OBV', this.OBV],
96
96
  ['DMI', this.DMI],['CR', this.CR],['PSY', this.PSY],
97
97
  ['CCI', this.CCI],['DMA', this.DMA],['TRIX', this.TRIX],
@@ -655,6 +655,23 @@ MA2:MA(VOL,M2);'
655
655
  return data;
656
656
  }
657
657
 
658
+ JSIndexScript.prototype.VOL2=function()
659
+ {
660
+ let data=
661
+ {
662
+ Name:'VOL', Description:'成交量', IsMainIndex:false,FloatPrecision:0,
663
+ Args:[ { Name:'M1', Value:5}, { Name:'M2', Value:10} ],
664
+ OutName:[ {Name:'MA1',DynamicName:"MA{M1}" }, {Name:'MA2',DynamicName:"MA{M2}" }],
665
+ Script: //脚本
666
+ 'VOL:VOL,VOLSTICK,STICKTYPE(1);\n\
667
+ MA1:MA(VOL,M1);\n\
668
+ MA2:MA(VOL,M2);'
669
+
670
+ };
671
+
672
+ return data;
673
+ }
674
+
658
675
  JSIndexScript.prototype.VOL_OVERLAY=function()
659
676
  {
660
677
  let data=
@@ -7263,6 +7280,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7263
7280
 
7264
7281
  if (this.TryClickButton(x,y,e))
7265
7282
  {
7283
+ this.IsOnTouch=false;
7266
7284
  return;
7267
7285
  }
7268
7286
 
@@ -7295,11 +7313,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7295
7313
 
7296
7314
  if (this.TryClickCrossCursor(x,y, e))
7297
7315
  {
7316
+ this.IsOnTouch=false;
7298
7317
  return;
7299
7318
  }
7300
7319
 
7301
7320
  if (this.TryClickChartTooltipData && this.TryClickChartTooltipData(x,y,e)) //预留给外部点击图标什么用的
7302
7321
  {
7322
+ this.IsOnTouch=false;
7303
7323
  return;
7304
7324
  }
7305
7325
 
@@ -11686,6 +11706,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11686
11706
 
11687
11707
  if (this.Frame && this.Frame.SetLanguage) this.Frame.SetLanguage(this.LanguageID);
11688
11708
 
11709
+ //this.Frame.ClearYCoordinateMaxMin();
11710
+ this.ResetFrameXYSplit();
11689
11711
  this.Frame.SetSizeChage(true);
11690
11712
  this.Draw();
11691
11713
  }
@@ -27371,6 +27393,7 @@ function ChartKLine()
27371
27393
  // 15=HLC Area
27372
27394
  // 16=kagi
27373
27395
  // 17=订单流样式4
27396
+ // 18=订单流样式5
27374
27397
 
27375
27398
  this.CloseLineColor=g_JSChartResource.CloseLineColor;
27376
27399
  this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;
@@ -29033,200 +29056,7 @@ function ChartKLine()
29033
29056
  }
29034
29057
  }
29035
29058
 
29036
- /*
29037
- this.DrawKBarV2=function(data, colorData, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29038
- {
29039
- var isDrawBorder=false;
29040
- var isEmptyBar=false;
29041
- if (colorData.border) isDrawBorder=true;
29042
- if (colorData.Type===0) isEmptyBar=true;
29043
-
29044
- if (dataWidth>=4)
29045
- {
29046
- if (isDrawBorder)
29047
- {
29048
- if ((dataWidth%2)!=0) dataWidth-=1;
29049
- }
29050
-
29051
- if (data.High>data.Close) //上影线
29052
- {
29053
- if (colorData.Line)
29054
- {
29055
- this.Canvas.strokeStyle=colorData.Line.Color;
29056
- this.Canvas.beginPath();
29057
- if (isHScreen)
29058
- {
29059
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
29060
- this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
29061
- }
29062
- else
29063
- {
29064
- if (isDrawBorder)
29065
- {
29066
- var xFixed=left+dataWidth/2;
29067
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
29068
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
29069
- }
29070
- else
29071
- {
29072
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));
29073
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));
29074
- }
29075
- }
29076
- this.Canvas.stroke();
29077
- }
29078
-
29079
- y=yClose;
29080
- }
29081
- else
29082
- {
29083
- y=yClose;
29084
- }
29085
-
29086
- if (isHScreen)
29087
- {
29088
- //实心
29089
- if (!isEmptyBar && colorData.BarColor)
29090
- {
29091
- this.Canvas.fillStyle=colorData.BarColor;
29092
- if (Math.abs(yOpen-y)<1)
29093
- {
29094
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29095
- }
29096
- else
29097
- {
29098
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29099
- }
29100
- }
29101
-
29102
- if (colorData.Border) //空心
29103
- {
29104
- if (Math.abs(yOpen-y)<1)
29105
- {
29106
- this.Canvas.fillStyle=colorData.Border.Color;
29107
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29108
- }
29109
- else
29110
- {
29111
- this.Canvas.strokeStyle=colorData.Border.Color;
29112
- this.Canvas.beginPath();
29113
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29114
- this.Canvas.stroke();
29115
- }
29116
- }
29117
- }
29118
- else
29119
- {
29120
-
29121
- //实心
29122
- if (!isEmptyBar && colorData.BarColor)
29123
- {
29124
- this.Canvas.fillStyle=colorData.BarColor;
29125
- if (Math.abs(yOpen-y)<1)
29126
- {
29127
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29128
- }
29129
- else
29130
- {
29131
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));
29132
- }
29133
- }
29134
-
29135
- if (colorData.Border) //空心
29136
- {
29137
- if (Math.abs(yOpen-y)<1)
29138
- {
29139
- this.Canvas.fillStyle=colorData.Border.Color;
29140
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29141
- }
29142
- else
29143
- {
29144
- this.Canvas.strokeStyle=colorData.Border.Color;
29145
- this.Canvas.beginPath();
29146
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));
29147
- this.Canvas.stroke();
29148
- }
29149
- }
29150
- }
29151
-
29152
- if (data.Open>data.Low) //下影线
29153
- {
29154
- if (colorData.Line)
29155
- {
29156
- this.Canvas.strokeStyle=colorData.Line.Color;
29157
- this.Canvas.beginPath();
29158
- if (isHScreen)
29159
- {
29160
- this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
29161
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
29162
- }
29163
- else
29164
- {
29165
- if (isDrawBorder)
29166
- {
29167
- var xFixed=left+dataWidth/2;
29168
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
29169
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
29170
- }
29171
- else
29172
- {
29173
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));
29174
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));
29175
- }
29176
- }
29177
- this.Canvas.stroke();
29178
- }
29179
- }
29180
- }
29181
- else
29182
- {
29183
- var lineColor;
29184
- if (isEmptyBar && colorData.Border)
29185
- {
29186
- lineColor=colorData.Border.Color;
29187
- }
29188
- else if (!isEmptyBar && colorData.BarColor)
29189
- {
29190
- lineColor=colorData.BarColor;
29191
- }
29192
-
29193
- if (lineColor)
29194
- {
29195
- this.Canvas.strokeStyle=lineColor;
29196
- this.Canvas.beginPath();
29197
- if (isHScreen)
29198
- {
29199
- if (data.High==data.Low)
29200
- {
29201
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29202
- this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
29203
- }
29204
- else
29205
- {
29206
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29207
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
29208
- }
29209
- }
29210
- else
29211
- {
29212
- if (data.High==data.Low)
29213
- {
29214
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29215
- this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
29216
- }
29217
- else
29218
- {
29219
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29220
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
29221
- }
29222
-
29223
- }
29224
- this.Canvas.stroke();
29225
- }
29226
- }
29227
- }
29228
- */
29229
-
29059
+
29230
29060
  this.DrawVirtualBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29231
29061
  {
29232
29062
  var yTop=Math.min(yHigh,yLow), yBottom=Math.max(yHigh,yLow);
@@ -30182,6 +30012,10 @@ function ChartKLine()
30182
30012
  {
30183
30013
  this.DrawOrderFlow_Style4();
30184
30014
  }
30015
+ else if (this.DrawType==18)
30016
+ {
30017
+ this.DrawOrderFlow_Style5();
30018
+ }
30185
30019
  else
30186
30020
  {
30187
30021
  this.DrawKBar();
@@ -31861,6 +31695,13 @@ function ChartKLine()
31861
31695
  }
31862
31696
  }
31863
31697
 
31698
+ ////////////////////////////////////////////////////////////////////////////////
31699
+ //订单流样式5
31700
+ this.DrawOrderFlow_Style5=function()
31701
+ {
31702
+
31703
+ }
31704
+
31864
31705
  //////////////////////////////////////////////////////////////
31865
31706
  // high low bar
31866
31707
  //
@@ -35670,10 +35511,11 @@ function ChartVolStick()
35670
35511
  this.DownColor=g_JSChartResource.DownBarColor;
35671
35512
  this.HistoryData; //历史数据
35672
35513
  this.KLineDrawType=0;
35514
+
35673
35515
  this.ClassName='ChartVolStick';
35674
35516
 
35675
- this.BarWidth; //固定宽度 目前只支持宽度为1
35676
-
35517
+ this.BarWidth; //固定宽度 目前只支持宽度为1
35518
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
35677
35519
  this.PtInChart=this.PtInBar;
35678
35520
  this.DrawSelectedStatus=this.DrawLinePoint;
35679
35521
 
@@ -35720,28 +35562,24 @@ function ChartVolStick()
35720
35562
  var y=this.ChartFrame.GetYFromData(value);
35721
35563
  var barColor=this.GetBarColor(kItem);
35722
35564
  var bUp=barColor.IsUp;
35723
- this.Canvas.fillStyle=barColor.Color;
35565
+
35724
35566
 
35725
35567
  var height=ToFixedRect(Math.abs(yBottom-y)>=1?yBottom-y:1);//高度调整为整数, 如果小于1, 统一使用1
35726
35568
  y=yBottom-height;
35727
- if (this.KLineDrawType==6) //完全空心柱
35569
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35570
+
35571
+ if (bSolidBar)
35728
35572
  {
35729
- this.Canvas.strokeStyle=barColor.Color;
35730
- this.Canvas.beginPath();
35731
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35732
- this.Canvas.stroke();
35573
+ this.Canvas.fillStyle=barColor.Color;
35574
+ this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35733
35575
  }
35734
- else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35576
+ else
35735
35577
  {
35736
- this.Canvas.strokeStyle=this.UpColor;
35578
+ this.Canvas.strokeStyle=barColor.Color;
35737
35579
  this.Canvas.beginPath();
35738
35580
  this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35739
35581
  this.Canvas.stroke();
35740
35582
  }
35741
- else
35742
- {
35743
- this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35744
- }
35745
35583
  }
35746
35584
  }
35747
35585
  else //太细了直接话线
@@ -35814,19 +35652,21 @@ function ChartVolStick()
35814
35652
  var y=this.ChartFrame.GetYFromData(value);
35815
35653
  var barColor=this.GetBarColor(kItem);
35816
35654
  var bUp=barColor.IsUp;
35817
- this.Canvas.fillStyle=barColor.Color;
35818
35655
 
35819
35656
  var height=ToFixedRect(y-yBottom); //高度调整为整数
35820
- if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35657
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35658
+
35659
+ if (bSolidBar)
35821
35660
  {
35822
- this.Canvas.strokeStyle=this.UpColor;
35823
- this.Canvas.beginPath();
35824
- this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35825
- this.Canvas.stroke();
35661
+ this.Canvas.fillStyle=barColor.Color;
35662
+ this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35826
35663
  }
35827
35664
  else
35828
35665
  {
35829
- this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35666
+ this.Canvas.strokeStyle=barColor.Color;
35667
+ this.Canvas.beginPath();
35668
+ this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35669
+ this.Canvas.stroke();
35830
35670
  }
35831
35671
  }
35832
35672
  }
@@ -35902,6 +35742,29 @@ function ChartVolStick()
35902
35742
  else return { Color:this.DownColor, IsUp:false };
35903
35743
  }
35904
35744
 
35745
+ //true=实心 false=空心
35746
+ this.IsSolidBar=function(bUp)
35747
+ {
35748
+ var bSolidBar=true; //实心柱子
35749
+
35750
+ if (this.BarType===0 || this.BarType===1 || this.BarType===2)
35751
+ {
35752
+ if (this.BarType===0) //空心
35753
+ bSolidBar=false;
35754
+ else if (this.BarType===2) //涨实跌空
35755
+ bSolidBar=bUp;
35756
+ }
35757
+ else
35758
+ {
35759
+ if (this.KLineDrawType==6) //完全空心柱
35760
+ bSolidBar=false;
35761
+ else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35762
+ bSolidBar=false;
35763
+ }
35764
+
35765
+ return bSolidBar;
35766
+ }
35767
+
35905
35768
  this.GetMinuteBarColor=function(kItem, preItem)
35906
35769
  {
35907
35770
  var prePrice=kItem.YClose;
@@ -106679,6 +106542,11 @@ function JSDraw(errorHandler,symbolData)
106679
106542
  return color;
106680
106543
  }
106681
106544
 
106545
+ this.STICKTYPE=function(value)
106546
+ {
106547
+ return value;
106548
+ }
106549
+
106682
106550
  //数据左右偏移
106683
106551
  this.XMOVE=function(offset)
106684
106552
  {
@@ -113434,7 +113302,7 @@ function JSExecute(ast,option)
113434
113302
  {
113435
113303
  let varName;
113436
113304
  let draw;
113437
- let color, upColor, downColor;
113305
+ let color, upColor, downColor, stickType;
113438
113306
  let lineWidth;
113439
113307
  let colorStick=false;
113440
113308
  let pointDot=false;
@@ -113579,6 +113447,10 @@ function JSExecute(ast,option)
113579
113447
  {
113580
113448
  downColor=itemExpression.Out;
113581
113449
  }
113450
+ else if (itemExpression.Callee.Name=="STICKTYPE")
113451
+ {
113452
+ stickType=itemExpression.Out;
113453
+ }
113582
113454
  else if (itemExpression.Callee.Name=="XMOVE")
113583
113455
  {
113584
113456
  xOffset=itemExpression.Out;
@@ -113719,6 +113591,7 @@ function JSExecute(ast,option)
113719
113591
  if (upColor) value.UpColor=upColor;
113720
113592
  if (downColor) value.DownColor=downColor;
113721
113593
  if (lineWidth) value.LineWidth=lineWidth;
113594
+ if (IFrameSplitOperator.IsNumber(stickType)) value.StickType=stickType;
113722
113595
  this.OutVarTable.push(value);
113723
113596
  }
113724
113597
  else if (lineArea && varName) //LINEAREA 面积
@@ -114253,6 +114126,9 @@ function JSExecute(ast,option)
114253
114126
  case "DOWNCOLOR":
114254
114127
  node.Out=this.Draw.DOWNCOLOR(args[0]);
114255
114128
  break;
114129
+ case "STICKTYPE": //柱子类型
114130
+ node.Out=this.Draw.STICKTYPE(args[0]);
114131
+ break;
114256
114132
  case "XMOVE":
114257
114133
  node.Out=this.Draw.XMOVE(args[0]);
114258
114134
  break;
@@ -115406,6 +115282,7 @@ function JSExplainer(ast,option)
115406
115282
  return `上涨颜色${args[0]}`;
115407
115283
  case "DOWNCOLOR":
115408
115284
  return `下跌颜色${args[0]}`;
115285
+ case "STICKTYPE":
115409
115286
  case "FIRSTDRAW":
115410
115287
  return "";
115411
115288
 
@@ -116934,6 +116811,7 @@ function ScriptIndex(name,script,args,option)
116934
116811
 
116935
116812
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
116936
116813
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
116814
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
116937
116815
  if (varItem.LineWidth)
116938
116816
  {
116939
116817
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -118845,6 +118723,7 @@ function OverlayScriptIndex(name,script,args,option)
118845
118723
 
118846
118724
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
118847
118725
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
118726
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
118848
118727
  if (varItem.LineWidth)
118849
118728
  {
118850
118729
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -133626,7 +133505,7 @@ function ScrollBarBGChart()
133626
133505
 
133627
133506
 
133628
133507
 
133629
- var HQCHART_VERSION="1.1.13384";
133508
+ var HQCHART_VERSION="1.1.13395";
133630
133509
 
133631
133510
  function PrintHQChartVersion()
133632
133511
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13384";
8
+ var HQCHART_VERSION="1.1.13395";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {