hqchart 1.1.14561 → 1.1.14576

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.
@@ -305,10 +305,14 @@ function JSDialogSearchIndex()
305
305
  {
306
306
  if (!IFrameSplitOperator.IsNumber(this.OpData.WindowIndex)) return;
307
307
  var indexItem=cellItem.IndexItem;
308
- if (indexItem.Type==0) //系统指标
308
+ if (indexItem.Type==0 ) //系统指标
309
309
  {
310
310
  this.HQChart.ChangeIndex(this.OpData.WindowIndex, indexItem.ID );
311
311
  }
312
+ else if(indexItem.Type==4 || indexItem.Type==5) //五彩K线
313
+ {
314
+ this.HQChart.ChangeInstructionIndex(indexItem.ID);
315
+ }
312
316
  else if (indexItem.Type==1) //自定义脚本指标
313
317
  {
314
318
  var indexData={ ID:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
@@ -348,6 +352,10 @@ function JSDialogSearchIndex()
348
352
  {
349
353
  this.HQChart.ChangeIndexTemplate(indexItem.TemplateData)
350
354
  }
355
+ else if(indexItem.Type==4 || indexItem.Type==5) //五彩K线
356
+ {
357
+ this.HQChart.ChangeInstructionIndex(indexItem.ID);
358
+ }
351
359
  }
352
360
  else if (this.OpData.OpType==3) //新增加指标窗口
353
361
  {
@@ -570,7 +578,7 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
570
578
  Group:{ ID:"超买超卖型", Name:"超买超卖型"} ,
571
579
  AryIndex:
572
580
  [
573
- {Name:"ADTM 动态买卖气指标", ID:"ADTM", Type:0 }, //Type:0=系统指标 1=自定义通达信脚本 2=api指标
581
+ {Name:"ADTM 动态买卖气指标", ID:"ADTM", Type:0 }, //Type:0=系统指标 1=自定义通达信脚本 2=api指标 3=指标模板 4=交易系统 5=五彩K线
574
582
  {Name:"BIAS 乖离率", ID:"BIAS", Type:0},
575
583
  {Name:"BIAS36 三六乖离", ID:"BIAS36", Type:0 },
576
584
  {Name:"BIAS_QL 乖离率-传统版", ID:"BIAS_QL", Type:0 },
@@ -642,6 +650,80 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
642
650
  {Name:"WAD 威廉多空力度线", ID:"WAD", Type:0}
643
651
  ]
644
652
  },
653
+ {
654
+ Group:{ ID:"五彩K线", Name:"五彩K线"} ,
655
+ AryIndex:
656
+ [
657
+ {Name:"五彩K线-十字星", ID:"五彩K线-十字星", Type:5},
658
+ {Name:"五彩K线-早晨之星", ID:"五彩K线-早晨之星", Type:5},
659
+ {Name:"五彩K线-黄昏之星", ID:"五彩K线-黄昏之星", Type:5},
660
+ {Name:"五彩K线-长十字", ID:"五彩K线-长十字", Type:5},
661
+
662
+ {Name:"五彩K线-身怀六甲", ID:"五彩K线-身怀六甲", Type:5},
663
+ {Name:"五彩K线-三个白武士", ID:"五彩K线-三个白武士", Type:5},
664
+ {Name:"五彩K线-三只乌鸦", ID:"五彩K线-三只乌鸦", Type:5},
665
+ {Name:"五彩K线-光头阳线", ID:"五彩K线-光头阳线", Type:5},
666
+
667
+ {Name:"五彩K线-光脚阴线", ID:"五彩K线-光脚阴线线", Type:5},
668
+ {Name:"五彩K线-垂死十字", ID:"五彩K线-垂死十字", Type:5},
669
+ {Name:"五彩K线-早晨十字星", ID:"五彩K线-早晨十字星", Type:5},
670
+ {Name:"五彩K线-黄昏十字星", ID:"五彩K线-黄昏十字星", Type:5},
671
+
672
+ {Name:"五彩K线-射击之星", ID:"五彩K线-射击之星", Type:5},
673
+ {Name:"五彩K线-倒转锤头", ID:"五彩K线-倒转锤头", Type:5},
674
+ {Name:"五彩K线-锤头", ID:"五彩K线-锤头", Type:5},
675
+ {Name:"五彩K线-吊颈", ID:"五彩K线-吊颈星", Type:5},
676
+
677
+ {Name:"五彩K线-穿头破脚", ID:"五彩K线-穿头破脚", Type:5},
678
+ {Name:"五彩K线-出水芙蓉", ID:"五彩K线-出水芙蓉", Type:5},
679
+ {Name:"五彩K线-乌云盖顶", ID:"五彩K线-乌云盖顶", Type:5},
680
+ {Name:"五彩K线-曙光初现", ID:"五彩K线-曙光初现", Type:5},
681
+
682
+ {Name:"五彩K线-十字胎", ID:"五彩K线-十字胎", Type:5},
683
+ {Name:"五彩K线-剑", ID:"五彩K线-剑", Type:5},
684
+ {Name:"五彩K线-平顶", ID:"五彩K线-平顶", Type:5},
685
+ {Name:"五彩K线-平底", ID:"五彩K线-平底", Type:5},
686
+
687
+ {Name:"五彩K线-大阳烛", ID:"五彩K线-大阳烛", Type:5},
688
+ {Name:"五彩K线-大阴烛", ID:"五彩K线-大阴烛", Type:5},
689
+
690
+ {Name:"五彩K线-好友反攻", ID:"五彩K线-好友反攻", Type:5},
691
+ {Name:"五彩K线-跳空缺口", ID:"五彩K线-跳空缺口", Type:5},
692
+
693
+ {Name:"五彩K线-双飞乌鸦", ID:"五彩K线-双飞乌鸦", Type:5},
694
+ {Name:"五彩K线-上升三部曲", ID:"五彩K线-上升三部曲", Type:5},
695
+ {Name:"五彩K线-下跌三部曲", ID:"五彩K线-下跌三部曲", Type:5},
696
+ {Name:"五彩K线-长下影", ID:"五彩K线-长下影", Type:5},
697
+
698
+ {Name:"五彩K线-长上影", ID:"五彩K线-长上影", Type:5},
699
+ {Name:"五彩K线-分离", ID:"五彩K线-分离", Type:5},
700
+
701
+ ]
702
+ },
703
+ {
704
+ Group:{ ID:"交易系统", Name:"交易系统"} ,
705
+ AryIndex:
706
+ [
707
+ {Name:"交易系统-BIAS", ID:"交易系统-BIAS", Type:4},
708
+ {Name:"交易系统-CCI", ID:"交易系统-CCI", Type:4},
709
+ {Name:"交易系统-DMI", ID:"交易系统-DMI", Type:4},
710
+ {Name:"交易系统-KD", ID:"交易系统-KD", Type:4},
711
+
712
+ {Name:"交易系统-BOLL", ID:"交易系统-BOLL", Type:4},
713
+ {Name:"交易系统-KDJ", ID:"交易系统-KDJ", Type:4},
714
+ {Name:"交易系统-MACD", ID:"交易系统-MACD", Type:4},
715
+ {Name:"交易系统-KD", ID:"交易系统-KD", Type:4},
716
+
717
+ {Name:"交易系统-MTM", ID:"交易系统-MTM", Type:4},
718
+ {Name:"交易系统-PSY", ID:"交易系统-PSY", Type:4},
719
+ {Name:"交易系统-ROC", ID:"交易系统-ROC", Type:4},
720
+ {Name:"交易系统-RSI", ID:"交易系统-RSI", Type:4},
721
+
722
+ {Name:"交易系统-VR", ID:"交易系统-VR", Type:4},
723
+ {Name:"交易系统-DPSJ", ID:"交易系统-DPSJ", Type:4},
724
+
725
+ ]
726
+ },
645
727
 
646
728
 
647
729
  {
@@ -74,6 +74,11 @@ function JSTooltipKLineChart()
74
74
  document.body.appendChild(divDom);
75
75
 
76
76
  this.UpdateStyle();
77
+
78
+ if (!this.KLine.Option.EnableResize)
79
+ {
80
+ if (this.KLine.JSChart) this.KLine.JSChart.OnSize({ Type:1 });
81
+ }
77
82
  }
78
83
 
79
84
  this.UpdateStyle=function()
@@ -127,11 +132,6 @@ function JSTooltipKLineChart()
127
132
  }
128
133
  }
