hqchart 1.1.15121 → 1.1.15126

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.
@@ -14499,6 +14499,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14499
14499
  if (IFrameSplitOperator.IsBool(windowItem.IsShowTitleArrow)) frame.IsShowTitleArrow=windowItem.IsShowTitleArrow;
14500
14500
  if (IFrameSplitOperator.IsNumber(windowItem.TitleArrowType)) frame.TitleArrowType=windowItem.TitleArrowType;
14501
14501
  if (IFrameSplitOperator.IsBool(windowItem.IsShowIndexName)) frame.IsShowIndexName=windowItem.IsShowIndexName;
14502
+ if (IFrameSplitOperator.IsBool(windowItem.IsSinlgeLine)) frame.IsSinlgeLine=windowItem.IsSinlgeLine;
14502
14503
  if (IFrameSplitOperator.IsBool(windowItem.IsShowOverlayIndexName)) frame.IsShowOverlayIndexName=windowItem.IsShowOverlayIndexName;
14503
14504
  if (IFrameSplitOperator.IsNumber(windowItem.IndexParamSpace)) frame.IndexParamSpace=windowItem.IndexParamSpace;
14504
14505
  if (IFrameSplitOperator.IsNumber(windowItem.IndexTitleSpace)) frame.IndexTitleSpace=windowItem.IndexTitleSpace;