129
134
 
130
- if (!this.KLine.Option.EnableResize)
131
- {
132
- if (this.KLine.JSChart) this.KLine.JSChart.OnSize({ Type:1 });
133
- }
134
-
135
135
  if (IFrameSplitOperator.IsNumberV2(x,y))
136
136
  {
137
137
 
@@ -249,17 +249,18 @@ JSTooltipKLineChart.GetKLineOption=function()
249
249
  AutoRight:{ Blank:5, MinWidth:30 },
250
250
  },
251
251
 
252
- Frame: //子框架设置
253
- [
254
- {
255
- SplitCount:4,
256
- IsShowLeftText:false,
257
- },
258
-
259
- { SplitCount:3,IsShowLeftText:false, },
260
- { SplitCount:3, IsShowLeftText:false,}
261
- ],
262
- }
252
+ Frame: //子框架设置
253
+ [
254
+ {
255
+ SplitCount:4,
256
+ IsShowLeftText:false,
257
+ },
258
+
259
+ { SplitCount:3,IsShowLeftText:false, },
260
+ { SplitCount:3, IsShowLeftText:false,}
261
+ ],
262
+ }
263
+
263
264
  return option;
264
265
  }
265
266
 
@@ -100,14 +100,21 @@ function JSPopMinuteChart()
100
100
  this.Minute.Option.OnCreatedCallback=(chart)=>{ this.OnCreateHQChart(chart); }
101
101
  this.Minute.Option.NetworkFilter=(data, callback)=>{ this.NetworkFilter(data, callback); }
102
102
 
103
- this.Minute.Option.EventCallback=
104
- [
105
- {
106
- event:JSCHART_EVENT_ID.ON_KEYDOWN, //键盘消息
107
- callback:(event, data, obj)=>{ this.OnKeyDown(event, data, obj); }
108
- },
109
- ];
103
+ var keyDownEvent=
104
+ {
105
+ event:JSCHART_EVENT_ID.ON_KEYDOWN, //键盘消息
106
+ callback:(event, data, obj)=>{ this.OnKeyDown(event, data, obj); }
107
+ };
110
108
 
109
+ if (Array.isArray(this.Minute.Option.EventCallback))
110
+ {
111
+ this.Minute.Option.EventCallback.push(keyDownEvent);
112
+ }
113
+ else
114
+ {
115
+ this.Minute.Option.EventCallback=[keyDownEvent];
116
+ }
117
+
111
118
  chart.SetOption(this.Minute.Option); //设置K线配置
112
119
 
113
120
  document.body.appendChild(divDom);
@@ -359,7 +366,12 @@ function JSPopMinuteChart()
359
366
  {
360
367
  if (!this.Minute.JSChart) return;
361
368
 
362
- if (symbol) this.Symbol=symbol;
369
+ if (symbol)
370
+ {
371
+ this.Symbol=symbol;
372
+ this.Name=symbol;
373
+ }
374
+
363
375
  if (IFrameSplitOperator.IsPlusNumber(date)) this.Date=date;
364
376
 
365
377
  this.UpdateDialogTitle();
@@ -528,6 +540,11 @@ function JSTooltipMinuteChart()
528
540
  document.body.appendChild(divDom);
529
541
 
530
542
  this.UpdateStyle();
543
+
544
+ if (!this.Minute.Option.EnableResize)
545
+ {
546
+ if (this.Minute.JSChart) this.Minute.JSChart.OnSize();
547
+ }
531
548
  }
532
549
 
533
550
  this.UpdateStyle=function()
@@ -736,6 +753,7 @@ function MarkPopMinutePaint()
736
753
  this.LineColor=g_JSChartResource.PopMinuteChart.Mark.LineColor;
737
754
  this.SubFrame;
738
755
  this.IsDynamic=true;
756
+ this.IsShow=true;
739
757
 
740
758
 
741
759
  this.ReloadResource=function(resource)
@@ -765,6 +783,7 @@ function MarkPopMinutePaint()
765
783
  this.Draw=function()
766
784
  {
767
785
  this.SubFrame=null;
786
+ if (!this.IsShow) return;
768
787
  if (!this.HQChart) return;
769
788
  if (!this.ChartFrame || !IFrameSplitOperator.IsNonEmptyArray(this.ChartFrame.SubFrame)) return;
770
789
  if (!this.MapDate || this.MapDate.size<=0) return;
@@ -819,9 +838,10 @@ function MarkPopMinutePaint()
819
838
 
820
839
  this.Canvas.lineWidth=lineWidth;
821
840
  this.Canvas.strokeStyle=this.LineColor;
841
+ var x=ToFixedPoint2(lineWidth,item.XCenter);
822
842
  this.Canvas.beginPath();
823
- this.Canvas.moveTo(item.XCenter,border.TopEx);
824
- this.Canvas.lineTo(item.XCenter,border.BottomEx);
843
+ this.Canvas.moveTo(x,border.TopEx);
844
+ this.Canvas.lineTo(x,border.BottomEx);
825
845
  this.Canvas.stroke();
826
846
  }
827
847
  }
@@ -25772,6 +25772,19 @@ function APIScriptIndex(name,script,args,option, isOverlay)
25772
25772
 
25773
25773
  result.push(outVarItem);
25774
25774
  }
25775
+ else if (draw.DrawType=="DRAWTEXT_LINE")
25776
+ {
25777
+ drawItem.Name=draw.Name;
25778
+ drawItem.Type=draw.Type;
25779
+
25780
+ drawItem.DrawType=draw.DrawType;
25781
+ drawItem.DrawData=draw.DrawData; //{ Price:, Text:{ Title:text, Color:textcolor }, Line:{ Type:linetype, Color:linecolor } };
25782
+
25783
+ outVarItem.Draw=drawItem;
25784
+ if (draw.Font) outVarItem.Font=draw.Font;
25785
+
25786
+ result.push(outVarItem);
25787
+ }
25775
25788
  else
25776
25789
  {
25777
25790
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接