@@ -14622,6 +14623,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14622
14623
  if (IFrameSplitOperator.IsBool(option.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;
14623
14624
  if (IFrameSplitOperator.IsNumber(option.TitleArrowType)) subFrame.Frame.TitleArrowType=option.TitleArrowType;
14624
14625
  if (IFrameSplitOperator.IsBool(option.IsShowIndexName)) subFrame.Frame.IsShowIndexName=option.IsShowIndexName;
14626
+ if (IFrameSplitOperator.IsBool(option.IsSinlgeLine)) subFrame.Frame.IsSinlgeLine=option.IsSinlgeLine;
14625
14627
  if (IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName)) subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;
14626
14628
  if (IFrameSplitOperator.IsNumber(option.IndexParamSpace)) subFrame.Frame.IndexParamSpace=option.IndexParamSpace;
14627
14629
  if (IFrameSplitOperator.IsBool(option.IsShowXLine)) subFrame.Frame.IsShowXLine=option.IsShowXLine;
@@ -17391,6 +17393,7 @@ function IChartFramePainting()
17391
17393
  this.IsShowBorder = true; //是否显示边框
17392
17394
  this.IsShowTitleArrow=g_JSChartResource.IndexTitle.EnableIndexArrow; //是否显示指标信息上涨下跌箭头
17393
17395
  this.TitleArrowType=g_JSChartResource.IndexTitle.ArrowType; //指标信息上涨下跌箭头类型 0=独立颜色 1=跟指标名字颜色一致
17396
+ this.IsSinlgeLine=g_JSChartResource.IndexTitle.IsSinlgeLine;
17394
17397
  this.IsShowIndexName=true; //是否显示指标名字
17395
17398
  this.IsShowOverlayIndexName=true; //是否显示叠加指标名字
17396
17399
  //this.OverlayIndexType= { Position:0, LineSpace:5 };
@@ -66784,6 +66787,7 @@ function DynamicChartTitlePainting()
66784
66787
  this.IsShowIndexName=true; //是否显示指标名字
66785
66788
  this.IsShowIndexTitle=true; //是否显示指标标题信息
66786
66789
  this.IsShowNameArrow=false;
66790
+ this.IsSinlgeLine=false; //主图指标标题是否单行显示
66787
66791
  this.NameArrowConfig=CloneData(g_JSChartResource.IndexTitle.NameArrow);
66788
66792
  this.CustomLocation; //自定义位置 { IsShow:, Top:, TitleHeight: }
66789
66793
 
@@ -67522,6 +67526,7 @@ function DynamicChartTitlePainting()
67522
67526
  this.IsShowUpDownArrow=this.Frame.IsShowTitleArrow;
67523
67527
  this.TitleArrowType=this.Frame.TitleArrowType;
67524
67528
  this.IsShowIndexName=this.Frame.IsShowIndexName;
67529
+ this.IsSinlgeLine=this.Frame.IsSinlgeLine;
67525
67530
  this.IsShowOverlayIndexName=this.Frame.IsShowOverlayIndexName;
67526
67531
  this.OverlayIndexType.Position=this.Frame.OverlayIndexType.Position;
67527
67532
  this.OverlayIndexType.LineSpace=this.Frame.OverlayIndexType.LineSpace;
@@ -67928,6 +67933,7 @@ function DynamicChartTitlePainting()
67928
67933
 
67929
67934
  if ((left+textWidth+space)>right)
67930
67935
  {
67936
+ if (this.IsSinlgeLine) break;
67931
67937
  left=newLineLeft;
67932
67938
  bottom+=lineHeight;
67933
67939
  right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
@@ -67992,6 +67998,7 @@ function DynamicChartTitlePainting()
67992
67998
  var textWidth=this.Canvas.measureText(text).width+space;
67993
67999
  if ((left+textWidth)>right) //换行
67994
68000
  {
68001
+ if (this.IsSinlgeLine) break;
67995
68002
  left=newLineLeft;
67996
68003
  bottom+=lineHeight;
67997
68004
  right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
@@ -81479,6 +81486,8 @@ function JSChartResource()
81479
81486
  EnableIndexArrow:true, //指标数值是否带上涨下跌箭头
81480
81487
 
81481
81488
  NameArrow:{ Color:"rgb(43,54,69)", Space:2, Symbol:'▼' },
81489
+
81490
+ IsSinlgeLine:false, //主图指标是否单行显示 false=多行显示
81482
81491
  }
81483
81492
 
81484
81493
  this.Title={
@@ -83164,6 +83173,7 @@ function JSChartResource()
83164
83173
 
83165
83174
  if (IFrameSplitOperator.IsNumber(item.ArrowType)) this.IndexTitle.ArrowType=item.ArrowType;
83166
83175
  if (IFrameSplitOperator.IsBool(item.EnableIndexArrow)) this.IndexTitle.EnableIndexArrow=item.EnableIndexArrow;
83176
+ if (IFrameSplitOperator.IsBool(item.IsSinlgeLine)) this.IndexTitle.IsSinlgeLine=item.IsSinlgeLine;
83167
83177
 
83168
83178
  if (item.NameArrow)
83169
83179
  {
@@ -109561,7 +109571,7 @@ function JSDivFrameToolbar()
109561
109571
  {
109562
109572
  var item=aryButton[i];
109563
109573
  if (!item.ID || !item.ClassName) continue;
109564
- var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109574
+ var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null, SpanText:item.SpanText };
109565
109575
  if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109566
109576
 
109567
109577
  this.AryButton.push(newItem);
@@ -109592,7 +109602,7 @@ function JSDivFrameToolbar()
109592
109602
  if (!frame && this.FrameID>=0 && this.FrameID<this.HQChart.Frame.SubFrame.length)
109593
109603
  frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109594
109604
 
109595
- var aryDefaultButton=JSDivFrameToolbar.GetDfaultButtons();
109605
+ var aryDefaultButton=JSDivFrameToolbar.GetDfaultButtons(frame);
109596
109606
  var aryButton=[];
109597
109607
  for(var i=0;i<aryDefaultButton.length; i++)
109598
109608
  {
@@ -109717,6 +109727,7 @@ function JSDivFrameToolbar()
109717
109727
  var spanDom=document.createElement("span");
109718
109728
  spanDom.className=item.ClassName;
109719
109729
  spanDom.onmousedown=(e)=>{ this.OnClickButton(e, item); };
109730
+ if (item.SpanText) spanDom.innerText=item.SpanText;
109720
109731
  item.Span=spanDom;
109721
109732
  btnDiv.appendChild(spanDom);
109722
109733
 
@@ -109801,7 +109812,7 @@ function JSDivFrameToolbar()
109801
109812
  }
109802
109813
  }
109803
109814
 
109804
- JSDivFrameToolbar.GetDfaultButtons=function()
109815
+ JSDivFrameToolbar.GetDfaultButtons=function(frame)
109805
109816
  {
109806
109817
  var aryButton=
109807
109818
  [
@@ -109825,6 +109836,13 @@ JSDivFrameToolbar.GetDfaultButtons=function()
109825
109836
  ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109826
109837
  Span:null,Div:null, TooltipSpan:null
109827
109838
  },
109839
+
109840
+ /*
109841
+ {
109842
+ ID:"TEST_8889", ClassName:"UMyChart_FrameToolbar_Span_Text", Tooltip:{ Text:"测试按钮提示"}, SpanText:"测试按钮",
109843
+ Span:null, Div:null, TooltipSpan:null
109844
+ },
109845
+ */
109828
109846
  ];
109829
109847
 
109830
109848
  return aryButton
@@ -164648,7 +164666,7 @@ function JSDialogSearchIndex()
164648
164666
  var indexItem=cellItem.IndexItem;
164649
164667
  if (indexItem.Type==0 ) //系统指标
164650
164668
  {
164651
- this.HQChart.ChangeIndex(this.OpData.WindowIndex, indexItem.ID );
164669
+ this.HQChart.ChangeIndex(this.OpData.WindowIndex, indexItem.ID, indexItem);
164652
164670
  }
164653
164671
  else if(indexItem.Type==4 || indexItem.Type==5) //五彩K线
164654
164672
  {
@@ -164679,6 +164697,7 @@ function JSDialogSearchIndex()
164679
164697
  if (indexItem.Type==0) //系统指标
164680
164698
  {
164681
164699
  var obj={ WindowIndex:this.OpData.WindowIndex, IndexName:indexItem.ID };
164700
+ if (indexItem.Lock) obj.Lock=indexItem.Lock;
164682
164701
  this.HQChart.AddOverlayIndex(obj);
164683
164702
  }
164684
164703
  else if (indexItem.Type==1) //自定义脚本指标
@@ -165151,11 +165170,8 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
165151
165170
  AryIndex:
165152
165171
  [
165153
165172
  { Name:"面积图(后台指标)", ID:"API-DRAWBAND", Type:2, Args:null, Lock:{ IsLocked:true } },
165154
- {
165155
- Name:"波段量能跟庄-波段量能", ID:"TEST_INDEX_4AE0_1", Type:1, Args:null,
165156
- Script:TEST_INDEX_4AE0_1,
165157
- Lock:{ IsLocked:true }
165158
- }
165173
+ { Name:"波段量能跟庄-波段量能", ID:"TEST_INDEX_4AE0_1", Type:0, Lock:{ IsLocked:true } },
165174
+ { Name:"飞龙八级进-主图", ID:"TEST_INDEX_4AE0_2", Type:0, Lock:{ IsLocked:true } }
165159
165175
  ]
165160
165176
  },
165161
165177
  {
@@ -165658,6 +165674,7 @@ function JSDialogModifyIndexParam()
165658
165674
  /////////////////////////////////////////////////////////////////////////////////////////////
165659
165675
  //测试指标
165660
165676
 
165677
+
165661
165678
  var TEST_INDEX_4AE0_1=`能量:=SQRT(VOL)*(((C-(H+L)/2))/((H+L)/2));
165662
165679
  平滑能量:=EMA(能量,16);
165663
165680
  能量惯性:EMA(平滑能量,16);
@@ -165674,6 +165691,111 @@ STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.6),(能量惯性-能量惯
165674
165691
  STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.8),(能量惯性-能量惯性*0.95),3,0), COLORFFFF00;`
165675
165692
 
165676
165693
 
165694
+ var TEST_INDEX_4AE0_2=`
165695
+ MA3:MA(CLOSE,3),COLORWHITE;
165696
+ MA17:MA(CLOSE,17),COLORYELLOW;
165697
+ QQ:=0,COLORWHITE;
165698
+ MA1:=MA(CLOSE,3);
165699
+ MA2:=MA(CLOSE,17);
165700
+ JG:=CROSS(MA1,MA2);
165701
+ VOLUME:=VOL,VOLSTICK;
165702
+ MAVOL1:=MA(VOLUME,3);
165703
+ MAVOL2:=MA(VOLUME,17);
165704
+ NL:=CROSS(MAVOL1,MAVOL2);
165705
+ DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
165706
+ DEA:=EMA(DIF,9);
165707
+ MACD:=(DIF-DEA)*2,COLORSTICK;
165708
+ NA:=CROSS(DIF,DEA);
165709
+ RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
165710
+ K:=SMA(RSV,9,1);
165711
+ D:=SMA(K,9,1);
165712
+ J:=3*K-2*D;
165713
+ KD:=CROSS(K,D) AND CROSS(J,D);
165714
+ 飞龙八级进:DRAWTEXT((JG AND NL AND NA) OR (JG AND NL AND KD) OR
165715
+ (JG AND NA AND KD) OR (NL AND NA AND KD),L*0.95,' 飞龙八级进'),COLORYELLOW;
165716
+ X:=LLV(J,2)=LLV(J,8);
165717
+ Y:=IF(CROSS(J,REF(J+0.01,1)) AND X AND J<20,30,0);
165718
+ DRAWTEXT(CROSS(J,REF(J+0.01,1)) AND X AND J<20,LOW*0.98,''),COLORLIMAGENTA;
165719
+ 空:=EMA(C,5);
165720
+ 均衡:=EMA(空,5),COLORWHITE;
165721
+ 中轨:=HHV(MA(H,13),13),COLORRED,LINETHICK2;
165722
+ VAR5:=FILTER(均衡>REF(均衡,1)AND 中轨<REF(中轨,1)AND C>REF(C,1),11);
165723
+ DRAWTEXT(VAR5,L*0.98,''),COLORYELLOW;
165724
+ PT:=XMA(H,20);
165725
+ PAN:=XMA(CLOSE,7),COLORBROWN;
165726
+ RUO:=MEMA(CLOSE,3),COLORLIBLUE;
165727
+ STICKLINE(CLOSE> REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORRED;
165728
+ STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR000055;
165729
+ STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR000077;
165730
+ STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR000099;
165731
+ STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLOR0000BB;
165732
+ STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLOR0000DD;
165733
+ STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLOR0000FF;
165734
+ STICKLINE(CLOSE= REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORWHITE;
165735
+ STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR555555;
165736
+ STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR777777;
165737
+ STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR999999;
165738
+ STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORBBBBBB;
165739
+ STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORDDDDDD;
165740
+ STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORFFFFFF;
165741
+ STICKLINE(CLOSE< REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORCYAN;
165742
+ STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR990000;
165743
+ STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLORCC0000;
165744
+ STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLORFF4400;
165745
+ STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORFF8800;
165746
+ STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORFFCC00;
165747
+ STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORCYAN;
165748
+ 高:=REF(HHV(H,80),3);
165749
+ 低:=REF(LLV(L,80),3);
165750
+ H19:=高-(高-低)*0.191;
165751
+ H38:=高-(高-低)*0.382;
165752
+ H中:=高-(高-低)*0.5;
165753
+ H61:=高-(高-低)*0.618;
165754
+ H80:=高-(高-低)*0.809;
165755
+ 顶点:REFDATE(高,DATE),COLORWHITE;
165756
+ REFDATE(H19,DATE),COLORYELLOW;
165757
+ REFDATE(H38,DATE),COLORMAGENTA;
165758
+ REFDATE(H中,DATE),COLORRED;
165759
+ REFDATE(H61,DATE),COLORMAGENTA;
165760
+ REFDATE(H80,DATE),COLORYELLOW;
165761
+ 低点:REFDATE(低,DATE),COLORWHITE;
165762
+ DRAWTEXT(ISLASTBAR,低点,''),COLORWHITE;
165763
+ `
165764
+
165765
+
165766
+ //添加测试系统指标
165767
+ AddTestSystemIndex=function()
165768
+ {
165769
+ var aryIndex=[];
165770
+
165771
+ aryIndex.push(
165772
+ {
165773
+ ID:"TEST_INDEX_4AE0_1",
165774
+ Name: '波段量能跟庄-波段量能',
165775
+ Script:TEST_INDEX_4AE0_1,
165776
+ Args: null,
165777
+
165778
+ });
165779
+
165780
+
165781
+ aryIndex.push(
165782
+ {
165783
+ ID:"TEST_INDEX_4AE0_2", //指标ID
165784
+ Name:'飞龙八级进-主图', //指标名称
165785
+ Description:'飞龙八级进', //描述信息
165786
+ IsMainIndex:true, //是否是主图指标
165787
+ Condition: { Period:[CONDITION_PERIOD.KLINE_DAY_ID], Message:"指标(飞龙八级进-主图)只支持日线周期" },
165788
+ Args:null, //指标参数
165789
+ Script:TEST_INDEX_4AE0_2,
165790
+ });
165791
+
165792
+ JSIndexScript.AddIndex(aryIndex);
165793
+ }
165794
+
165795
+
165796
+ AddTestSystemIndex();
165797
+
165798
+
165677
165799
 
165678
165800
 
165679
165801
  ///////////////////////////////////////////////////////////////////////////////////
@@ -165797,7 +165919,7 @@ function HQChartScriptWorker()
165797
165919
 
165798
165920
 
165799
165921
 
165800
- var HQCHART_VERSION="1.1.15120";
165922
+ var HQCHART_VERSION="1.1.15125";
165801
165923
 
165802
165924
  function PrintHQChartVersion()
165803
165925
  {
@@ -165927,6 +166049,8 @@ export default {
165927
166049
  IChartDrawPicture:IChartDrawPicture, //画图工具
165928
166050
  DynamicTitleData:DynamicTitleData, //指标标题数据
165929
166051
 
166052
+ JSDivFrameToolbar:JSDivFrameToolbar, //div指标工具条
166053
+
165930
166054
  CONDITION_PERIOD:CONDITION_PERIOD, //指标周期条件枚举
165931
166055
 
165932
166056
  //内部图形导出