Browse Source

init

master
npmrun 4 years ago
commit
a6bd00925c
  1. BIN
      .DS_Store
  2. 2
      .gitignore
  3. 16
      .hbuilderx/launch.json
  4. 17
      App.vue
  5. 341
      components/HQChartControl/HQChartControl.vue
  6. 14
      index.html
  7. 10
      main.js
  8. 72
      manifest.json
  9. 3286
      package-lock.json
  10. 16
      package.json
  11. 16
      pages.json
  12. 127
      pages/index/index.vue
  13. 15
      plugins/graph.js
  14. BIN
      static/logo.png
  15. 76
      uni.scss
  16. 274
      uni_modules/jones-hqchart2/changelog.md
  17. 511
      uni_modules/jones-hqchart2/js_sdk/HQChartControl.vue
  18. 6134
      uni_modules/jones-hqchart2/js_sdk/umychart.chartpaint.wechat.js
  19. 1468
      uni_modules/jones-hqchart2/js_sdk/umychart.charttitle.wechat.js
  20. 10644
      uni_modules/jones-hqchart2/js_sdk/umychart.complier.wechat.js
  21. 15
      uni_modules/jones-hqchart2/js_sdk/umychart.console.wechat.js
  22. 2443
      uni_modules/jones-hqchart2/js_sdk/umychart.coordinatedata.wechat.js
  23. 1796
      uni_modules/jones-hqchart2/js_sdk/umychart.data.wechat.js
  24. 1030
      uni_modules/jones-hqchart2/js_sdk/umychart.explainer.wechat.js
  25. 1003
      uni_modules/jones-hqchart2/js_sdk/umychart.extendchart.wechat.js
  26. 2024
      uni_modules/jones-hqchart2/js_sdk/umychart.framesplit.wechat.js
  27. 934
      uni_modules/jones-hqchart2/js_sdk/umychart.hqIndexformula.wechat.js
  28. 3514
      uni_modules/jones-hqchart2/js_sdk/umychart.index.data.wechat.js
  29. 1119
      uni_modules/jones-hqchart2/js_sdk/umychart.index.wechat.js
  30. 702
      uni_modules/jones-hqchart2/js_sdk/umychart.klineinfo.wechat.js
  31. 410
      uni_modules/jones-hqchart2/js_sdk/umychart.regressiontest.wechat.js
  32. 646
      uni_modules/jones-hqchart2/js_sdk/umychart.resource.wechat.js
  33. 342
      uni_modules/jones-hqchart2/js_sdk/umychart.style.wechat.js
  34. 71
      uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.canvas.helper.js
  35. 84908
      uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.h5.js
  36. 14245
      uni_modules/jones-hqchart2/js_sdk/umychart.wechat.3.0.js
  37. 40
      uni_modules/jones-hqchart2/js_sdk/用户协议.txt
  38. 80
      uni_modules/jones-hqchart2/package.json
  39. 285
      uni_modules/jones-hqchart2/readme.md

BIN
.DS_Store

Binary file not shown.

2
.gitignore

@ -0,0 +1,2 @@
node_modules
unpackage

16
.hbuilderx/launch.json

@ -0,0 +1,16 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}

17
App.vue

@ -0,0 +1,17 @@
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>

341
components/HQChartControl/HQChartControl.vue

@ -0,0 +1,341 @@
<template>
<!-- #ifdef H5 -->
<div class='kline' v-bind:id='KLineID' v-bind:style="{width: ChartWidth+'px', height: ChartHeight+'px'}"
ref='kline'></div>
<!-- #endif -->
<!-- #ifndef H5 -->
<canvas v-bind:id='KLineID' v-bind:canvas-id='KLineID' class='kline2'
v-bind:style="{width: ChartWidth+'px', height: ChartHeight+'px'}" @touchstart="KLineTouchStart"
@touchmove='KLineTouchMove' @touchend='KLineTouchEnd'></canvas>
<!-- #endif -->
</template>
<script>
// #ifdef H5
import HQChart from '@/uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.h5.js'
// Log
HQChart.JSConsole.Chart.Log = () => {}
HQChart.JSConsole.Complier.Log = () => {}
// #endif
// #ifndef H5
import {
JSCommon
} from '@/uni_modules/jones-hqchart2/js_sdk/umychart.wechat.3.0.js'
import {
JSCommonHQStyle
} from '@/uni_modules/jones-hqchart2/js_sdk/umychart.style.wechat.js'
import {
JSConsole
} from '@/uni_modules/jones-hqchart2/js_sdk/umychart.console.wechat.js'
//
JSConsole.Complier.Log = () => {};
JSConsole.Chart.Log = () => {};
// #endif
function DefaultData() {}
DefaultData.GetKLineOption = function() {
let data = {
Type: '历史K线图',
Windows: //
[{
Index: "MA",
Modify: false,
Change: false
},
{
Index: "VOL",
Modify: false,
Change: false
}
/*
{
Index:'多线段指标',Modify: false, Change: false,
API:
{
Name:'多线段指标',
Script:null,
Args:null,
Url:'http://127.0.0.1:18080/api/jsindex'
}
}
*/
],
IsCorssOnlyDrawKLine: true,
CorssCursorTouchEnd: true,
IsClickShowCorssCursor: true,
CorssCursorInfo: {
Left: 2,
Right: 2,
Bottom: 1,
IsShowCorss: true
}, //
//IsFullDraw:true,
Border: //
{
Left: 1,
Right: 1, //
Top: 25,
Bottom: 25,
},
KLine: {
DragMode: 1,
Right: 1, // 0 1 2
Period: 0, //: 0 线 1 线 2 线 3 线
PageSize: 30,
IsShowTooltip: false,
DrawType: 0,
DataWidth: 10
},
// KLineTitle: //
// {
// IsShowName: false, //
// IsShowSettingInfo: false ///
// },
ExtendChart: [{
Name: 'KLineTooltip'
}, //tooltip
],
Frame: //
[{
SplitCount: 3,
Custom: [{
Type: 0,
Position: 'right'
}]
},
{
SplitCount: 2
},
{
SplitCount: 3
},
],
};
return data;
}
DefaultData.CreateGuid = function() {
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
return "guid" + (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}
var g_JSChart = new Map();
export default {
name: "HQChartControl",
props: [
'DefaultSymbol'
],
data() {
let data = {
Symbol: '600000.sh',
ChartWidth: 350,
ChartHeight: 500,
KLineID: "HQChart_" + DefaultData.CreateGuid(),
KLine: {
Option: DefaultData.GetKLineOption(),
},
ChartType: "KLine",
};
return data;
},
created() {
if (this.DefaultSymbol) this.Symbol = this.DefaultSymbol; //
this.ChartType = "KLine";
},
methods: {
SetSize(width, height) {
this.ChartWidth = width;
this.ChartHeight = height;
},
GetJSChart() {
if (g_JSChart.has(this.KLineID)) return g_JSChart.get(this.KLineID);
return null;
},
SetJSChart(jsChart) {
g_JSChart.set(this.KLineID, jsChart)
},
ClearChart() {
var jsChart = this.GetJSChart();
if (jsChart) {
jsChart.ChartDestory();
this.SetJSChart(null);
}
// #ifdef H5
var divKLine = document.getElementById(this.KLineID);
while (divKLine.hasChildNodes()) {
divKLine.removeChild(divKLine.lastChild);
}
// #endif
},
OnSize() {
// #ifdef H5
this.OnSize_h5();
// #endif
},
OnSize_h5() {
var chartHeight = this.ChartHeight;
var chartWidth = this.ChartWidth;
var kline = this.$refs.kline;
kline.style.width = chartWidth + 'px';
kline.style.height = chartHeight + 'px';
var jsChart = this.GetJSChart();
if (jsChart) jsChart.OnSize();
},
CreateHQChart() {
this.CreateKLineChart();
},
CreateKLineChart_h5() //K线
{
this.ClearChart();
var blackStyle = HQChart.HQChartStyle.GetStyleConfig(HQChart.STYLE_TYPE_ID.BLACK_ID);
HQChart.JSChart.SetStyle(blackStyle);
//this.$refs.kline.style.backgroundColor=blackStyle.BGColor; //div
var chart = HQChart.JSChart.Init(this.$refs.kline);
this.KLine.Option.Symbol = this.Symbol;
this.KLine.Option.NetworkFilter = this.NetworkFilter;
chart.SetOption(this.KLine.Option);
this.SetJSChart(chart);
},
CreateKLineChart_app() {
this.ClearChart();
var element = new JSCommon.JSCanvasElement();
// #ifdef APP-PLUS
element.IsUniApp = true; //canvas uniappapp
// #endif
element.ID = this.KLineID;
element.Height = this.ChartHeight; //!!
element.Width = this.ChartWidth;
var blackStyle = JSCommonHQStyle.GetStyleConfig(JSCommonHQStyle.STYLE_TYPE_ID.BLACK_ID);
JSCommon.JSChart.SetStyle(blackStyle);
var chart = JSCommon.JSChart.Init(element);
this.KLine.Option.NetworkFilter = this.NetworkFilter;
this.KLine.Option.Symbol = this.Symbol;
this.KLine.Option.IsClickShowCorssCursor = true;
this.KLine.Option.IsFullDraw = true; //
chart.SetOption(this.KLine.Option);
this.SetJSChart(chart);
},
CreateKLineChart() {
this.ChartType = "KLine";
// #ifdef H5
this.CreateKLineChart_h5();
// #endif
// #ifndef H5
this.CreateKLineChart_app();
// #endif
},
IsKLineChart() {
var jsChart = this.GetJSChart();
if (!jsChart) return false;
var className = jsChart.JSChartContainer.ClassName;
if (className == "KLineChartContainer" || className == "KLineChartHScreenContainer") return true;
return false;
},
//K线
ChangeKLinePeriod(period) {
var jsChart = this.GetJSChart();
this.KLine.Option.KLine.Period = period;
if (this.IsKLineChart() && jsChart) {
jsChart.ChangePeriod(period);
} else {
this.CreateKLineChart();
}
},
// windowId= name=
ChangeKLineIndex(windowId, name) {
var jsChart = this.GetJSChart();
if (this.IsKLineChart() && jsChart) jsChart.ChangeIndex(windowId, name);
},
//
ChangeSymbol(symbol) {
this.Symbol = symbol;
var jsChart = this.GetJSChart();
if (jsChart) jsChart.ChangeSymbol(symbol);
},
///////////////////////////////////////////////
// app/
//KLine
KLineTouchStart(event) {
var jsChart = this.GetJSChart();
if (jsChart) jsChart.OnTouchStart(event);
},
KLineTouchMove(event) {
var jsChart = this.GetJSChart();
if (jsChart) jsChart.OnTouchMove(event);
},
KLineTouchEnd(event) {
var jsChart = this.GetJSChart();
if (jsChart) jsChart.OnTouchEnd(event);
},
/////////////////////////////////////////////////////////////////////////////////////////
NetworkFilter(data, callback) {
console.log(`[HQChartTemplate:NetworkFilter] Name=${data.Name} Explain=${data.Explain}`);
},
},
}
</script>
<style>
</style>

14
index.html

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

10
main.js

@ -0,0 +1,10 @@
import App from './App'
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()

72
manifest.json

@ -0,0 +1,72 @@
{
"name" : "k_graph",
"appid" : "",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}

3286
package-lock.json

File diff suppressed because it is too large

16
package.json

@ -0,0 +1,16 @@
{
"name": "k_graph",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"hqchart": "^1.1.10351",
"jquery": "^3.6.0"
}
}

16
pages.json

@ -0,0 +1,16 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}

127
pages/index/index.vue

@ -0,0 +1,127 @@
<template>
<div>
<div style='background-color:#101010;'>
<HQChartControl ref="HQChartCtrl" DefaultChart="{Type:'KLine'}" DefaultSymbol="000001.sz"> </HQChartControl>
</div>
<!-- 控制图1 !-->
<div class="button-sp-area">
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0,0)">D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0,1)">W</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0,4)">1M</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0,5)">15M</button>
</div>
</div>
</template>
<script>
export default {
data() {
let data = {
Symbol: '600000.sh',
ChartWidth: 350,
ChartHeight: 500,
};
return data;
},
onLoad() {
uni.connectSocket({
url: 'wss://api.huobi.pro/ws'
});
uni.onSocketOpen(function(res) {
console.log('WebSocket连接已打开!');
});
uni.onSocketError(function(res) {
console.log('WebSocket连接打开失败,请检查!');
});
uni.onSocketMessage(function(res) {
console.log('收到服务器内容:' + res.data);
});
uni.onSocketClose(function(res) {
console.log('WebSocket 已关闭!');
});
},
beforeDestroy() {
uni.closeSocket();
},
onShow() {
uni.getSystemInfo({
success: (res) => {
var width = res.windowWidth;
var height = res.windowHeight;
this.ChartWidth = width;
this.ChartHeight = height - 130;
this.$nextTick(() => {
this.CreateHQChart();
})
}
});
},
onHide() {
this.ClearHQChart();
},
onUnload() {
this.ClearHQChart();
},
methods: {
checkOpenSocket() {
let self = this;
uni.sendSocketMessage({
data: 'ping',
success: (res) => {
return;
},
fail: (err) => { // websocket
self.openConnection();
}
});
},
CreateHQChart() {
var chartHeight = this.ChartHeight / 2;
let hqchartCtrl = this.$refs.HQChartCtrl;
hqchartCtrl.NetworkFilter = this.NetworkFilter;
hqchartCtrl.SetSize(this.ChartWidth, chartHeight);
hqchartCtrl.OnSize();
hqchartCtrl.CreateHQChart();
},
ClearHQChart() {
let hqchartCtrl = this.$refs.HQChartCtrl;
if (hqchartCtrl) hqchartCtrl.ClearChart();
},
ChangeMinutePeriod(id, days) {
let hqchartCtrl = this.$refs.HQChartCtrl;
hqchartCtrl.ChangeMinutePeriod(days);
},
ChangeKLinePeriod(id, period) {
let hqchartCtrl = this.$refs.HQChartCtrl;
// https://blog.csdn.net/jones2000/article/details/90272733
hqchartCtrl.ChangeKLinePeriod(period);
},
NetworkFilter(data, callback) {
// https://github.com/jones2000/HQChart/blob/master/webhqchart.demo/demo/ws_minute_demo.html
console.log(`[App:NetworkFilter] Name=${data.Name} Explain=${data.Explain}`);
console.log("=====================================");
},
}
}
</script>
<style>
</style>

15
plugins/graph.js

@ -0,0 +1,15 @@
// #ifdef H5
import HQChart from '@/uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.h5.js'
//HQChart.JSChart.SetDomain("xxxxx.com");
//HQChart.JSComplier.SetDomain("xxxx.com");
// #endif
// #ifndef H5
import {JSCommon} from '@/uni_modules/jones-hqchart2/js_sdk/umychart.wechat.3.0.js'
import {JSCommonHQStyle} from '@/uni_modules/jones-hqchart2/js_sdk/umychart.style.wechat.js'
import {JSCommonComplier} from "@/uni_modules/jones-hqchart2/js_sdk/umychart.complier.wechat.js"
//禁用日志
JSConsole.Complier.Log=()=>{ };
JSConsole.Chart.Log=()=>{ };
// #endif

BIN
static/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

76
uni.scss

@ -0,0 +1,76 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;

274
uni_modules/jones-hqchart2/changelog.md

@ -0,0 +1,274 @@
## 1.1.10333(2021-09-13)
10332 叠加指标支持VERTLINE,HORLINE<br>
10330 增加叠加指标移动到新窗口,MoveOverlayIndexToNewWindow<br>
10328 K线图支持 IsFixXLastTime<br>
10326 APIScriptIndex派生CopyTo虚函数<br>
10325 增加叠加指标移动<br>
10324 小程序MULTI_LINE 支持设置线段宽度<br>
10322 ChartMultiLine 支持设置线段宽度<br>
## 1.1.10321(2021-09-09)
10320 AddIndexWindow()修正OverlayIndexType参数位置写错了<br>
10318 单行显示指标标题支持横屏<br>
10316 1. 修正IChartFramePainting::ClearCoordinateText()没有判断Message字段是否有效<br>
2. 修正HQTradeFrame::Draw()在动画场景时不自动调整左右边框间距<br>
10315 叠加指标标题支持单行显示<br>
## 1.1.10309(2021-09-01)
10309 小程序修正分时图ChartStickLine柱子太粗了。
## 1.1.10306(2021-08-31)
10305 修正uniapp分时图指标工具栏$报错<br>
10302 修正OnTouchDBClick()手势坐标没有转换到K线图相对坐标<br>
## 1.1.10301 (2021-08-27)
增加用户协议<br>
10285 修正DrawInsideHorizontal,DrawCustomHorizontal没有处理最小化窗口指标<br>
10284 小程序增加双击副图缩放指标窗口<br>
## 1.1.10283(2021-08-22)
10282 小程序JSChartContainer::FullDraw()数据加载去掉坐标文字<br>
10281 显示数据加载时, 不显示刻度文字<br>
10276 增加手势双击缩放附图指标窗口<br>
10274 画图工具支持附图窗口最小化<br>
10273 部分图形画法支持指标窗口隐藏模式<br>
10271 修正右边自动调整叠加指标宽度是没有动态计算叠加刻度<br>
10270 增加是否启动双击缩放附图窗口配置<br>
10269 增加子窗口双击缩放<br>
## 1.1.10265(2021-08-17)
10264 修正KLineChartContainer::Update()没有更新Y轴坐标分割线数据<br>
10263 DrawCustomItem() 支持多行自定义刻度文字<br>
## 1.1.10251(2021-08-12)
10250 小程序指标翻译器函数翻译代码整理<br>
10249 指标解释器函数解释代码整理<br>
10247 小程序指标翻译器增加部分字符串函数翻译<br>
10245 指标翻译器增加部分字符串函数翻译<br>
10241 ON_TITLE_DRAW事件增加叠加股票信息<br>
## 1.1.10238(2021-08-09)
10237 h5修正左右边框间距自动调整没有考虑筹码图宽度<br>
10235 h5K线图边框间距自适应支持横屏<br>
10234 小程序自动调整左右边框距离支持横屏<br>
10233 小程序K线图支持左右边框间距根据刻度文字自动调整<br>
10230 修正拖拽指标边框触发区间选择<br>
10227 h5K线图增加左右两侧边框间距根据刻度自动调整<br>
## 1.1.110226(2021-08-09)
10225 小程序修正指标翻译是LLVBARS,HHVBARS报错<br>
10223 K线增加复权因子读取.<br>
10222 指标翻译器修正HHVBARS, LLVBARS报错<br>
10221 增加复权使用复权因子算法<br>
## 1.1.110220(2021-08-05)
10219 修正 ChartMinutePriceLine::GetTooltipData()报错<br>
10217 h5信息地雷数据支持修改域名<br>
## 1.1.110216(2021-08-04)
10216 小程序修正百分比坐标Y轴超出刻度范围<br>
10214 修正K线百分比坐标超出当前Y轴范围<br>
10212 修正分笔图十字光标区域背景最右边溢出<br>
10210 分笔图增加区间背景<br>
10209 JsonDataToTickData() 每个分笔数据的前收盘使用当日的前收盘<br>
10208 分笔图支持tooltip提示信息<br>
## 1.1.110189(2021-07-27)
10189 修正小程序MinuteFrame里的成员变量DataWidth, DistanceWidth 没有设置为1<br>
10188 OnDoubleClick() 代码整理<br>
10187 小程序CallFunctionExplain() 增加函数不存在报错<br>
10185 CallFunctionExplain()增加函数不存在报错<br>
10183 十字光标竖线支持连续<br>
10182 K线tooltip和K线信息地雷禁止选中<br>
10181 判断tooltip代码整理, 独立成2个函数 PtInChartPaintTooltip,PtInOverlayChartPaintTooltip<br>
10179 ChartOverlayMinutePriceLine, ChartMinutePriceLine 增加函数GetTooltipData()<br>
10178 OnMinuteSelectRectMouseUp()增加CLICK事件通知<br>
## 1.1.110177(2021-07-23)
10174 K线左右拖拽数据增加自动模式 (StepPixel=0)
## 1.1.110173(2021-07-22)
10172 自定义K线支持横屏<br>
10171 小程序K线图最大最小显示配置支持横屏<br>
10170 K线最大最小值显示设置支持横屏<br>
10169 K线图支持自定义K线颜色<br>
10167 ChartKLine::DrawKBar()代码整理<br>
## 1.1.110166(2021-07-19)
10165 GetVariantData()增加错误提示<br>
10161 修正GetVariantData()外部数据对接格式错误<br>
10159 小程序增加INBLOCK<br>
10157 增加INBLOCK<br>
10156 小程序支持板块函数<br>
10154 增加板块函数<br>
## 1.1.110127(2021-07-14)
10125 K线图增加叠加指标参数修改更新接口<br>
10124 去掉scss相关内容和webpack配置<br>
10122 修正分时图区间选择最后的结束时间点超出当前交易时间报错 <br>
## 1.1.110119 (2021-07-12)
10117 JSExplainer语法检测器迁移到小程序<br>
10115 小程序AddIndexWindow()增加SplitCount,IsShowLeftText,IsShowRightText属性设置<br>
10114 AddIndexWindow() 增加SplitCount属性<br>
10110 增加区间统计框关闭以后, 操作选中区域完毕以后,弹出对应的菜单或框<br>
## 1.1.10095(2021-07-07)
10094 ChangeIndexWindowCount() 增加IsShowLeftText, IsShowRightText设置<br>
10092 AddIndexWindow() 增加IsShowLeftText,IsShowRightText设置<br>
10090 修正多日分时图切换最大最小值没有清空 <br>
## 1.1.10087(2021-07-01)
10087 小程序修正分时图RecvMinuteData()报错
## 1.1.10086(2021-07-01)
10086 小程序国内期货增加新品种<br>
10085 小程序DynamicTitleData增加是否显示标识<br>
10084 小程序修正IFrameSplitOperator.IsString()空字符串判断错误<br>
10083 IFrameSplitOperator.IsString()修正""空字符串判断错误<br>
10081 MULTI_BAR叠加指标增加往标题实例中设置数据<br>
10080 自定义多柱子增加数据设置到标题<br>
## 1.1.10076(2021-06-29)
10074 小程序分时图Y轴增加涨跌停坐标轴<br>
10073 小程序 分时图Y周支持根据最高最低加分割<br>
10072 1. 小程序 IChangeStringFormat 迁移到umychart.framesplit.wechart.js中<br>
2. 小程序 增加IChangeStringFormat工厂类<br>
10068 K线tooltip和标题信息成交量A股统一改成手单位<br>
## 1.1.10065(2021-06-28)
10064 修正分时图没有判断是否支持区间选择导致报错
## 1.1.10063(2021-06-28)
10061 小程序十字光标X轴日期文字支持3种格式 0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY<br>
10060 十字光标X轴日期显示 支持YY/MM/YYYY<br>
10057 修正百分比坐标价格和百分比两个颜色配置颠倒了.<br>
10055 修正分笔K线区间统计框起始时间格式显示不对.<br>
## 1.1.10040(2021-06-25)
10039 K线图支持上下拖拽<br>
10037 分笔K线增加支持叠加指标<br>
10035 分笔K线数据更新增加2.0格式<br>
10034 1. 分笔K线全量数据增加新的数据格式<br>
2. 分笔标题信息和tooltip显示样式修改<br>
3. 分笔增加百分比坐标<br>
## 1.1.9984(2021-06-17)
9983 修正SplitLogarithmicXYCoordinate()预留高度为负数是,显示错误<br>
9978 修正KLineChartContainer::ChangeIndexWindowCount() 显示错位<br>
增加AddIndexWindow() 添加指标窗口<br>
9977 K线图增加事件ON_SPLIT_XCOORDINATE<br>
9958 KLineChartContainer.JsonDataToHistoryData(), KLineChartContainer.JsonDataToMinuteRealtimeData(), KLineChartContainer.JsonDataToMinuteHistoryData() 去掉价格<0的无效价格判断.<br>
9954 ChartVericaltLine, ChartHorizontalLine 支持横屏<br>
9953 绘图函数HORLINE()支持单数值条件<br>
9951 增加绘图函数HORLINE<br>
9950 增加绘图函数VERTLINE<br>
9949 部分替换 for(var i in array ) 改成 for(var i=0;i<array.length;++i)<br>
## 1.1.9948(2021-06-12)
9948 小程序分时图和K线图十字光标移动优化<br>
9947 小程序增加分时图十字光标移动延迟绘图间隔设置<br>
## 1.1.9946(2021-06-12)
9946 小程序优化分时图十字光标移动效率<br>
9945 小程序修正ChangePeriod()未完成数据下载切换周期报错<br>
9942 小程序ChartMinutePriceLine迁移到umychart.chartpaint.wechart.js中<br>
## 1.1.9938(2021-06-10)
9937 小程序K线训练增加是否显示最高最低价格显示控制<br>
9936, 9935 把部分数组循环遍历 (var i in array) 改成=> (var i=0;i<array.length;++i)<br>
## 1.1.9933(2021-06-09)
9931 小程序更新定时器增加判断是否图形已销毁<br>
9925 期货增加 郑州商品交易所-红枣(CJ)<br>
9921 JsonDataToMinuteDataArray 修正跨天数据 日期时间显示错误<br>
9919 修正分时图标题高度没有设置为0<br>
9917 大盘指数(INDEXA, INDEXC....)支持对3放数据对接<br>
## 1.1.9907(2021-06-06)
9907 修正IFrameSplitOperator::IntegerCoordinateSplit() 负数最小值计算错误<br>
9902 增加指标标题绘制回调函数 ON_INDEXTITLE_DRAW<br>
## 1.1.9901(2021-06-06)
9900 小程序修正IFrameSplitOperator::IntegerCoordinateSplit()最低价计算错误 <br>
9899 IFrameSplitOperator::IntegerCoordinateSplit() 修正最低价计算错误 <br>
## 1.1.9893(2021-06-04)
9892 小程序IFrameSplitOperator::IntegerCoordinateSplit()算法优化<br>
9890 IFrameSplitOperator::IntegerCoordinateSplit() 修正计算错误<br>
9886 增加多日集合竞价最新数据更新<br>
9885 修正FrameSplitY::GetCallAcutionSplitY() 多日分时Y轴多算了一个刻度<br>
多日分时图集合竞价Y轴统一最大,最小值<br>
## 1.1.9864(2021-05-30)
9863 分时图集合竞价十字光标显示最近的有效数据<br>
9862 多日集合竞价十字光标支持Y轴数据显示<br>
9861 多日分时图Y轴显示集合竞价刻度<br>
## 1.1.9792(2021-05-21)
9792 小程序 <br>
1. 修正DRAWRECTREL()位置正确性没有判断<br>
2. Y轴内部刻度增加属性YTextBaseline,支持上下位置可以配置<br>
9790 FrameSplitMinutePriceY::GetMaxMin() 修正计算错误. Y轴内部刻度文字支持上下位子配置<br>
9788 导出 CoordinateInfo <br>
## 1.1.9759(2021-05-19)
9758 DynamicMinuteTitlePainting调整集合竞价1.0数据格式显示样式<br>
9756 小程序 ChartVolStick柱子高度<1,统一显示为1 <br>
9754 ChartVolStick() 高度小于1, 统一调整为1 <br>
9748 ShowSelectRect() 分时图显示位置调整<br>
9747 分时图增加区间选择接口<br>
9746 RequestDragMinuteData, RequestDragDayData 数据回调增加周期和复权参数<br>
9743 集合竞价支持绘制点 <br>
## 1.1.9725(2021-05-15)
9724 修正ChartMultiHtmlDom() 在页面放大倍数以后, DOM坐标计算错误 <br>
9719 小程序 JSComplier.Execute() 去掉ios回报错的日志 <br>
## 1.1.9694(2021-05-10)
9694 小程序 1. JSCHART_EVENT_ID定义迁移到umychart.data.wechart.js里面 <br>
2. 支持 JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE 事件 <br>
9687 小程序ChartBorder增加 GetBorder(),GetHScreenBorder() <br>
## 1.1.9683(2021-05-09)
修改readme
## 1.1.9682(2021-05-09)
修改readme
## 1.1.9681(2021-05-09)
9671 增加分时图集合竞价关闭按钮<br>
9670 分时图集合竞价支持横屏<br>
9668 增加收盘集合竞价<br>
## 1.1.9654(2021-05-04)
9653 1.分时图双击事件 <br>
2.集合竞价宽度设置 <br>
9651 修正ChartMinutePriceLine::DrawBeforeOpen()报错 <br>
9649 MULTI_LINE多线段支持"C","H"等特殊标识价格 <br>
9648 1.修正分时图叠加指标共享Y轴横屏没有读取主图Y轴信息 <br>
2.ChartMultiSVGIcon 使用GetBorder获取坐标信息 <br>
9647 分时图集合竞价框架重新调整 <br>
## 1.1.9617(2021-04-28)
9616 修正IsSHSZStockA() 没有包含300创业板<br>
9610 UpdateFrameMaxMin() 主图计算Y轴最大最小值增加叠加指标数据 <br>
9604 分时图和K线主图支持ON_SPLIT_YCOORDINATE事件 <br>
9599 Y轴分割函数,增加是否支持Y轴缩放查询接口 <br>
9597 增加 Y轴分割刻度回调事件 <br>
## 1.1.9536(2021-04-23)
增加插件教程说明
## 1.1.9535(2021-04-22)
增加HQChart模板样例
## 1.1.9534(2021-04-22)
9532 公告信息地雷支持去重更新 <br>
9529 信息地理拖拽下载数据以后,支持更新调用 <br>
9520 增加AB波浪尺 <br>
## 1.1.9518(2021-04-21)
9517 修正多日分时图更新当天数据时,叠加指标没有重新计算 <br>
9516 小程序增加ON_PHONE_TOUCH事件回调 <br>
9509 修正OverlayScriptIndex::CreateTextLine()画法保存错误 <br>
9501 1. 信息地雷顶部画不下了, 移动下面画<br>
2. 修正单击K线和双击K线同时触发回调的问题<br>
## 1.1.9500(2021-04-19)
9481 增加画图工具图标<br>
9479 小程序修正BARSSINCEN算法错误<br>
9478 修正BARSSINCEN算法<br>
9477 修正 JSCHART_OPERATOR_ID.OP_LEFT_ZOOM_OUT 数据索引计算错误<br>
9497 走势图支持后台指标API数据<br>
9496 修正"BindOverlayPositionData", "ClearBindOverlayPositionData" 指标变量写错了.<br>
9495 分时图支持叠加指标<br>
9499 h5增加手势事件回调ON_PHONE_TOUCH. <br>
## 1.1.9473(2021-04-12)
9472 修正K线数据更新以后叠加指标没有执行更新<br>
9471 小程序"CIRCLEDOT","POINTDOT"点半径支持设置<br>
9469 CIRCLEDOT, POINTDOT支持半径大小设置<br>
9466 小程序ChartOperator右移K线支持下载功能<br>
9465 小程序COLORSTICK支持标题字体颜色设置<br>
9469 COLORSTICK 支持后面增加颜色控制标题的字体颜色<br>
9462 增加点击回调事件<br>
9458 ChartOperator() 数据右移增加,历史数据下载功能<br>
## 1.1.9444(2021-04-08)
9443 增加K线叠加指标是否显示指标名字配置
9441 ChangeIndexTemplate() 支持指标标题字体设置
9338 ChartSingleText 获取X轴坐标分时图和K线图分开
## 1.1.9417(2021-04-01)
9416 增加水平线段
## 1.1.9416(2021-03-31)
增加测试用例项目
## 1.1.9415(2021-03-31)
把原来hqchart改成uniapp插件模式. 版本号 1.9415

511
uni_modules/jones-hqchart2/js_sdk/HQChartControl.vue

@ -0,0 +1,511 @@
<template>
<!-- #ifdef H5 -->
<div class='kline' v-bind:id='KLineID' v-bind:style="{width: ChartWidth+'px', height: ChartHeight+'px'}" ref='kline'></div>
<!-- #endif -->
<!-- #ifndef H5 -->
<canvas v-bind:id='KLineID' v-bind:canvas-id='KLineID' class='kline2' v-bind:style="{width: ChartWidth+'px', height: ChartHeight+'px'}"
@touchstart="KLineTouchStart" @touchmove='KLineTouchMove' @touchend='KLineTouchEnd' ></canvas>
<!-- #endif -->
</template>
<script>
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
HQChart简单的模板类
*/
// #ifdef H5
import HQChart from './umychart.uniapp.h5.js'
// #endif
// #ifndef H5
import {JSCommon} from './umychart.wechat.3.0.js'
import {JSCommonHQStyle} from './umychart.style.wechat.js'
import {JSConsole} from './umychart.console.wechat.js'
//
//JSConsole.Complier.Log=()=>{ };
//JSConsole.Chart.Log=()=>{ };
// #endif
function DefaultData() { }
DefaultData.GetKLineOption = function ()
{
let data =
{
Type: '历史K线图',
Windows: //
[
{Index:"MA",Modify: false, Change: false},
{Index:"VOL",Modify: false, Change: false}
/*
{
Index:'多线段指标',Modify: false, Change: false,
API:
{
Name:'多线段指标',
Script:null,
Args:null,
Url:'http://127.0.0.1:18080/api/jsindex'
}
}
*/
],
IsAutoUpdate:true,
IsCorssOnlyDrawKLine:true,
CorssCursorTouchEnd:true,
IsClickShowCorssCursor:true,
CorssCursorInfo:{ Left:2, Right:2, Bottom:1, IsShowCorss:true}, //
//IsFullDraw:true,
Border: //
{
Left: 1,
Right: 1, //
Top: 25,
Bottom: 25,
},
KLine:
{
DragMode:1,
Right:1, // 0 1 2
Period:0, //: 0 线 1 线 2 线 3 线
PageSize:30,
IsShowTooltip:false,
DrawType:0,
DataWidth:10
},
ExtendChart:
[
{Name:'KLineTooltip' }, //tooltip
],
Frame: //
[
{SplitCount:3,Custom: [{ Type: 0, Position: 'right'}]},
{SplitCount:2},
{SplitCount:3},
],
};
return data;
}
DefaultData.GetMinuteOption=function()
{
var option=
{
Type:'分钟走势图', //
Windows: //
[
],
IsAutoUpdate:true, //
DayCount:1, //1 >1
IsShowRightMenu:false, //
CorssCursorTouchEnd:true,
IsClickShowCorssCursor:true,
//IsFullDraw:true,
MinuteLine:
{
//IsDrawAreaPrice:false, //
},
Border: //
{
Left:1, //
Right:1, //
Top:20,
Bottom:20
},
Frame: //
[
{SplitCount:3},
{SplitCount:2},
{SplitCount:3},
],
ExtendChart: //
[
{Name:'MinuteTooltip' } //tooltip
],
};
return option;
}
DefaultData.CreateGuid=function()
{
function S4()
{
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
return "guid" + (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
var g_JSChart=new Map();
export default
{
name:"HQChartControl",
props:
[
'DefaultSymbol',
'DefaultChart'
],
data()
{
let data=
{
Symbol:'600000.sh',
ChartWidth:350,
ChartHeight:500,
KLineID:"HQChart_"+DefaultData.CreateGuid(),
KLine:
{
Option:DefaultData.GetKLineOption(),
},
Minute:
{
Option:DefaultData.GetMinuteOption(),
},
ChartType:"Minute",
};
return data;
},
created()
{
if (this.DefaultSymbol) this.Symbol=this.DefaultSymbol; //
if (this.DefaultChart)
{
//TODO:
if (this.DefaultChart.Type=='Minute')
{
this.ChartType="Minute";
}
else
{
this.ChartType="KLine";
}
}
},
methods:
{
SetSize(width, height)
{
this.ChartWidth=width;
this.ChartHeight=height;
},
GetJSChart()
{
if (g_JSChart.has(this.KLineID)) return g_JSChart.get(this.KLineID);
return null;
},
SetJSChart(jsChart)
{
g_JSChart.set(this.KLineID,jsChart)
},
ClearChart()
{
console.log("[ClearChart] clear");
var jsChart=this.GetJSChart();
if (jsChart)
{
jsChart.ChartDestory();
this.SetJSChart(null);
}
// #ifdef H5
var divKLine=document.getElementById(this.KLineID);
while (divKLine.hasChildNodes())
{
divKLine.removeChild(divKLine.lastChild);
} 
// #endif
},
OnSize()
{
// #ifdef H5
this.OnSize_h5();
// #endif
},
OnSize_h5()
{
var chartHeight = this.ChartHeight;
var chartWidth = this.ChartWidth;
var kline=this.$refs.kline;
kline.style.width=chartWidth+'px';
kline.style.height=chartHeight+'px';
var jsChart=this.GetJSChart();
if (jsChart) jsChart.OnSize();
},
CreateHQChart()
{
if (this.ChartType=="Minute") this.CreateMinuteChart();
else this.CreateKLineChart();
},
CreateKLineChart_h5() //K线
{
this.ClearChart();
var blackStyle=HQChart.HQChartStyle.GetStyleConfig(HQChart.STYLE_TYPE_ID.BLACK_ID);
HQChart.JSChart.SetStyle(blackStyle);
//this.$refs.kline.style.backgroundColor=blackStyle.BGColor; //div
var chart=HQChart.JSChart.Init(this.$refs.kline);
this.KLine.Option.Symbol=this.Symbol;
this.KLine.Option.NetworkFilter=this.NetworkFilter;
chart.SetOption(this.KLine.Option);
this.SetJSChart(chart);
return chart;
},
CreateKLineChart_app()
{
this.ClearChart();
var element = new JSCommon.JSCanvasElement();
// #ifdef APP-PLUS
element.IsUniApp=true; //canvas uniappapp
// #endif
element.ID = this.KLineID;
element.Height = this.ChartHeight; //!!
element.Width = this.ChartWidth;
var blackStyle=JSCommonHQStyle.GetStyleConfig(JSCommonHQStyle.STYLE_TYPE_ID.BLACK_ID);
JSCommon.JSChart.SetStyle(blackStyle);
var chart = JSCommon.JSChart.Init(element);
this.KLine.Option.NetworkFilter=this.NetworkFilter;
this.KLine.Option.Symbol=this.Symbol;
this.KLine.Option.IsClickShowCorssCursor=true;
this.KLine.Option.IsFullDraw=true; //
chart.SetOption(this.KLine.Option);
this.SetJSChart(chart);
return chart;
},
CreateKLineChart()
{
this.ChartType="KLine";
// #ifdef H5
return this.CreateKLineChart_h5();
// #endif
// #ifndef H5
return this.CreateKLineChart_app();
// #endif
},
CreateMinuteChart_h5() //线
{
this.ClearChart();
var blackStyle=HQChart.HQChartStyle.GetStyleConfig(HQChart.STYLE_TYPE_ID.BLACK_ID);
HQChart.JSChart.SetStyle(blackStyle);
//this.$refs.kline.style.backgroundColor=blackStyle.BGColor; //div
var chart=HQChart.JSChart.Init(this.$refs.kline);
this.Minute.Option.Symbol=this.Symbol;
this.Minute.Option.NetworkFilter=this.NetworkFilter;
chart.SetOption(this.Minute.Option);
this.SetJSChart(chart);
return chart;
},
CreateMinuteChart_app()
{
this.ClearChart();
var element = new JSCommon.JSCanvasElement();
// #ifdef APP-PLUS
element.IsUniApp=true; //canvas uniappapp
// #endif
element.ID = this.KLineID;
element.Height = this.ChartHeight; //!!
element.Width = this.ChartWidth;
//
//var blackStyle=JSCommonHQStyle.GetStyleConfig(JSCommonHQStyle.STYLE_TYPE_ID.BLACK_ID);
//JSCommon.JSChart.SetStyle(blackStyle);
//var testttt=JSCommon.MARKET_SUFFIX_NAME.GetSHODecimal();
//JSCommon.MARKET_SUFFIX_NAME.GetSHODecimal=(symbol)=>{ return 4; }; //
var chart = JSCommon.JSChart.Init(element);
this.Minute.Option.NetworkFilter=this.NetworkFilter;
this.Minute.Option.Symbol=this.Symbol;
this.Minute.Option.IsFullDraw=true; //
chart.SetOption(this.Minute.Option);
this.SetJSChart(chart);
return chart;
},
CreateMinuteChart()
{
this.ChartType="Minute";
// #ifdef H5
return this.CreateMinuteChart_h5();
// #endif
// #ifndef H5
return this.CreateMinuteChart_app();
// #endif
},
IsKLineChart()
{
var jsChart=this.GetJSChart();
if (!jsChart) return false;
var className=jsChart.JSChartContainer.ClassName;
if (className=="KLineChartContainer" || className=="KLineChartHScreenContainer") return true;
return false;
},
IsMinuteChart()
{
var jsChart=this.GetJSChart();
var className=jsChart.JSChartContainer.ClassName;
if (className=="MinuteChartContainer" || className=="MinuteChartHScreenContainer") return true;
return false;
},
//K线
ChangeKLinePeriod(period)
{
var jsChart=this.GetJSChart();
this.KLine.Option.KLine.Period=period;
if (this.IsKLineChart() && jsChart)
{
jsChart.ChangePeriod(period);
}
else
{
this.CreateKLineChart();
}
},
//
ChangeMinutePeriod(dayCount)
{
var jsChart=this.GetJSChart();
this.Minute.Option.DayCount=dayCount;
if (this.IsMinuteChart() && jsChart)
{
jsChart.ChangeDayCount(dayCount);
}
else
{
this.CreateMinuteChart(); //
}
},
// windowId= name=
ChangeKLineIndex(windowId,name)
{
var jsChart=this.GetJSChart();
if (this.IsKLineChart() && jsChart) jsChart.ChangeIndex(windowId,name);
},
//
ChangeSymbol(symbol)
{
this.Symbol=symbol;
var jsChart=this.GetJSChart();
if (jsChart) jsChart.ChangeSymbol(symbol);
},
///////////////////////////////////////////////
// app/
//KLine
KLineTouchStart(event)
{
var jsChart=this.GetJSChart();
if (jsChart) jsChart.OnTouchStart(event);
},
KLineTouchMove (event)
{
var jsChart=this.GetJSChart();
if (jsChart) jsChart.OnTouchMove(event);
},
KLineTouchEnd (event)
{
var jsChart=this.GetJSChart();
if (jsChart) jsChart.OnTouchEnd(event);
},
/////////////////////////////////////////////////////////////////////////////////////////
NetworkFilter(data, callback)
{
console.log(`[HQChartTemplate:NetworkFilter] Name=${data.Name} Explain=${data.Explain}` );
},
},
}
</script>
<style>
</style>

6134
uni_modules/jones-hqchart2/js_sdk/umychart.chartpaint.wechat.js

File diff suppressed because it is too large

1468
uni_modules/jones-hqchart2/js_sdk/umychart.charttitle.wechat.js

File diff suppressed because it is too large

10644
uni_modules/jones-hqchart2/js_sdk/umychart.complier.wechat.js

File diff suppressed because one or more lines are too long

15
uni_modules/jones-hqchart2/js_sdk/umychart.console.wechat.js

@ -0,0 +1,15 @@
//日志输出类
var JSConsole=
{
Chart:{ Log:console.log, Warn:console.warn }, //图形日志
Complier:{ Log:console.log, Warn:console.warn }, //编译器日志
};
module.exports =
{
JSConsole:
{
Chart: JSConsole.Chart,
Complier:JSConsole.Complier
}
};

2443
uni_modules/jones-hqchart2/js_sdk/umychart.coordinatedata.wechat.js

File diff suppressed because it is too large

1796
uni_modules/jones-hqchart2/js_sdk/umychart.data.wechat.js

File diff suppressed because it is too large

1030
uni_modules/jones-hqchart2/js_sdk/umychart.explainer.wechat.js

File diff suppressed because it is too large

1003
uni_modules/jones-hqchart2/js_sdk/umychart.extendchart.wechat.js

File diff suppressed because it is too large

2024
uni_modules/jones-hqchart2/js_sdk/umychart.framesplit.wechat.js

File diff suppressed because it is too large

934
uni_modules/jones-hqchart2/js_sdk/umychart.hqIndexformula.wechat.js

@ -0,0 +1,934 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
指标计算方法 2.0 版本使用的算法
*/
function HQIndexFormula()
{
}
//指数平均数指标 EMA(close,10)
HQIndexFormula.EMA=function(data,dayCount)
{
var result = [];
var offset=0;
if (offset>=data.length) return result;
//取首个有效数据
for(;offset<data.length;++offset)
{
if (data[offset]!=null && !isNaN(data[offset]))
break;
}
var p1Index=offset;
var p2Index=offset+1;
result[p1Index]=data[p1Index];
for(var i=offset+1;i<data.length;++i,++p1Index,++p2Index)
{
result[p2Index]=((2*data[p2Index]+(dayCount-1)*result[p1Index]))/(dayCount+1);
}
return result;
}
HQIndexFormula.SMA=function(data,n,m)
{
var result = [];
var i=0;
var lastData=null;
for(;i<data.length; ++i)
{
if (data[i]==null || isNaN(data[i])) continue;
lastData=data[i];
result[i]=lastData; //第一天的数据
break;
}
for(++i;i<data.length;++i)
{
result[i]=(m*data[i]+(n-m)*lastData)/n;
lastData=result[i];
}
return result;
}
/*
求动态移动平均.
用法: DMA(X,A),求X的动态移动平均.
算法: 若Y=DMA(X,A) Y=A*X+(1-A)*Y',其中Y'表示上一周期Y值,A必须小于1.
例如:DMA(CLOSE,VOL/CAPITAL)表示求以换手率作平滑因子的平均价
*/
HQIndexFormula.DMA=function(data,data2)
{
var result = [];
if (data.length<0 || data.length!=data2.length) return result;
var index=0;
for(;index<data.length;++index)
{
if (data[index]!=null && !isNaN(data[index]) && data2[index]!=null && !isNaN(data2[index]))
{
result[index]=data[index];
break;
}
}
for(index=index+1;index<data.length;++index)
{
if (data[index]==null || data2[index]==null)
result[index]=null;
else
{
if (data[index]<1)
result[index]=(data2[index]*data[index])+(1-data2[index])*result[index-1];
else
result[index]= data[index];
}
}
return result;
}
HQIndexFormula.HHV=function(data,n)
{
var result = [];
if (n>data.length) return result;
var max=-10000;
for(var i=n,j=0;i<data.length;++i,++j)
{
if(i<n+max)
{
max=data[i]<data[max]?max:i;
}
else
{
for(j=(max=i-n+1)+1;j<=i;++j)
{
if(data[j]>data[max])
max = j;
}
}
result[i] = data[max];
}
return result;
}
HQIndexFormula.LLV=function(data,n)
{
var result = [];
if (n>data.length) return result;
var min=-10000;
for(var i=n;i<data.length;++i,++j)
{
if(i<n+min)
{
min=data[i]>data[min]?min:i;
}
else
{
for(var j=(min=i-n+1)+1;j<=i;++j)
{
if(data[j]<data[min])
min = j;
}
}
result[i] = data[min];
}
return result;
}
HQIndexFormula.REF=function(data,n)
{
var result=[];
if (data.length<=0) return result;
if (n>=data.length) return result;
result=data.slice(0,data.length-n);
for(var i=0;i<n;++i)
result.unshift(null);
return result;
}
HQIndexFormula.REFDATE=function(data,n)
{
var result=[];
if (data.length<=0) return result;
//暂时写死取最后一个
n=data.length-1;
for(var i in data)
{
result[i]=data[n];
}
return result;
}
HQIndexFormula.SUM=function(data,n)
{
var result=[];
if (n==0)
{
result[0]=data[0];
for (var i=1; i<data.length; ++i)
{
result[i] = result[i-1]+data[i];
}
}
else
{
for(var i=n-1,j=0;i<data.length;++i,++j)
{
for(var k=0;k<n;++k)
{
if (k==0) result[i]=data[k+j];
else result[i]+=data[k+j];
}
}
}
return result;
}
//两个数组相减
HQIndexFormula.ARRAY_SUBTRACT=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
if (data[i]==null || isNaN(data[i]))
result[i]=null;
else
result[i]=data[i]-data2;
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
{
if (data[i]==null || data2[i]==null) result[i]=null;
else result[i]=data[i]-data2[i];
}
else
result[i]=null;
}
}
return result;
}
//数组 data>data2比较 返回 0/1 数组
HQIndexFormula.ARRAY_GT=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i]>data2 ? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=data[i]>data2[i] ? 1:0;
else
result[i]=null;
}
}
return result;
}
//数组 data>=data2比较 返回 0/1 数组
HQIndexFormula.ARRAY_GTE=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i]>=data2 ? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=data[i]>=data2[i] ? 1:0;
else
result[i]=null;
}
}
return result;
}
//数组 data<data2比较 返回 0/1 数组
HQIndexFormula.ARRAY_LT=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i]<data2 ? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=data[i]<data2[i] ? 1:0;
else
result[i]=null;
}
}
return result;
}
//数组 data<=data2比较 返回 0/1 数组
HQIndexFormula.ARRAY_LTE=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i]<=data2 ? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=data[i]<=data2[i] ? 1:0;
else
result[i]=null;
}
}
return result;
}
//数组 data==data2比较 返回 0/1 数组
HQIndexFormula.ARRAY_EQ=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i]==data2 ? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=(data[i]==data2[i] ? 1:0);
else
result[i]=null;
}
}
return result;
}
HQIndexFormula.ARRAY_IF=function(data,trueData,falseData)
{
var result=[];
var IsNumber=[typeof(trueData)=="number",typeof(falseData)=="number"];
for(var i in data)
{
if (data[i])
{
if (IsNumber[0]) result[i]=trueData;
else result[i]=trueData[i];
}
else
{
if (IsNumber[1]) result[i]=falseData;
else result[i]=falseData[i];
}
}
return result;
}
HQIndexFormula.ARRAY_AND=function(data,data2)
{
var result=[];
var IsNumber=typeof(trueData)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i] && data2? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=(data[i] && data2[i] ? 1:0);
else
result[i]=0;
}
}
return result;
}
HQIndexFormula.ARRAY_OR=function(data, data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=(data[i] || data2? 1:0);
}
}
else
{
var count=Math.max(data.length,data2.length)
for(var i=0;i<count;++i)
{
if (i < data.length && data[i])
{
result[i] = 1;
continue;
}
if (i < data2.length && data2[i])
{
result[i] = 1;
continue;
}
result[i] = 0;
}
}
return result;
}
//数组相乘
//支持多个参数累乘 如:HQIndexFormula.ARRAY_MULTIPLY(data,data2,data3,data3) =data*data2*data3*data4
HQIndexFormula.ARRAY_MULTIPLY=function(data,data2)
{
if (arguments.length==2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
if (data[i]==null || isNaN(data[i]))
result[i]=null;
else
result[i]=data[i]*data2;
}
}
else
{
var count=Math.max(data.length,data2.length);
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
result[i]=data[i]*data2[i];
else
result[i]=null;
}
}
return result;
}
var result=HQIndexFormula.ARRAY_MULTIPLY(arguments[0],arguments[1]);
for(var i=2;i<arguments.length;++i)
{
result=HQIndexFormula.ARRAY_MULTIPLY(result,arguments[i]);
}
return result;
}
//数组相除
HQIndexFormula.ARRAY_DIVIDE=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=data[i]/data2;
}
}
else
{
var count=Math.max(data.length,data2.length);
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
{
if(data[i]==null || data2[i]==null || isNaN(data[i]) || isNaN(data2[i]))
result[i]=null;
else if (data2[i]==0)
result[i]=null;
else
result[i]=data[i]/data2[i];
}
else
result[i]=null;
}
}
return result;
}
//数组相加
//支持多个参数累加 如:HQIndexFormula.ARRAY_ADD(data,data2,data3,data3) =data+data2+data3+data4
HQIndexFormula.ARRAY_ADD=function(data,data2)
{
if (arguments.length==2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
result[i]=data[i]+data2;
}
}
else
{
var count=Math.max(data.length,data2.length);
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
{
if (data[i]==null || data2[i]==null || isNaN(data[i]) || isNaN(data2[i])) result[i]=null
else result[i]=data[i]+data2[i];
}
else
{
result[i]=null;
}
}
}
return result;
}
var result=HQIndexFormula.ARRAY_ADD(arguments[0],arguments[1]);
for(var i=2;i<arguments.length;++i)
{
result=HQIndexFormula.ARRAY_ADD(result,arguments[i]);
}
return result;
}
HQIndexFormula.MAX=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
if (data[i]==null) result[i]=null;
else result[i]=Math.max(data[i],data2);
}
}
else
{
var count=Math.max(data.length,data2.length);
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
{
if (data[i]==null || data2[i]==null) result[i]=null;
else result[i]=Math.max(data[i],data2[i]);
}
else
result[i]=null;
}
}
return result;
}
HQIndexFormula.MIN=function(data,data2)
{
var result=[];
var IsNumber=typeof(data2)=="number";
if (IsNumber)
{
for(var i in data)
{
if (data[i]==null) result[i]=null;
else result[i]=Math.min(data[i],data2);
}
}
else
{
var count=Math.max(data.length,data2.length);
for(var i=0;i<count;++i)
{
if (i<data.length && i<data2.length)
{
if (data[i]==null || data2[i]==null) result[i]=null;
else result[i]=Math.min(data[i],data2[i]);
}
else
result[i]=null;
}
}
return result;
}
HQIndexFormula.ABS=function(data)
{
var result=[];
for(var i in data)
{
if (data[i]==null) result[i]=null;
else result[i]=Math.abs(data[i]);
}
return result;
}
HQIndexFormula.MA=function(data,dayCount)
{
var result=[];
for (var i = 0, len = data.length; i < len; i++)
{
if (i < dayCount)
{
result[i]=null;
continue;
}
var sum = 0;
for (var j = 0; j < dayCount; j++)
{
sum += data[i - j];
}
result[i]=sum / dayCount;
}
return result;
}
/*
加权移动平均
返回加权移动平均
用法:EXPMA(X,M):X的M日加权移动平均
EXPMA[i]=buffer[i]*para+(1-para)*EXPMA[i-1] para=2/(1+__para)
*/
HQIndexFormula.EXPMA=function(data,dayCount)
{
var result=[];
if (dayCount>=data.length) return result;
var i=dayCount;
for(;i<data.length;++i) //获取第1个有效数据
{
if (data[i]!=null)
{
result[i]=data[i];
break;
}
}
for (i=i+1; i < data.length; ++i)
{
if (result[i-1]!=null && data[i]!=null)
result[i]=(2*data[i]+(dayCount-1)*result[i-1])/(dayCount+1);
else if (result[i-1]!=null)
result[i]=result[i-1];
}
return result;
}
//加权平滑平均,MEMA[i]=SMA[i]*para+(1-para)*SMA[i-1] para=2/(1+__para)
HQIndexFormula.EXPMEMA=function(data,dayCount)
{
var result=[];
if (dayCount>=data.length) return result;
var index=0;
for(;index<data.length;++index)
{
if (data[index] && !isNaN(data[index])) break;
}
var sum=0;
for(var i=0; index<data.length && i<dayCount;++i, ++index)
{
if (data[index] && !isNaN(data[index]))
sum+=data[index];
else
sum+=data[index-1];
}
result[index-1]=sum/dayCount;
for(;index<data.length;++index)
{
if(result[index-1]!=null && data[index]!=null)
result[index]=(2*data[index]+(dayCount-1)*result[index-1])/(dayCount+1);
else if(result[index-1]!=null)
result[index] = result[index-1];
}
return result;
}
HQIndexFormula.STD=function(data,n)
{
var result=[];
var total=0;
var averageData=[]; //平均值
for(var i=n-1;i<data.length;++i)
{
total=0;
for(var j=0;j<n;++j)
{
total+=data[i-j];
}
averageData[i]=total/n;
}
for(var i=n-1;i<data.length;++i)
{
total=0;
for(var j=0;j<n;++j)
{
total+=Math.pow((data[i-j]-averageData[i]),2);
}
result[i]=Math.sqrt(total/n);
}
return result;
}
//平均绝对方差
HQIndexFormula.AVEDEV=function(data,n)
{
var result=[];
var total=0;
var averageData=[]; //平均值
for(var i=n-1;i<data.length;++i)
{
total=0;
for(var j=0;j<n;++j)
{
total+=data[i-j];
}
averageData[i]=total/n;
}
for(var i=n-1;i<data.length;++i)
{
total=0;
for(var j=0;j<n;++j)
{
total+=Math.abs(data[i-j]-averageData[i]);
}
result[i]=total/n;
}
return result;
}
HQIndexFormula.COUNT=function(data,n)
{
var result=[];
for(var i=n-1;i<data.length;++i)
{
var count=0;
for(var j=0;j<n;++j)
{
if (data[i-j]) ++count;
}
result[i]=count;
}
return result;
}
//上穿
HQIndexFormula.CROSS=function(data,data2)
{
var result=[];
if (data.length!=data2.length) return result=[];
var index=0;
for(;index<data.length;++index)
{
if (data[index]!=null && !isNaN(data[index]) && data2[index]!=null && isNaN(data2[index]))
break;
}
for(++index;index<data.length;++index)
{
result[index]= (data[index]>data2[index]&&data[index-1]<data2[index-1])?1:0;
}
return result;
}
//累乘
HQIndexFormula.MULAR=function(data,n)
{
var result=[];
if(data.length<n) return result;
var index=n;
for(;index<data.length;++index)
{
if (data[index]!=null && !isNaN(data[index]))
{
result[index]=data[index];
break;
}
}
for(++index;index<data.length;++index)
{
result[index]=result[index-1]*data[index];
}
return result;
}
HQIndexFormula.STICKLINE=function(data,price1,price2)
{
var result=[];
if(data.length<=0) return result;
var IsNumber=typeof(price1)=="number";
var IsNumber2=typeof(price2)=="number";
for(var i in data)
{
result[i]=null;
if (isNaN(data[i])) continue;
if (!data[i]) continue;
if (IsNumber && IsNumber2)
{
result[i]={Value:price1,Value2:price2};
}
else if (IsNumber && !IsNumber2)
{
if (isNaN(price2[i])) continue;
result[i]={Value:price1,Value2:price2[i]};
}
else if (!IsNumber && IsNumber2)
{
if (isNaN(price1[i])) continue;
result[i]={Value:price1[i],Value2:price2};
}
else
{
if (isNaN(price1[i]) || isNaN(price2[i])) continue;
result[i]={Value:price1[i],Value2:price2[i]};
}
}
return result;
}
//导出统一使用JSCommon命名空间名
module.exports =
{
//单个类导出
JSCommon_HQIndexFormula: HQIndexFormula
};

3514
uni_modules/jones-hqchart2/js_sdk/umychart.index.data.wechat.js

File diff suppressed because it is too large

1119
uni_modules/jones-hqchart2/js_sdk/umychart.index.wechat.js

File diff suppressed because it is too large

702
uni_modules/jones-hqchart2/js_sdk/umychart.klineinfo.wechat.js

@ -0,0 +1,702 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
小程序信息地雷数据
*/
import {
JSCommonResource_Global_JSChartResource as g_JSChartResource,
} from './umychart.resource.wechat.js'
var KLINE_INFO_TYPE=
{
INVESTOR:1, //互动易
ANNOUNCEMENT:2, //公告
PFORECAST:3, //业绩预告
ANNOUNCEMENT_QUARTER_1:4, //一季度报
ANNOUNCEMENT_QUARTER_2:5, //半年报
ANNOUNCEMENT_QUARTER_3:6, //2季度报
ANNOUNCEMENT_QUARTER_4:7, //年报
RESEARCH:8, //调研
BLOCKTRADING:9, //大宗交易
TRADEDETAIL:10, //龙虎榜
POLICY:11 //策略信息
}
function KLineInfoData()
{
this.ID;
this.Date;
this.Title;
this.InfoType;
this.ExtendData; //扩展数据
}
/*
信息地雷
信息地雷列表
*/
function JSKLineInfoMap()
{
}
JSKLineInfoMap.Get=function(id)
{
var infoMap=new Map(
[
["互动易", {Create:function(){ return new InvestorInfo()} }],
["公告", {Create:function(){ return new AnnouncementInfo()} }],
["业绩预告", {Create:function(){ return new PforecastInfo()} }],
["调研", {Create:function(){ return new ResearchInfo()} }],
["大宗交易", {Create:function(){ return new BlockTrading()} }],
["龙虎榜", {Create:function(){ return new TradeDetail()} }],
["策略选股", {Create: function () { return new PolicyInfo() } }]
]
);
return infoMap.get(id);
}
function IKLineInfo()
{
this.MaxReqeustDataCount=1000;
this.StartDate=20160101;
this.Data;
this.GetToday=function()
{
var date=new Date();
var today=date.getFullYear()*10000+(date.getMonth()+1)*100+date.getDate();
return today;
}
}
/*
互动易
*/
function InvestorInfo()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.RequestData=function(hqChart)
{
var self = this;
var param={ HQChart:hqChart };
this.Data=[];
//请求数据
wx.request({
url: g_JSChartResource.Domain+g_JSChartResource.KLine.Info.Investor.ApiUrl,
data:
{
"filed": ["question","answerdate","symbol","id"],
"symbol": [param.HQChart.Symbol],
"querydate":{"StartDate":this.StartDate,"EndDate":this.GetToday()},
"start":0,
"end":this.MaxReqeustDataCount,
},
method:"post",
dataType: "json",
success: function (recvData)
{
self.RecvData(recvData,param);
}
});
return true;
}
this.RecvData=function(recvData,param)
{
var data=recvData.data;
if (!data || !data.list || data.list.length<=0) return;
for (var i in data.list)
{
var item = data.list[i];
var infoData=new KLineInfoData();
infoData.Date=item.answerdate;
infoData.Title=item.question;
infoData.InfoType=KLINE_INFO_TYPE.INVESTOR;
this.Data.push(infoData);
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
/*
公告
*/
function AnnouncementInfo()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.RequestData=function(hqChart)
{
var self = this;
var param={ HQChart:hqChart };
this.Data=[];
//请求数据
wx.request({
url: g_JSChartResource.Domain+g_JSChartResource.KLine.Info.Announcement.ApiUrl,
data:
{
"filed": ["title","releasedate","symbol","id"],
"symbol": [param.HQChart.Symbol],
"querydate":{"StartDate":this.StartDate,"EndDate":this.GetToday()},
"start":0,
"end":this.MaxReqeustDataCount,
},
method:"post",
dataType: "json",
success: function (recvData)
{
self.RecvData(recvData,param);
}
});
return true;
}
this.RecvData=function(recvData,param)
{
var data=recvData.data;
if (!data) return;
if (!data.report || data.report.length<=0) return;
for (var i in data.report)
{
var item = data.report[i];
var infoData=new KLineInfoData();
infoData.Date=item.releasedate;
infoData.Title=item.title;
infoData.InfoType=KLINE_INFO_TYPE.ANNOUNCEMENT;
for(var j in item.type)
{
var typeItem=item.type[j];
switch(typeItem)
{
case "一季度报告":
infoData.InfoType=KLINE_INFO_TYPE.ANNOUNCEMENT_QUARTER_1;
break;
case "半年度报告":
infoData.InfoType=KLINE_INFO_TYPE.ANNOUNCEMENT_QUARTER_2;
break;
case "三季度报告":
infoData.InfoType=KLINE_INFO_TYPE.ANNOUNCEMENT_QUARTER_3;
break;
case "年度报告":
infoData.InfoType=KLINE_INFO_TYPE.ANNOUNCEMENT_QUARTER_4;
break;
}
}
this.Data.push(infoData);
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
/*
业绩预告
*/
function PforecastInfo()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.RequestData=function(hqChart)
{
var self = this;
this.Data = [];
var param={ HQChart:hqChart };
//请求数据
wx.request({
url: g_JSChartResource.Domain+g_JSChartResource.KLine.Info.Pforecast.ApiUrl,
data:
{
"field": ["pforecast.type","pforecast.reportdate","fweek"],
"condition":
[
{"item":["pforecast.reportdate","int32","gte",this.StartDate]}
],
"symbol": [param.HQChart.Symbol],
"start":0,
"end":this.MaxReqeustDataCount,
},
method:"post",
dataType: "json",
success: function (recvData)
{
self.RecvData(recvData,param);
}
});
return true;
}
this.RecvData=function(recvData,param)
{
var data=recvData.data;
if (!data.stock || data.stock.length!=1) return;
if (!data.stock[0].stockday || data.stock[0].stockday.length<=0) return;
for (var i in data.stock[0].stockday)
{
var item = data.stock[0].stockday[i];
if (item.pforecast.length>0)
{
var dataItem=item.pforecast[0];
var infoData=new KLineInfoData();
infoData.Date= item.date;
infoData.Title=dataItem.type;
infoData.InfoType=KLINE_INFO_TYPE.PFORECAST;
infoData.ExtendData={ Type:dataItem.type, ReportDate:dataItem.reportdate}
if(item.fweek) //未来周涨幅
{
infoData.ExtendData.FWeek={};
if (item.fweek.week1!=null) infoData.ExtendData.FWeek.Week1=item.fweek.week1;
if (item.fweek.week4!=null) infoData.ExtendData.FWeek.Week4=item.fweek.week4;
}
this.Data.push(infoData);
}
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
/*
投资者关系 (调研)
*/
function ResearchInfo()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.RequestData=function(hqChart)
{
var self = this;
var param= { HQChart:hqChart };
this.Data=[];
//请求数据
wx.request({
url: g_JSChartResource.Domain+g_JSChartResource.KLine.Info.Research.ApiUrl,
data:
{
"filed": ["releasedate","researchdate","level","symbol","id"],
"querydate":{"StartDate":this.StartDate,"EndDate":this.GetToday()},
"symbol": [param.HQChart.Symbol],
"start":0,
"end":this.MaxReqeustDataCount,
},
method:"post",
dataType: "json",
success: function (recvData)
{
self.RecvData(recvData,param);
}
});
return true;
}
this.RecvData=function(recvData,param)
{
var data=recvData.data;
if (!data) return;
if (!data.list || data.list.length<=0) return;
for (var i in data.list)
{
var item = data.list[i];
var infoData=new KLineInfoData();
infoData.ID=item.id;
infoData.Date= item.researchdate;
infoData.InfoType=KLINE_INFO_TYPE.RESEARCH;
infoData.ExtendData={ Level:item.level };
this.Data.push(infoData);
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
/*
大宗交易
*/
function BlockTrading()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.RequestData=function(hqChart)
{
var self = this;
var param={ HQChart:hqChart,};
this.Data=[];
//请求数据
wx.request({
url: g_JSChartResource.Domain+g_JSChartResource.KLine.Info.BlockTrading.ApiUrl,
data:
{
"field": ["blocktrading.price","blocktrading.vol","blocktrading.premium","fweek","price"],
"condition":
[
{"item":["date","int32","gte",this.StartDate]},
{"item":["blocktrading.vol","int32","gte","0"]}
],
"symbol": [param.HQChart.Symbol],
"start":0,
"end":this.MaxReqeustDataCount,
},
method:"post",
dataType: "json",
success: function (recvData)
{
self.RecvData(recvData,param);
}
});
return true;
}
this.RecvData=function(recvData,param)
{
var data=recvData.data;
if (!data || !data.stock || data.stock.length!=1) return;
if (!data.stock[0].stockday || data.stock[0].stockday.length<=0) return;
for (var i in data.stock[0].stockday)
{
var item = data.stock[0].stockday[i];
var infoData=new KLineInfoData();
infoData.Date= item.date;
infoData.InfoType=KLINE_INFO_TYPE.BLOCKTRADING;
infoData.ExtendData=
{
Price:item.blocktrading.price, //交易价格
Premium:item.blocktrading.premium, //溢价 (百分比%)
Vol:item.blocktrading.vol, //交易金额单位(万元)
ClosePrice:item.price, //收盘价
};
if(item.fweek) //未来周涨幅
{
infoData.ExtendData.FWeek={};
if (item.fweek.week1!=null) infoData.ExtendData.FWeek.Week1=item.fweek.week1;
if (item.fweek.week4!=null) infoData.ExtendData.FWeek.Week4=item.fweek.week4;
}
this.Data.push(infoData);
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
/*
龙虎榜
*/
function TradeDetail()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.RequestData=function(hqChart)
{
var self = this;
var param={ HQChart:hqChart };
this.Data=[];
//请求数据
wx.request({
url: g_JSChartResource.Domain+g_JSChartResource.KLine.Info.TradeDetail.ApiUrl,
data:
{
"field": ["tradedetail.typeexplain","tradedetail.type","fweek"],
"condition":
[
{"item":["date","int32","gte",this.StartDate]},
{"item":["tradedetail.type","int32","gte","0"]}
],
"symbol": [param.HQChart.Symbol],
"start":0,
"end":this.MaxReqeustDataCount,
},
method:"post",
dataType: "json",
success: function (recvData)
{
self.RecvData(recvData,param);
}
});
return true;
}
this.RecvData=function(recvData,param)
{
var data=recvData.data;
if (!data || !data.stock || data.stock.length!=1) return;
if (!data.stock[0].stockday || data.stock[0].stockday.length<=0) return;
for (var i in data.stock[0].stockday)
{
var item = data.stock[0].stockday[i];
var infoData=new KLineInfoData();
infoData.Date= item.date;
infoData.InfoType=KLINE_INFO_TYPE.TRADEDETAIL;
infoData.ExtendData={Detail:new Array()};
for(var j in item.tradedetail)
{
var tradeItem=item.tradedetail[j];
infoData.ExtendData.Detail.push({"Type":tradeItem.type,"TypeExplain":tradeItem.typeexplain});
}
if(item.fweek) //未来周涨幅
{
infoData.ExtendData.FWeek={};
if (item.fweek.week1!=null) infoData.ExtendData.FWeek.Week1=item.fweek.week1;
if (item.fweek.week4!=null) infoData.ExtendData.FWeek.Week4=item.fweek.week4;
}
this.Data.push(infoData);
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
//策略信息
function PolicyInfo()
{
this.newMethod = IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.PolicyList = []; //筛选的策略名字 {Name:策略名, Guid:策略的GUID}
this.SetPolicyList=function(aryPolicy)
{
for(let i in aryPolicy)
{
this.PolicyList.push({Name:aryPolicy[i]});
}
}
this.RequestData = function (hqChart)
{
var self = this;
this.Data = [];
var param = { HQChart: hqChart };
// setTimeout(function () { self.RecvData(null, param); }, 2000); //模拟数据到达
//请求数据
wx.request({
url: g_JSChartResource.Domain + g_JSChartResource.KLine.Info.Policy.ApiUrl,
data: {
"symbol": [param.HQChart.Symbol],
field: ["policy"],
"condition": [
{ "item": ["date", "int32", "gte", this.StartDate, "lte", this.GetToday()] }],
"start": 0,
"end": this.MaxReqeustDataCount
},
method: "post",
dataType: "json",
success: function (recvData) {
self.RecvData(recvData, param);
}
})
return true;
}
this.RecvData = function (recvData, param)
{
var data = recvData.data;
if (!data.stock || data.stock.length != 1) return;
if (!data.stock[0].stockday || data.stock[0].stockday.length <= 0) return;
var setName=new Set();
for(var i in this.PolicyList) //把需要过滤的策略名字放set里, 方便后面过滤
{
setName.add(this.PolicyList[i].Name);
}
for (var i in data.stock[0].stockday)
{
var item = data.stock[0].stockday[i];
var infoData = new KLineInfoData();
infoData.Date = item.date;
infoData.InfoType = KLINE_INFO_TYPE.POLICY;
infoData.ExtendData = [];
for (var j in item.policy)
{
var name = item.policy[j].name;
if (setName.has(name)) infoData.ExtendData.push({ Name: name });
}
if (infoData.ExtendData.length>0) this.Data.push(infoData);
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
if (param.HQChart.UpdateUICallback) param.HQChart.UpdateUICallback('RecvPolicyInfoData', this);
}
}
////////////////////////////////////////////////////////////////////////////////////////////
// 走势图信息地雷
//
//
////////////////////////////////////////////////////////////////////////////////////////////
function JSMinuteInfoMap() { }
JSMinuteInfoMap.InfoMap = new Map(
[
["大盘异动", { Create: function () { return new MarketEventInfo() } }],
]);
JSMinuteInfoMap.Get = function (id)
{
return JSMinuteInfoMap.InfoMap.get(id);
}
function IMinuteInfo()
{
this.Data;
this.ClassName = 'IMinuteInfo';
}
//////////////////////////////////////////////////////////////////////
// 大盘异动
// 结构 {Date:日期 Time:时间, Title:标题, Type:0 }
////////////////////////////////////////////////////////////////////
function MarketEventInfo()
{
this.newMethod = IMinuteInfo; //派生
this.newMethod();
delete this.newMethod;
this.ClassName = 'MarketEventInfo';
this.RequestData = function (hqChart)
{
var self = this;
this.Data = [];
var param =
{
HQChart: hqChart
};
var url = g_JSChartResource.CacheDomain + '/cache/analyze/shszevent/marketevent/concept/' + hqChart.TradeDate + '.json';
if (hqChart.NetworkFilter) {
var obj =
{
Name: 'MarketEventInfo::RequestData', //类名::
Explain: '大盘异动',
Request: { Url: url, Type: 'Get', Data: { Date: hqChart.TradeDate, Symbol: hqChart.Symbol } },
Self: this,
PreventDefault: false
};
hqChart.NetworkFilter(obj, function (data)
{
self.RecvData(data, param);
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
});
if (obj.PreventDefault == true) return; //已被上层替换,不调用默认的网络请求
}
//请求数据
wx.request({
url: url,
method: "get",
dataType: "json",
success: function (recvData) {
self.RecvData(recvData, param);
},
error: function (http, e) {
console.warn("[MarketEventInfo::RequestData] error, http ", e, http);
}
});
return true;
}
this.RecvData = function (recvData, param)
{
var data=recvData.data;
for (var i in data.event)
{
var event = data.event[i];
for (var j in event.data)
{
var item = event.data[j];
if (item.length < 2) continue;
var info = { Date: event.date, Time: item[0], Title: item[1], Type: 0 };
this.Data.push(info);
}
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
//导出统一使用JSCommon命名空间名
module.exports =
{
JSCommonKLineInfo:
{
JSKLineInfoMap: JSKLineInfoMap,
KLINE_INFO_TYPE: KLINE_INFO_TYPE,
JSMinuteInfoMap: JSMinuteInfoMap,
},
//单个类导出
JSCommon_JSKLineInfoMap: JSKLineInfoMap,
JSCommon_KLINE_INFO_TYPE: KLINE_INFO_TYPE,
JSCommon_JSMinuteInfoMap: JSMinuteInfoMap,
};

410
uni_modules/jones-hqchart2/js_sdk/umychart.regressiontest.wechat.js

@ -0,0 +1,410 @@
/*
Copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
个股指标回测
*/
/*
指标回测
计算: Trade: {Count 交易次数 Days:交易天数 Success:成功交易次数 Fail:失败交易次数}
Day: {Count:总运行 Max:最长运行 Min:最短运行 Average:平均运行}
Profit: 总收益 StockProfit:个股收益 Excess:超额收益 MaxDropdown:最大回撤 Beta:β(Beta)系数(指标里面需要又大盘数据)
NetValue: [ {Date:日期, Net:净值, Close:股票收盘价, IndexClose:大盘的收盘价}, ]
*/
function RegressionTest()
{
//只读数据不能修改
this.HistoryData; //K线数据
this.BuyData; //策略买数据
this.SellData; //策略卖数据
this.IndexClose; //大盘收盘价
this.NetCalculateModel=0; //净值及收益计算模型 0=使用B点开盘价计算 1=使用B点下一天的开盘价计算
this.InitialCapital=10000; //初始资金1W
//计算结果数据
this.Data=new Map(); //key:DATA_NAME value:数据
this.SetPolicyData=function(obj) //设置策略结果的数据 {KLineData:个股K线数据, BuyData:策略买数据, SellData:策略卖数据, IndexClose:大盘收盘价}
{
this.HistoryData=obj.KLineData; //K线数据
this.BuyData=obj.BuyData; //策略买数据
this.SellData=obj.SellData; //策略卖数据
if (obj.IndexClose) this.IndexClose=obj.IndexClose; //大盘收盘价 如果没有大盘数据 就不计算β(Beta)系数 和指数涨幅数据
}
this.ClearData=function() //清空所有的结果数据
{
this.Data=new Map()
}
this.GetBSData=function(startDate) //BS点配对 { B:[{Data:K线数据, Count:天数, NextOpen:下一天的开盘价 }], S:{Data:K线数据}}
{
var index=null;
for(var i=0;i<this.HistoryData.length;++i)
{
var item=this.HistoryData[i];
if (item.Date>=startDate)
{
index=i;
break;
}
}
if (index===null) return null;
console.log(`[RegressionTest::GetBSData] startDate=${startDate} index=${index}`);
var aryBS=[];
var bsItem=null;
for(var i=index;i<this.HistoryData.length;++i)
{
var buyItem=this.BuyData[i];
var sellItem=this.SellData[i];
var kLineItem=this.HistoryData[i];
if (bsItem===null)
{
if (buyItem>0)
{
var bItem={Data:kLineItem, Count:0 };
if (i+1<this.HistoryData.length) bItem.NextOpen=this.HistoryData[i+1].Open; //获取下一天的开盘价
bsItem={ B:[bItem], S:null}; //B可以多个,S一个
}
}
else
{
for(var j in bsItem.B) ++bsItem.B[j].Count; //天数+1
if (buyItem>0)
{
var bItem={Data:kLineItem, Count:0};
if (i+1<this.HistoryData.length) bItem.NextOpen=this.HistoryData[i+1].Open; //获取下一天的开盘价
bsItem.B.push(bItem);
}
else if (sellItem>0)
{
bsItem.S={Data:kLineItem};
aryBS.push(bsItem);
bsItem=null;
}
}
}
var data={StartDate:this.HistoryData[index].Date, StartIndex:index, Count:this.HistoryData.length-index, BSData:aryBS };
console.log('[RegressionTest::GetBSData] data',data);
return data;
}
this.Calculate=function(data)
{
var day={ Count:data.Count, Max:null, Min:null, Average:null }; //Count:总运行 Max:最长运行 Min:最短运行 Average:平均运行
var trade={Count:0, Days:0, Success:0 , Fail:0, SuccessRate:0}; //Count 交易次数 Days:交易天数 Success:成功交易次数 Fail:失败交易次数
for(var i in data.BSData)
{
var item=data.BSData[i];
for(var j in item.B)
{
var bItem=item.B[j];
if (day.Max===null) day.Max=bItem.Count;
else if (day.Max<bItem.Count) day.Max=bItem.Count;
if (day.Min===null) day.Min=bItem.Count;
else if (day.Min>bItem.Count) day.Min=bItem.Count;
++trade.Count;
trade.Days+=bItem.Count;
if (item.S.Data.Close>bItem.Data.Open) ++trade.Success;
else ++trade.Fail;
}
}
if (trade.Count>0)
{
day.Average=trade.Days/trade.Count;
trade.SuccessRate=trade.Success/trade.Count;
}
//计算收益(总收益)
var profit=1,buyPrice;
for(var i in data.BSData)
{
var item=data.BSData[i];
if (this.NetCalculateModel===1 && item.B[0].NextOpen>0 ) buyPrice=item.B[0].NextOpen;
else buyPrice=item.B[0].Data.Open;
var sellPrice=item.S.Data.Close;
var value=(sellPrice-buyPrice)/buyPrice+1;
profit*=value;
}
profit-=1; //公式:[(1+收益1)*(1+收益2)*(1+收益3)……(1+收益n)-1] x 100%
//标的证券收益
var yClose=this.HistoryData[data.StartIndex].Close; //使用前收盘
var close=this.HistoryData[this.HistoryData.length-1].Close; //最后一个大盘收盘价
var stockProfit=(close-yClose)/yClose;
console.log(`[RegressionTest::Calculate] stock profit first[${this.HistoryData[data.StartIndex].Date}, YClose=${this.HistoryData[data.StartIndex].YClose}] end[${this.HistoryData[this.HistoryData.length-1].Date}, Close=${this.HistoryData[this.HistoryData.length-1].Close}]`);
var netValue=this.CaclulateNetValue(data);
var maxDropdown=null, beta=null;
if (netValue && netValue.length>0)
{
maxDropdown=this.CaclulateMaxDropdown(netValue);
if (this.IndexClose) beta=this.CaclulateBeta(netValue);
}
//Profit:收益 StockProfit:标的证券收益 Excess:超额收益(加上BS配对的数据)
var result={ Day:day, Trade:trade, Profit:profit, StockProfit:stockProfit, Excess:profit-stockProfit, NetValue:netValue, MaxDropdown:maxDropdown, Beta:beta,BSDataPair:data.BSData};
console.log('[RegressionTest::Calculate] NetCalculateModel, result ',this.NetCalculateModel, result);
return result;
}
this.CaclulateNetValue=function(data) //计算净值
{
var index=data.StartIndex;
var aryDay=[]; //{Close:收盘 , Open:开盘, Position:持仓数量, Cache:现金 , MarketValue:总市值}
var lastDayItem={Position:0, Cache:this.InitialCapital };
var bsItem=null, buyPrice;
for(var i=index;i<this.HistoryData.length;++i)
{
var buyItem=this.BuyData[i];
var sellItem=this.SellData[i];
var kLineItem=this.HistoryData[i];
var dayItem={Date:kLineItem.Date, Position:lastDayItem.Position, Cache:lastDayItem.Cache, Open:kLineItem.Open, Close:kLineItem.Close};
dayItem.MarketValue=dayItem.Position*dayItem.Close+dayItem.Cache; //市值 股票+现金
if (bsItem===null)
{
if (buyItem>0) //买
{
bsItem={ B:{Data:kLineItem}, S:null};
if (this.NetCalculateModel===1 && i+1<this.HistoryData.length && this.HistoryData[i+1].Open>0)
buyPrice=this.HistoryData[i+1].Open; //使用B点下一天的开盘价买
else
buyPrice=dayItem.Open;
let position=parseInt(dayItem.Cache/buyPrice); //开盘价买
let cache=dayItem.Cache-buyPrice*position; //剩余的现金
dayItem.Position=position;
dayItem.Cache=cache;
dayItem.MarketValue=dayItem.Position*dayItem.Close+dayItem.Cache; //市值 股票+现金
}
}
else
{
if (sellItem>0) //卖
{
bsItem.S={Data:kLineItem};
bsItem=null;
let stockValue=dayItem.Position*dayItem.Close; //卖掉的股票钱
dayItem.Position=0;
dayItem.Cache+=stockValue; //卖掉的钱放到现金里面
dayItem.MarketValue=dayItem.Position*dayItem.Close+dayItem.Cache; //市值 股票+现金
}
}
//缓存上一天的数据
lastDayItem.Position=dayItem.Position;
lastDayItem.Cache=dayItem.Cache;
dayItem.Net=dayItem.MarketValue/this.InitialCapital; //净值
if (this.IndexClose) dayItem.IndexClose=this.IndexClose[i]; //指数收盘价
aryDay.push(dayItem);
}
//console.log('[RegressionTest::CaclulateNetValue] aryDay',aryDay);
if (aryDay.length<=0) return [];
var netValue=[]; //净值 {Date:日期, Net:净值, Close:股票收盘价, IndexClose:大盘的收盘价}
for(var i=0;i<aryDay.length;++i)
{
var item=aryDay[i];
var dataItem={ Net:item.Net, Date:item.Date, Close:item.Close };
if (item.IndexClose) dataItem.IndexClose=item.IndexClose;
netValue.push(dataItem);
}
//console.log('[RegressionTest::CaclulateNetValue] netValue',netValue);
return netValue;
}
this.CaclulateMaxDropdown=function(data) //最大回撤
{
var maxNet=data[0].Net; //最大净值
var maxValue=0;
var maxDay;
for(var i=1;i<data.length;++i)
{
var item=data[i];
var value=1-(item.Net/maxNet); //1-策略当日净值 / 当日之前策略最大净值
if (maxValue<value)
{
maxValue=value;
maxDay=item;
}
if (maxNet<item.Net) maxNet=item.Net; //取当前最大的净值
}
console.log('[RegressionTest::CaclulateMaxDropdown] maxDay',maxDay);
return maxValue;
}
this.CaclulateBeta=function(data) //β(Beta)系数,参数是净值数组NetValue
{
var lastItem=data[0]; //上一天的数据
var indexProfit=[]; //大盘涨幅
var bsProfit=[]; //策略涨幅
var indexProfitTotal=0, bsProfitTotal=0;
for(var i=1; i<data.length; ++i)
{
indexProfit[i-1]=0;
bsProfit[i-1]=0;
var item=data[i];
if (item.IndexClose>0 && lastItem.IndexClose>0) indexProfit[i-1]=(item.IndexClose-lastItem.IndexClose)/lastItem.IndexClose;
if (item.Net>0 && lastItem.Net>0) bsProfit[i-1]=(item.Net-lastItem.Net)/lastItem.Net;
//if (item.Close>0 && lastItem.Close>0) bsProfit[i-1]=(item.Close-lastItem.Close)/lastItem.Close;
indexProfitTotal+=indexProfit[i-1];
bsProfitTotal+=bsProfit[i-1];
lastItem=item;
}
var averageIndexProfit=indexProfitTotal/indexProfit.length;
var averageBSProfit=bsProfitTotal/bsProfit.length;
var betaCOV=0; //协方差
for(var i=0;i<indexProfit.length;++i)
{
betaCOV+=(bsProfit[i]-averageBSProfit)*(indexProfit[i]-averageIndexProfit);
}
var betaVAR=0; //标准差:方差的开2次方
for(var i=0;i<indexProfit.length;++i)
{
betaVAR+=(indexProfit[i]-averageIndexProfit)*(indexProfit[i]-averageIndexProfit);
}
return betaCOV/betaVAR;
}
this.Execute=function(obj) //开始计算[ { Name:名字 , Date:起始日期 格式(20180101) }, ....]
{
for(var i in obj )
{
var item=obj[i];
if (this.Data.has(item.Name)) //已经计算过了不计算
{
console.log(`[RegressionTest::Execute] id=${i} Name=${item.Name} Date:${item.Date} is exsit.`);
continue;
}
console.log(`[RegressionTest::Execute] id=${i} Name=${item.Name} Date:${item.Date}`);
var data=this.GetBSData(item.Date);
var result=this.Calculate(data);
this.Data.set(item.Name, result);
}
}
}
//计算叠加数据 (日期必须匹配)
RegressionTest.CaclulateOverlayData=function(obj) //{Main:主数据, Sub:[]//多组叠加数据}
{
if (!obj.Main || !obj.Sub) return null;
var count=obj.Main.length;
for(var i in obj.Sub)
{
var item=obj.Sub[i];
if (item.length!=count)
{
console.log(`[RegressionTest::OverlayData] id=${i} data count not match. MainData count=${count}`);
return null;
}
}
var result=[]; //[0]:主数据 , [1...]:叠加数据
var firstData={Sub:[]};
firstData.Main=obj.Main[0];
result.push([]);
for(var i=0;i<obj.Sub.length;++i)
{
var subData=obj.Sub[i];
firstData.Sub[i]=subData[0];
result.push([]);
}
for(var i=0;i<obj.Main.length;++i)
{
var value=obj.Main[i];
var valuePer=(value-firstData.Main)/firstData.Main;
result[0][i]=valuePer;
for(var j=0;j<obj.Sub.length;++j)
{
var subData=obj.Sub[j];
var subValue=subData[i];
var subValuePer=(subValue-firstData.Sub[j])/firstData.Sub[j];
result[j+1][i]=subValuePer;
}
}
return result;
}
RegressionTest.GetPolicyData=function(data) //获取指标数据里面需要计算回测的数据
{
var policyData={KLineData:null, IndexClose:null, BuyData:null, SellData:null};
policyData.KLineData=data.HistoryData.Data; //个股K线数据,
for(var i in data.OutVar)
{
var item=data.OutVar[i];
if (item.Name=='INDEXCLOSE')
{
policyData.IndexClose=item.Data; //绑定大盘收盘数据
}
else if (item.Name=='DRAWICON') //买卖盘BS函数
{
if (item.Draw && item.Draw.Icon)
{
if (item.Draw.Icon.ID===13) policyData.BuyData=item.Draw.DrawData; //买
else if (item.Draw.Icon.ID===14) policyData.SellData=item.Draw.DrawData; //卖
}
}
}
if (policyData.KLineData && policyData.BuyData && policyData.SellData) return policyData;
return null;
}
//导出
module.exports =
{
JSCommonTest:
{
RegressionTest: RegressionTest, //个股单策略回测
},
};

646
uni_modules/jones-hqchart2/js_sdk/umychart.resource.wechat.js

@ -0,0 +1,646 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
全局配置颜色
*/
function JSChartResource()
{
this.TooltipBGColor = "rgb(255, 255, 255)"; //背景色
this.TooltipAlpha = 0.92; //透明度
this.SelectRectBGColor = "rgba(1,130,212,0.06)"; //背景色
// this.SelectRectAlpha=0.06; //透明度
this.BGColor = 'rgb(255,255,255)'; //背景色
this.UpBarColor = "rgb(238,21,21)";
this.DownBarColor = "rgb(25,158,0)";
this.UnchagneBarColor = "rgb(0,0,0)";
this.MinKLineBarWidth=4; //最小的柱子宽度 比这个还小就画直线
this.Minute = {};
this.Minute.VolBarColor = null;
this.Minute.PriceColor = "rgb(50,171,205)";
this.Minute.AreaPriceColor = 'rgba(50,171,205,0.1)';
this.Minute.AvPriceColor = "rgb(238,127,9)";
this.DefaultTextColor = "rgb(43,54,69)";
this.DefaultTextFont = '14px 微软雅黑';
this.IndexTitleBGColor='rgb(217,219,220)'; //指标名字背景色
this.DynamicTitleFont = '12px 微软雅黑'; //指标动态标题字体
this.UpTextColor = "rgb(238,21,21)";
this.DownTextColor = "rgb(25,158,0)";
this.UnchagneTextColor = "rgb(0,0,0)";
this.CloseLineColor = 'rgb(0,191,255)';
this.CloseLineAreaColor = ['rgba(0,191,255,0.8)', 'rgba(0,191,255,0.2)'];
this.Title = {
TradeIndexColor:'rgb(105,105,105)', //交易指标颜色
ColorIndexColor:'rgb(112,128,144)', //五彩K线颜色
VolColor:"rgb(43,54,69)", //标题成交量
AmountColor:"rgb(43,54,69)", //成交金额
DateTimeColor:"rgb(43,54,69)", //时间,日期
SettingColor:"rgb(43,54,69)", //周期,复权
NameColor:"rgb(43,54,69)" , //股票名称
TurnoverRateColor:'rgb(43,54,69)', //换手率
PositionColor:"rgb(43,54,69)" //持仓
};
this.FrameBorderPen = "rgb(225,236,242)";
this.FrameSplitPen = "rgb(225,236,242)"; //分割线
this.FrameSplitTextColor = "rgb(51,51,51)"; //刻度文字颜色
this.FrameSplitTextFont = "12px 微软雅黑"; //坐标刻度文字字体
this.FrameYLineDash=[2, 2]; //Y轴线段虚线点间距,填null 就是实线
this.FrameXLineDash=null; //X轴线段虚线点间距,填null 就是实线
//this.FrameSplitTextFont = "14px PingFang-SC-Bold";//坐标刻度文字字体
this.FrameTitleBGColor = "rgb(246,251,253)"; //标题栏背景色
this.Frame = {
XBottomOffset: 0 , //X轴文字向下偏移
YTopOffset:2 //Y轴顶部文字向下偏移
};
this.FrameLatestPrice =
{
TextColor: 'rgb(255,255,255)', //最新价格文字颜色
UpBarColor: "rgb(238,21,21)", //上涨
DownBarColor: "rgb(25,158,0)", //下跌
UnchagneBarColor: "rgb(0,0,0)", //平盘
BGAlpha: 0.6
};
this.FrameMargin = 4; //左右一共的边距
this.FrameLeftMargin = 2;
this.FrameRightMargin=2;
this.CorssCursorBGColor = "rgb(43,54,69)"; //十字光标背景
this.CorssCursorTextColor = "rgb(255,255,255)";
this.CorssCursorTextFont = "12px 微软雅黑";
this.CorssCursorHPenColor = "rgb(130,130,130)"; //十字光标线段颜色(水平)
this.CorssCursorVPenColor = "rgb(130,130,130)"; //十字光标线段颜色(垂直)
this.Domain = "https://opensource.zealink.com"; //API域名
this.CacheDomain = "https://opensourcecache.zealink.com"; //缓存域名
this.KLine =
{
MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
Info: //信息地雷
{
Color: 'rgb(205,149,12)',
Color2: 'rgb(255,133,3)', //三角图形颜色
TextColor: '#197de9',
TextBGColor: 'rgba(220,220,220,0.5)',
Investor:
{
ApiUrl: '/API/NewsInteract', //互动易
},
Announcement: //公告
{
ApiUrl: '/API/ReportList',
},
Pforecast: //业绩预告
{
ApiUrl: '/API/StockHistoryDay',
},
Research: //调研
{
ApiUrl: '/API/InvestorRelationsList',
},
BlockTrading: //大宗交易
{
ApiUrl: '/API/StockHistoryDay',
},
TradeDetail: //龙虎榜
{
ApiUrl: '/API/StockHistoryDay',
},
Policy: //策略
{
ApiUrl: '/API/StockHistoryDay',
}
}
};
this.Index = {};
//指标线段颜色
this.Index.LineColor =
[
"rgb(255,189,09)",
"rgb(22,198,255)",
"rgb(174,35,161)",
"rgb(236,105,65)",
"rgb(68,114,196)",
"rgb(229,0,79)",
"rgb(0,128,255)",
"rgb(252,96,154)",
"rgb(42,230,215)",
"rgb(24,71,178)",
];
this.ColorArray = //自定义指标默认颜色
[
"rgb(255,174,0)",
"rgb(25,199,255)",
"rgb(175,95,162)",
"rgb(236,105,65)",
"rgb(68,114,196)",
"rgb(229,0,79)",
"rgb(0,128,255)",
"rgb(252,96,154)",
"rgb(42,230,215)",
"rgb(24,71,178)",
];
//历史数据api
this.Index.StockHistoryDayApiUrl = "https://opensource.zealink.com/API/StockHistoryDay";
//市场多空
this.Index.MarketLongShortApiUrl = "https://opensource.zealink.com/API/FactorTiming";
//市场关注度
this.Index.MarketAttentionApiUrl = "https://opensource.zealink.com/API/MarketAttention";
//行业,指数热度
this.Index.MarketHeatApiUrl = "https://opensource.zealink.com/API/MarketHeat"
//自定义指数热度
this.Index.CustomIndexHeatApiUrl = "https://opensource.zealink.com/API/QuadrantCalculate";
//指标不支持信息
this.Index.NotSupport = { Font: "14px 微软雅黑", TextColor: "rgb(52,52,52)" };
//画图工具
this.DrawPicture = {};
this.DrawPicture.LineColor =
[
"rgb(30,144,255)",
];
this.DrawPicture.PointColor =
[
"rgb(105,105,105)",
];
this.KLineTrain =
{
Font: 'bold 14px 宋体',
LastDataIcon: { Color: 'rgb(0,0,205)', Text: '⬇' },
BuyIcon: { Color: 'rgb(255,185, 15)', Text: '买' },
SellIcon: { Color: 'rgb(70,130,180)', Text: '卖' }
};
//K线tooltip
this.TooltipPaint =
{
BGColor: 'rgba(250,250,250,0.8)', //背景色
BorderColor: 'rgb(120,120,120)', //边框颜色
TitleColor: 'rgb(120,120,120)', //标题颜色
TitleFont: '13px 微软雅黑' //字体
},
//弹幕
this.Barrage =
{
Font: '16px 微软雅黑', //字体
Height: 20,
Color: 'RGB(109,109,109)'
}
//走势图 信息地雷
this.MinuteInfo = {
TextColor: 'rgb(84,143,255)',
Font: '14px 微软雅黑',
PointColor: 'rgb(38,113,254)',
LineColor: 'rgb(120,167,255)',
TextBGColor: 'rgba(255,255,255,0.8)'
};
//单图标指标ChartSingleText -> DRAWICON
this.DRAWICON=
{
Text:
{
MaxSize:50, //字体最大
MinSize:20, //字体最小
Zoom:
{
Type:2, //0=放大(K线宽度*Value) 1=放大(K线+间距)*Value 2=(K线+间距)+2*Value;
Value:1
},
FontName:'Arial' //字体
}
}
this.DRAWTEXT=
{
MaxSize:18, //字体最大
MinSize:18, //字体最小
Zoom:
{
Type:1, //0=放大(K线宽度*Value) 1=放大(K线+间距)*Value 2=(K线+间距)+2*Value;
Value:1
},
FontName:'微软雅黑' //字体
}
this.DRAWNUMBER=
{
MaxSize:18, //字体最大
MinSize:18, //字体最小
Zoom:
{
Type:1, //0=放大(K线宽度*Value) 1=放大(K线+间距)*Value 2=(K线+间距)+2*Value;
Value:1
},
FontName:'微软雅黑' //字体
}
this.DRAWABOVE=
{
YOffset:0 //y坐标向上偏移
}
this.CIRCLEDOT=
{
Radius:1.3
}
this.POINTDOT=
{
Radius:2
}
//深度图
this.DepthChart=
{
BidColor: { Line:"rgb(82,176,123)", Area:"rgba(82,176,123,0.8)"}, //卖
AskColor: { Line:"rgb(207,76,89)", Area:"rgba(207,76,89, 0.8)"}, //买
LineWidth:4
}
this.DepthCorss=
{
BidColor: { Line:"rgb(82,176,123)" }, //卖
AskColor: { Line:"rgb(207,76,89)" }, //买
LineWidth:2, //线段宽度
LineDash:[3,3],
Tooltip:
{
BGColor:'rgba(236,240,245, 0.8)', TextColor:"rgb(130,140,151)",
Border:{ Top:5, Left:20, Bottom:5, Center: 5},
Font:"14px 微软雅黑",
LineHeight:16 //单行高度
}
}
// //自定义风格
this.SetStyle = function (style)
{
if (style.TooltipBGColor) this.TooltipBGColor = style.TooltipBGColor;
if (style.TooltipAlpha) this.TooltipAlpha = style.TooltipAlpha;
if (style.BGColor) this.BGColor = style.BGColor;
if (style.SelectRectBGColor) this.SelectRectBGColor = style.SelectRectBGColor;
if (style.UpBarColor) this.UpBarColor = style.UpBarColor;
if (style.DownBarColor) this.DownBarColor = style.DownBarColor;
if (style.UnchagneBarColor) this.UnchagneBarColor = style.UnchagneBarColor;
if (style.Minute)
{
if (style.Minute.VolBarColor) this.Minute.VolBarColor = style.Minute.VolBarColor;
if (style.Minute.PriceColor) this.Minute.PriceColor = style.Minute.PriceColor;
if (style.Minute.AvPriceColor) this.Minute.AvPriceColor = style.Minute.AvPriceColor;
if (style.Minute.AreaPriceColor) this.Minute.AreaPriceColor = style.Minute.AreaPriceColor;
}
if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
if (style.DefaultTextFont) this.DefaultTextFont = style.DefaultTextFont;
if (style.DynamicTitleFont) this.DynamicTitleFont = style.DynamicTitleFont;
if (style.IndexTitleBGColor) this.IndexTitleBGColor=style.IndexTitleBGColor;
if (style.UpTextColor) this.UpTextColor = style.UpTextColor;
if (style.DownTextColor) this.DownTextColor = style.DownTextColor;
if (style.UnchagneTextColor) this.UnchagneTextColor = style.UnchagneTextColor;
if (style.CloseLineColor) this.CloseLineColor = style.CloseLineColor;
if (style.CloseLineAreaColor) this.CloseLineAreaColor = style.CloseLineAreaColor;
if (style.FrameBorderPen) this.FrameBorderPen = style.FrameBorderPen;
if (style.FrameSplitPen) this.FrameSplitPen = style.FrameSplitPen;
if (style.FrameSplitTextColor) this.FrameSplitTextColor = style.FrameSplitTextColor;
if (style.FrameSplitTextFont) this.FrameSplitTextFont = style.FrameSplitTextFont;
if (style.FrameTitleBGColor) this.FrameTitleBGColor = style.FrameTitleBGColor;
if (style.Frame)
{
if (style.Frame.XBottomOffset) this.Frame.XBottomOffset = style.Frame.XBottomOffset;
if (style.Frame.YTopOffset) this.Frame.YTopOffset = style.Frame.YTopOffset;
}
if (style.FrameLatestPrice)
{
if (style.FrameLatestPrice.TextColor) this.FrameLatestPrice.TextColor = style.FrameLatestPrice.TextColor;
if (style.FrameLatestPrice.UpBarColor) this.FrameLatestPrice.UpBarColor = style.FrameLatestPrice.UpBarColor;
if (style.FrameLatestPrice.DownBarColor) this.FrameLatestPrice.DownBarColor = style.FrameLatestPrice.DownBarColor;
if (style.FrameLatestPrice.UnchagneBarColor) this.FrameLatestPrice.UnchagneBarColor = style.FrameLatestPrice.UnchagneBarColor;
if (style.FrameLatestPrice.BGAlpha) this.FrameLatestPrice.BGAlpha = style.FrameLatestPrice.BGAlpha;
}
if (style.CorssCursorBGColor) this.CorssCursorBGColor = style.CorssCursorBGColor;
if (style.CorssCursorTextColor) this.CorssCursorTextColor = style.CorssCursorTextColor;
if (style.CorssCursorTextFont) this.CorssCursorTextFont = style.CorssCursorTextFont;
if (style.CorssCursorHPenColor) this.CorssCursorHPenColor = style.CorssCursorHPenColor;
if (style.CorssCursorVPenColor) this.CorssCursorVPenColor = style.CorssCursorVPenColor;
if (style.KLine) this.KLine = style.KLine;
if (style.Index)
{
if (style.Index.LineColor) this.Index.LineColor = style.Index.LineColor;
if (style.Index.NotSupport) this.Index.NotSupport = style.Index.NotSupport;
}
if (style.ColorArray) this.ColorArray = style.ColorArray;
if (style.DrawPicture)
{
this.DrawPicture.LineColor = style.DrawPicture.LineColor;
this.DrawPicture.PointColor = style.DrawPicture.PointColor;
}
if (style.TooltipPaint)
{
if (style.TooltipPaint.BGColor) this.TooltipPaint.BGColor = style.TooltipPaint.BGColor;
if (style.TooltipPaint.BorderColor) this.TooltipPaint.BorderColor = style.TooltipPaint.BorderColor;
if (style.TooltipPaint.TitleColor) this.TooltipPaint.TitleColor = style.TooltipPaint.TitleColor;
if (style.TooltipPaint.TitleFont) this.TooltipPaint.TitleFont = style.TooltipPaint.TitleFont;
}
if (style.Title)
{
if (style.Title.TradeIndexColor) this.Title.TradeIndexColor=style.Title.TradeIndexColor;
if (style.Title.ColorIndexColor) this.Title.ColorIndexColor=style.Title.ColorIndexColor;
if (style.Title.VolColor) this.Title.VolColor=style.Title.VolColor;
if (style.Title.AmountColor) this.Title.AmountColor=style.Title.AmountColor;
if (style.Title.DateTimeColor) this.Title.DateTimeColor=style.Title.DateTimeColor;
if (style.Title.NameColor) this.Title.NameColor=style.Title.NameColor;
if (style.Title.SettingColor) this.Title.SettingColor=style.Title.SettingColor;
if (style.Title.TurnoverRateColor) this.Title.TurnoverRateColor=style.Title.TurnoverRateColor;
if (style.Title.PositionColor) this.Title.PositionColor=style.Title.PositionColor;
}
if (style.DRAWICON)
{
if (style.DRAWICON.Text)
{
var item=style.DRAWICON.Text;
if (IFrameSplitOperator.IsPlusNumber(item.MaxSize)) this.DRAWICON.Text.MaxSize=item.MaxSize;
if (IFrameSplitOperator.IsPlusNumber(item.MinSize)) this.DRAWICON.Text.MinSize=item.MinSize;
if (item.Zoom) this.DRAWICON.Text.Zoom=item.Zoom;
if (item.FontName) this.DRAWICON.Text.FontName=item.FontName;
}
}
if (style.DRAWTEXT)
{
var item=style.DRAWTEXT;
if (IFrameSplitOperator.IsPlusNumber(item.MaxSize)) this.DRAWICON.MaxSize=item.MaxSize;
if (IFrameSplitOperator.IsPlusNumber(item.MinSize)) this.DRAWICON.MinSize=item.MinSize;
if (item.Zoom) this.DRAWICON.Zoom=item.Zoom;
if (item.FontName) this.DRAWICON.FontName=item.FontName;
}
if (style.DRAWNUMBER)
{
var item=style.DRAWNUMBER;
if (this.IsPlusNumber(item.MaxSize)) this.DRAWNUMBER.Text.MaxSize=item.MaxSize;
if (this.IsPlusNumber(item.MinSize)) this.DRAWNUMBER.Text.MinSize=item.MinSize;
if (item.Zoom) this.DRAWNUMBER.Text.Zoom=item.Zoom;
if (item.FontName) this.DRAWNUMBER.Text.FontName=item.FontName;
}
if (style.DRAWABOVE)
{
var item=style.DRAWABOVE;
if (this.IsNumber(item.YOffset)) this.DRAWABOVE.YOffset=item.YOffset;
}
if (style.DepthChart)
{
var item=style.DepthChart;
if (item.BidColor)
{
if (item.BidColor.Line) this.DepthChart.BidColor.Line=item.BidColor.Line;
if (item.BidColor.Area) this.DepthChart.BidColor.Area=item.BidColor.Area;
}
if (item.AskColor)
{
if (item.AskColor.Line) this.DepthChart.AskColor.Line=item.AskColor.Line;
if (item.AskColor.Area) this.DepthChart.AskColor.Area=item.AskColor.Area;
}
if (item.LineWidth) this.DepthChart.LineWidth=item.LineWidth;
}
if (style.DepthCorss)
{
var item=style.DepthCorss;
if (item.BidColor)
{
if (item.BidColor.Line) this.DepthCorss.BidColor.Line=item.BidColor.Line;
}
if (item.AskColor)
{
if (item.AskColor.Line) this.DepthCorss.AskColor.Line=item.AskColor.Line;
}
if (item.LineWidth) this.DepthCorss.LineWidth=item.LineWidth;
if (item.LineDash) this.DepthCorss.LineDash=item.LineDash;
if (item.Tooltip)
{
var tooltip=item.Tooltip;
if (tooltip.BGColor) this.DepthCorss.Tooltip.BGColor=tooltip.BGColor;
if (tooltip.TextColor) this.DepthCorss.Tooltip.TextColor=tooltip.TextColor;
if (tooltip.Font) this.DepthCorss.Tooltip.Font=tooltip.Font;
if (tooltip.LineHeight) this.DepthCorss.Tooltip.LineHeight=tooltip.LineHeight;
var border=tooltip.Border;
if (this.IsNumber(border.Top)) this.DepthCorss.Tooltip.Border.Top=border.Top;
if (this.IsNumber(border.Left)) this.DepthCorss.Tooltip.Border.Left=border.Left;
if (this.IsNumber(border.Bottom)) this.DepthCorss.Tooltip.Border.Bottom=border.Bottom;
if (this.IsNumber(border.Center)) this.DepthCorss.Tooltip.Border.Center=border.Center;
}
}
if (style.CIRCLEDOT)
{
var item=style.CIRCLEDOT;
if (this.IsNumber(item.Radius)) this.CIRCLEDOT.Radius=item.Radius;
}
if (style.POINTDOT)
{
var item=style.POINTDOT;
if (this.IsNumber(item.Radius)) this.POINTDOT.Radius=item.Radius;
}
}
this.IsNumber=function(value)
{
if (value==null) return false;
if (isNaN(value)) return false;
return true;
}
//判断是否是正数
this.IsPlusNumber=function(value)
{
if (value==null) return false;
if (isNaN(value)) return false;
return value>0;
}
}
var g_JSChartResource = new JSChartResource();
var JSCHART_LANGUAGE_ID =
{
LANGUAGE_CHINESE_ID: 0,
LANGUAGE_ENGLISH_ID: 1
};
function JSChartLocalization()
{
this.TextResource = new Map([
//内部tooltip
['Tooltip-Open', { CN: '开:', EN: 'O:' }],
['Tooltip-High', { CN: '高:', EN: 'H:' }],
['Tooltip-Low', { CN: '低:', EN: 'L:' }],
['Tooltip-Close', { CN: '收:', EN: 'C:' }],
['Tooltip-Increase', { CN: '幅:', EN: 'I:' }],
['Tooltip-Vol', { CN: '量:', EN: 'V:' }],
['Tooltip-Amount', { CN: '额:', EN: 'A:' }],
['Tooltip-AvPrice', { CN: '均:', EN: 'AP:' }],
['Tooltip-Price', { CN: '价:', EN: 'P:' }],
['Tooltip-Exchange', { CN: '换:', EN: 'E:' }],
['Tooltip-Position', { CN: '持:', EN: 'P:' }],
//K线动态标题
['KTitle-Open', { CN: '开:', EN: 'O:' }],
['KTitle-High', { CN: '高:', EN: 'H:' }],
['KTitle-Low', { CN: '低:', EN: 'L:' }],
['KTitle-Close', { CN: '收:', EN: 'C:' }],
['KTitle-Increase', { CN: '幅:', EN: 'I:' }],
['KTitle-Vol', { CN: '量:', EN: 'V:' }],
['KTitle-Amount', { CN: '额:', EN: 'A:' }],
['KTitle-Exchange', { CN: '换:', EN: 'E:' }],
['KTitle-Position', { CN: '持:', EN: 'P:' }],
//走势图动态标题
['MTitle-Close', { CN: '价:', EN: 'C:' }],
['MTitle-AvPrice', { CN: '均:', EN: 'AC:' }],
['MTitle-Increase', { CN: '幅:', EN: 'I:' }],
['MTitle-Vol', { CN: '量:', EN: 'V:' }],
['MTitle-Amount', { CN: '额:', EN: 'A:' }],
['MTitle-Position', { CN: '持:', EN: 'P:' }],
//周期
['日线', { CN: '日线', EN: '1D' }],
['周线', { CN: '周线', EN: '1W' }],
['双周', { CN: '双周', EN: "2W" }],
['月线', { CN: '月线', EN: '1M' }],
['年线', { CN: '年线', EN: '1Y' }],
['1分', { CN: '1分', EN: '1Min' }],
['5分', { CN: '5分', EN: '5Min' }],
['15分', { CN: '15分', EN: '15Min' }],
['30分', { CN: '30分', EN: '30Min' }],
['60分', { CN: '60分', EN: '60Min' }],
['季线', { CN: '季线', EN: '1Q' }],
['分笔', { CN: '分笔', EN: 'Tick' }],
['2小时', { CN: '2小时', EN: '2H' }],
['4小时', { CN: '4小时', EN: '4H' }],
//复权
['不复权', { CN: '不复权', EN: 'No Right' }],
['前复权', { CN: '前复权', EN: 'Pro Right' }],
['后复权', { CN: '后复权', EN: 'Post Right' }],
//week
['日', { CN: '日', EN: 'Sun.' }],
['一', { CN: '一', EN: 'Mon.' }],
['二', { CN: '二', EN: 'Tues.' }],
['三', { CN: '三', EN: 'Wed.' }],
['四', { CN: '四', EN: 'Thur.' }],
['五', { CN: '五', EN: 'Fri.' }],
['六', { CN: '六', EN: 'Sat.' }],
['1月', { CN: '1月', EN: 'Jan' }],
['2月', { CN: '2月', EN: 'Feb' }],
['3月', { CN: '3月', EN: 'Mar' }],
['4月', { CN: '4月', EN: 'Apr' }],
['5月', { CN: '5月', EN: 'May' }],
['6月', { CN: '6月', EN: 'Jun' }],
['7月', { CN: '7月', EN: 'Jul' }],
['8月', { CN: '8月', EN: 'Aug' }],
['9月', { CN: '9月', EN: 'Sept' }],
['10月', { CN: '10月', EN: 'Oct' }],
['11月', { CN: '11月', EN: 'Nov' }],
['12月', { CN: '12月', EN: 'Dec' }],
['自定义分钟', { CN: '分', EN: 'Min' }],
['自定义日线', { CN: '日', EN: 'D' }],
['自定义秒', { CN: '秒', EN: 'S' }]
]);
this.GetText = function (key, language)
{
var item = this.TextResource.get(key);
if (!item) return '';
switch (language)
{
case JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID:
return item.CN;
case JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID:
return item.EN;
default:
return item.CN;
}
}
this.SetTextResource = function (key, value)
{
this.TextResource.set(key, value)
}
};
var g_JSChartLocalization = new JSChartLocalization();
//导出统一使用JSCommon命名空间名
module.exports =
{
JSCommonResource:
{
JSChartResource: JSChartResource,
Global_JSChartResource: g_JSChartResource,
Global_JSChartLocalization: g_JSChartLocalization,
JSCHART_LANGUAGE_ID: JSCHART_LANGUAGE_ID,
},
//单个类导出
JSCommonResource_JSChartResource: JSChartResource,
JSCommonResource_Global_JSChartResource: g_JSChartResource,
JSCommonResource_Global_JSChartLocalization: g_JSChartLocalization,
JSCommonResource_JSCHART_LANGUAGE_ID: JSCHART_LANGUAGE_ID
};

342
uni_modules/jones-hqchart2/js_sdk/umychart.style.wechat.js

@ -0,0 +1,342 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
不同风格行情配置文件 (微信小程序版本)
*/
var BLACK_STYLE = //黑色风格
{
BGColor:'rgb(0,0,0)',
TooltipBGColor: "rgb(255, 255, 255)", //背景色
TooltipAlpha: 0.92, //透明度
SelectRectBGColor: "rgba(1,130,212,0.06)", //背景色
// SelectRectAlpha: 0.06; //透明度
UpBarColor: "rgb(238,21,21)",
DownBarColor: "rgb(25,158,0)",
UnchagneBarColor: "rgb(199,199,199)",
Minute: {
VolBarColor: null,
PriceColor: "rgb(25,180,231)",
AvPriceColor: "rgb(255,236,0)",
},
DefaultTextColor: "rgb(101,104,112)",
DefaultTextFont: '14px 微软雅黑',
IndexTitleBGColor:'rgb(211,211,211)',
DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
UpTextColor: "rgb(238,21,21)",
DownTextColor: "rgb(25,158,0)",
UnchagneTextColor: "rgb(101,104,112)",
CloseLineColor: 'rgb(178,34,34)',
Title:
{
TradeIndexColor:'rgb(105,105,105)', //交易指标颜色
ColorIndexColor:'rgb(112,128,144)', //五彩K线颜色
VolColor:"rgb(101,104,112)", //标题成交量
AmountColor:"rgb(101,104,112)", //成交金额
DateTimeColor:"rgb(101,104,112)", //时间,日期
SettingColor:"rgb(101,104,112)", //周期,复权
NameColor:"rgb(101,104,112)" , //股票名称
TurnoverRateColor:'rgb(101,104,112)', //换手率
PositionColor:"rgb(101,104,112)" //持仓
},
FrameBorderPen: "rgba(236,236,236,0.13)", //边框
FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
FrameSplitTextColor: "rgb(101,104,112)", //刻度文字颜色
FrameSplitTextFont: "12px 微软雅黑", //坐标刻度文字字体
FrameTitleBGColor: "rgb(246,251,253)", //标题栏背景色
Frame: { XBottomOffset: 0 }, //X轴文字向下偏移
FrameLatestPrice: {
TextColor: 'rgb(255,255,255)', //最新价格文字颜色
UpBarColor: "rgb(238,21,21)", //上涨
DownBarColor: "rgb(25,158,0)", //下跌
UnchagneBarColor: "rgb(190,190,190)", //平盘
BGAlpha: 0.6
},
CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
CorssCursorTextColor: "rgb(255,255,255)",
CorssCursorTextFont: "12px 微软雅黑",
CorssCursorHPenColor: "rgb(130,130,130)", //十字光标线段颜色
CorssCursorVPenColor: "rgb(130,130,130)", //十字光标线段颜色
KLine:
{
MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
Info: //信息地雷
{
Color: 'rgb(205,149,12)',
TextColor: '#afc0da',
TextBGColor: '#1a283e',
Investor:
{
ApiUrl: '/API/NewsInteract', //互动易
},
Announcement: //公告
{
ApiUrl: '/API/ReportList',
},
Pforecast: //业绩预告
{
ApiUrl: '/API/StockHistoryDay',
},
Research: //调研
{
ApiUrl: '/API/InvestorRelationsList',
},
BlockTrading: //大宗交易
{
ApiUrl: '/API/StockHistoryDay',
},
TradeDetail: //龙虎榜
{
ApiUrl: '/API/StockHistoryDay',
},
Policy: //策略
{
ApiUrl: '/API/StockHistoryDay',
}
}
},
Index: { //指标线段颜色
LineColor: [
"rgb(255,189,09)",
"rgb(22,198,255)",
"rgb(174,35,161)",
"rgb(236,105,65)",
"rgb(68,114,196)",
"rgb(229,0,79)",
"rgb(0,128,255)",
"rgb(252,96,154)",
"rgb(42,230,215)",
"rgb(24,71,178)",
],
NotSupport: { Font: "14px 微软雅黑", TextColor: "rgb(52,52,52)" }
},
ColorArray: //自定义指标默认颜色
[
"rgb(255,174,0)",
"rgb(25,199,255)",
"rgb(175,95,162)",
"rgb(236,105,65)",
"rgb(68,114,196)",
"rgb(229,0,79)",
"rgb(0,128,255)",
"rgb(252,96,154)",
"rgb(42,230,215)",
"rgb(24,71,178)",
],
//画图工具
DrawPicture:
{
LineColor: "rgb(30,144,255)",
PointColor: "rgb(105,105,105)",
},
TooltipPaint: //Tooltip
{
BGColor: 'rgba(20,20,20,0.8)', //背景色
BorderColor: 'rgb(210,210,210)', //边框颜色
TitleColor: 'rgb(210,210,210)', //标题颜色
TitleFont:'13px 微软雅黑' //字体
},
//深度图
DepthChart:
{
BidColor: { Line:"rgb(82,176,123)", Area:"rgba(82,176,123,0.5)"}, //卖
AskColor: { Line:"rgb(207,76,89)", Area:"rgba(207,76,89, 0.5)"}, //买
LineWidth:4
},
DepthCorss:
{
BidColor: { Line:"rgb(82,176,123)" }, //卖
AskColor: { Line:"rgb(207,76,89)" }, //买
LineWidth:2, //线段宽度
LineDash:[3,3],
Tooltip:
{
BGColor:'rgba(54,54,54, 0.8)', TextColor:"rgb(203,215,224)",
Border:{ Top:5, Left:20, Bottom:5, Center: 5},
Font:"14px 微软雅黑",
LineHeight:16 //单行高度
}
}
};
var WHITE_STYLE= //白色风格
{
BGColor:'rgb(255,255,255)',
TooltipBGColor: "rgb(255, 255, 255)", //背景色
TooltipAlpha: 0.92, //透明度
SelectRectBGColor:"rgba(1,130,212,0.06)", //背景色
// this.SelectRectAlpha=0.06; //透明度
UpBarColor: "rgb(238,21,21)",
DownBarColor: "rgb(25,158,0)",
UnchagneBarColor: "rgb(0,0,0)",
Minute:
{
VolBarColor : "rgb(238,127,9)",
PriceColor : "rgb(50,171,205)",
AvPriceColor : "rgb(238,127,9)",
},
DefaultTextColor: "rgb(43,54,69)",
DefaultTextFont: '14px 微软雅黑',
DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
UpTextColor: "rgb(238,21,21)",
DownTextColor: "rgb(25,158,0)",
UnchagneTextColor: "rgb(0,0,0)",
CloseLineColor: 'rgb(178,34,34)',
FrameBorderPen: "rgb(225,236,242)", //边框
FrameSplitPen: "rgb(225,236,242)", //分割线
FrameSplitTextColor: "rgb(51,51,51)", //刻度文字颜色
FrameSplitTextFont: "12px 微软雅黑", //坐标刻度文字字体
FrameTitleBGColor: "rgb(246,251,253)", //标题栏背景色
CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
CorssCursorTextColor: "rgb(255,255,255)",
CorssCursorTextFont: "12px 微软雅黑",
CorssCursorPenColor: "rgb(130,130,130)", //十字光标线段颜色
KLine:
{
MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)' }, //K线最大最小值显示
Info: //信息地雷
{
Color: 'rgb(205,149,12)',
TextColor: '#197de9',
TextBGColor: '#e1e4ef',
Investor:
{
ApiUrl: '/API/NewsInteract', //互动易
},
Announcement: //公告
{
ApiUrl: '/API/ReportList',
},
Pforecast: //业绩预告
{
ApiUrl: '/API/StockHistoryDay',
},
Research: //调研
{
ApiUrl: '/API/InvestorRelationsList',
},
BlockTrading: //大宗交易
{
ApiUrl: '/API/StockHistoryDay',
},
TradeDetail: //龙虎榜
{
ApiUrl: '/API/StockHistoryDay',
},
Policy: //策略
{
ApiUrl: '/API/StockHistoryDay',
}
}
},
Index:
{ //指标线段颜色
LineColor:
[
"rgb(255,189,09)",
"rgb(22,198,255)",
"rgb(174,35,161)",
"rgb(236,105,65)",
"rgb(68,114,196)",
"rgb(229,0,79)",
"rgb(0,128,255)",
"rgb(252,96,154)",
"rgb(42,230,215)",
"rgb(24,71,178)",
],
NotSupport: { Font: "14px 微软雅黑", TextColor: "rgb(52,52,52)" }
},
ColorArray: //自定义指标默认颜色
[
"rgb(255,174,0)",
"rgb(25,199,255)",
"rgb(175,95,162)",
"rgb(236,105,65)",
"rgb(68,114,196)",
"rgb(229,0,79)",
"rgb(0,128,255)",
"rgb(252,96,154)",
"rgb(42,230,215)",
"rgb(24,71,178)",
],
//画图工具
DrawPicture:
{
LineColor: "rgb(30,144,255)",
PointColor: "rgb(105,105,105)",
},
}
var STYLE_TYPE_ID=
{
BLACK_ID:1, //黑色风格
WHITE_ID:2 //白色风格
}
function GetStyleConfig(styleid) //获取一个风格的配置变量
{
switch (styleid)
{
case STYLE_TYPE_ID.BLACK_ID:
return BLACK_STYLE;
break;
case STYLE_TYPE_ID.WHITE_ID:
return WHITE_STYLE;
break;
default:
return null;
}
}
module.exports =
{
JSCommonHQStyle:
{
GetStyleConfig:GetStyleConfig,
STYLE_TYPE_ID:STYLE_TYPE_ID
}
};

71
uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.canvas.helper.js

@ -0,0 +1,71 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
uniapp canvas 兼容方法
*/
function JSUniAppCanvasHelper() { }
JSUniAppCanvasHelper.MeasureText=function(text, canvas)
{
var font = canvas.font;
var fontSize = 12;
var pos=font.search('px');
if (pos>0)
{
var strSize = font.substring(0,pos);
fontSize = parseInt(strSize);
}
text = String(text);
var text = text.split('');
var width = 0;
for (let i = 0; i < text.length; i++)
{
let item = text[i];
if (/[a-zA-Z]/.test(item))
{
width += 7;
} else if (/[0-9]/.test(item))
{
width += 5.5;
} else if (/\./.test(item))
{
width += 2.7;
} else if (/-/.test(item))
{
width += 3.25;
} else if (/[\u4e00-\u9fa5]/.test(item))
{
width += 10;
} else if (/\(|\)/.test(item))
{
width += 3.73;
} else if (/\s/.test(item))
{
width += 2.5;
} else if (/%/.test(item))
{
width += 8;
} else
{
width += 10;
}
}
return width * fontSize / 10;
}
//导出统一使用JSCommon命名空间名
module.exports =
{
JSCommonUniApp:
{
JSUniAppCanvasHelper: JSUniAppCanvasHelper,
}
};

84908
uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.h5.js

File diff suppressed because one or more lines are too long

14245
uni_modules/jones-hqchart2/js_sdk/umychart.wechat.3.0.js

File diff suppressed because it is too large

40
uni_modules/jones-hqchart2/js_sdk/用户协议.txt

@ -0,0 +1,40 @@
HQChart用户协议
用户应当充分阅读本协议,用户使用HQChart插件亦视为接受本协议。
一、定义
HQChart:由本人开发的专业的K线图展示及数据计算引擎插件。
用户: 以任何形式使用HQChart插件的自然人、法人或其他组织。
二、用户保证
1. 用户同意并保证,合法并如约使用HQChart插件。用户对其行为产生的任何法律责任自行独立承担,与HQChart插件作者无关。
三、用户的权利与义务
1. 用户有权通过修改HQChart源码进行2次开发,无需经得HQChart插件作者授权.
2. 用户在使用HQChart插件期间,承诺并保证:
(1) 遵守所有中华人民共和国法律法规和国际上有关互联网和短信的协议、规定、程序和惯例.
(2) 不利用HQChart插件进行金融诈骗.
(3) 不行使其他可能给HQChart插件带来任何不利影响的行为或者法律及政策禁止的行为。
3. 用户不得利用HQChart插件发送以下内容的短信:
(1)接受方事先没有提出要求或者同意接受的广告等宣传性或营销性内容;
(2)含有病毒、恶意代码、色情、反动等不良信息或有害信息
(3)地产、医疗、教育、留学、移民等相关内容
(4)冒充任何人或机构,或以虚伪不实的方式谎称或使人误认为与任何人或任何机构有关。
(5)侵犯他人著作权或其他知识产权,或违反保密、雇佣或不披露协议披露他人商业秘密或保密信息。
4. 用户应当按照本协议,妥善使用HQChart插件并为其行为负责。因用户行为导致HQChart插件作者遭受诉讼、索赔及/或处罚的,用户应赔偿HQChart插件作者因此造成的全部损失。
四、HQChart作者的权利与义务
1. HQChart作者对用户行为无审核监督义务。因用户行为给HQChart作者造成的一切损失,HQChart作者有权向用户追偿。
2. HQChart插件对其提供给用户的质量做出如下承诺
1). 源码全部开源
2). 在作者技术能力范围以内,提供免费或有偿的技术支持服务
3.HQChart作者有权对HQChart插件进行定期或不定期的升级或完善,用户可以选择升级新版本或不升级使用原有版本。如用户因此受到影响,HQChart作者无需为此承担任何责任。
4. HQChart插件作者有权根据自己的判断对用户是否违反本协议约定。用户若有违反的,HQChart插件作者有权随时中止或终止本协议。HQChart作者无需就此征得用户同意或提前通知用户
5. 鉴于互联网服务的特殊性,对因不可抗力、第三方服务、黑客攻击、政策影响及其他任何非. HQChart插件作者原因引起的技术支持中断等,HQChart插件作者均无需承担任何责任。
五、 免责声明
1. 用户明确同意其使用HQChart插件所存在的风险及其后果将完全由其自己承担,HQChart插件作者对用户不承担任何责任。如因用户违反有关法律、法规或本协议项下的任何条款而给HQChart插件作者或任何其他第三人造成损失,用户同意承担由此造成的损害赔偿责任。
六、其他
1. 本协议的版权归HQChart插件作者,HQChart插件作者保留对本协议的一切解释和修改权利。
2. 本协议的订立、执行和争议的解决均应适用中华人民共和国法律。如双方就本协议内容或其执行发生任何争议,双方应尽量友好协商解决;协商不成时,任何一方均可向HQChart插件作者所在地有管辖权的人民法院提起诉讼。
3. HQChart插件作者行使本协议的任何权利或规定,不构成对前述权利之放弃。
4. 如本协议中的任何条款完全或部分无效,本协议的其余条款仍有效并且有约束力

80
uni_modules/jones-hqchart2/package.json

@ -0,0 +1,80 @@
{
"id": "jones-hqchart2",
"displayName": "jones-hqchart2",
"version": "1.1.10333",
"description": "HQChart - H5, 微信小程序 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据替换接口",
"keywords": [
"jones-hqchart2"
],
"repository": "https://github.com/jones2000/HQChart",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/hqchart"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

285
uni_modules/jones-hqchart2/readme.md

@ -0,0 +1,285 @@
# jones-hqchart2
# 介绍
> HQChart
H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据替换接口
# 开源
- 源码地址:[https://github.com/jones2000/HQChart](https://github.com/jones2000/HQChart)
- 镜像地址:[https://gitee.com/jones2000/HQChart](https://gitee.com/jones2000/HQChart)
# 用户协议
- [用户协议](https://gitee.com/jones2000/HQChart/blob/master/%E7%94%A8%E6%88%B7%E5%8D%8F%E8%AE%AE.txt)
# demo说明
* hqchart2_test3 内置组件模式
* hqchart2_test 单画布模式
* hqchart2_test2 多画布模式
* hqchart2_template 如何在外部封装hqchart模板
* hqchart2_renderjs 使用renderjs创建hqchart, 直接使用npm hqchart
# app demo apk下载
- [股票数据对接 app demo下载](https://opensource2.zealink.com/uniapp_demoapk/hqchart_shsz_uniapp_20210301.apk)
- [火币安卓app demo下载](https://opensource2.zealink.com/uniapp_demoapk/hqchart_huobi_uniapp.20210301.apk)
- [A股真实数据(新浪+腾讯行情源)app demo下载](https://opensource2.zealink.com/uniapp_demoapk/hqchart_astock_demo.20210505.01.apk)
> 功能:
# 1. K线图
- 支持前复权,后复权
- 支持日线,月线,周线,年线.分钟线
- 主图支持股票叠加
- K线形状支持 空心K线,实心K线,美国线,收盘价线
- 支持常用指标指标(目前以录入系统指标80多个),支持自定义通达信语法脚本指标( 均线,BOLL,MACD,KDJ,VOL,RSI,BRAR,WR,BIAS,OBV,DMI,CR,PSY,CCI, DMA,TRIX,VR,EMV,ROC,MIM,FSL,CYR,MASS,WAD,CHO ..... )
- 支持画图工具(小程序不支持)
- 线段,射线,矩形,圆弧线,水平线,趋势线,平行线,平行通道,价格通道线,文本,江恩角度线,阻速线,黄金分割,百分比线,波段线,三角形,对称角度,斐波那契周期线,平行四边形,圆, iconfont图片
- 支持区间统计, 区间形态匹配 (微信小程序版本不支持)
- 数据鼠标左右拖拽移动, 键盘移动十字光标移动,键盘缩放
- 支持通达信语法指标
- 支持五彩K线(目前录入系统五彩K线30多个), 支持自定义通达信语法脚本的五彩K线
- 支持专家系统指标
- 支持个股筹码图
# 2. 走势图
- 支持指标
- 支持股票叠加
- 支持沪深和港股,国内期货(开发中)
- 分钟数据显示
- 支持多日分钟数据显示
-
# 3. 网页demo
* [K线图](https://opensource2.zealink.com/hqweb/demo/phone7.html)
* [走势图](https://opensource2.zealink.com/hqweb/demo/phone8.html)
* [走势图手机页面](https://opensource2.zealink.com/hqweb/demo/phone2.html)
* [K线图手机页面](https://opensource2.zealink.com/hqweb/demo/phone.html)
* [横版走势图手机页面](https://opensource2.zealink.com/hqweb/demo/phone10.html)
* [横版K线图手机页面](https://opensource2.zealink.com/hqweb/demo/phone9.html)
* [多日走势图](https://opensource2.zealink.com/hqweb/demo/phone15.html)
* [个股筹码图](https://opensource2.zealink.com/hqweb/demo/phone18.html)
* [指标回测(手机版)](https://opensource2.zealink.com/hqweb/operatebsh5/index.html?symbol=000001.sz)
* [手机K线训练](https://opensource2.zealink.com/hqweb/demo/demo_ktrain.html)
* [手机K线训练横屏](https://opensource2.zealink.com/hqweb/demo/demo_ktrain2.html)
* [弹幕功能](https://opensource2.zealink.com/hqweb/demo/phone21.html)
* [多指标叠加](https://opensource2.zealink.com/hqweb/demo/phone22.html)
* [截面数据(财务数据)计算器](https://opensource2.zealink.com/hqweb/demo/sectiondatatest.html)
* [走势图-大盘异动](https://opensource2.zealink.com/hqweb/demo/phone23.html)
* [分笔K线图](https://opensource2.zealink.com/hqweb/demo/phone24.html)
# 4.使用教程
## H5教程
1. [HQChart使用教程1-如何快速创建一个K线图页面](https://blog.csdn.net/jones2000/article/details/90272733)
2. [HQChart使用教程2-如何把自定义指标显示在K线图页面](https://blog.csdn.net/jones2000/article/details/90273684)
3. [HQChart使用教程3-如何把指标上锁显示在K线图页面](https://blog.csdn.net/jones2000/article/details/90285723)
4. [HQChart使用教程4-如何自定义K线图颜色风格](https://blog.csdn.net/jones2000/article/details/90286933)
5. [HQChart使用教程5-K线图控件操作函数说明](https://blog.csdn.net/jones2000/article/details/90301000)
6. [HQChart使用教程6-如何获取K线图上的指标数据进行回测](https://blog.csdn.net/jones2000/article/details/90314625)
7. [HQChart使用教程7-如何快速创建一个分时图页面](https://blog.csdn.net/jones2000/article/details/90319619)
8. [HQChart使用教程9-如何快速创建K线训练页面](https://blog.csdn.net/jones2000/article/details/90478687)
9. [HQChart使用教程10-手机端页面设置的几个特殊属性](https://blog.csdn.net/jones2000/article/details/90727468)
10. [HQChart使用教程11-如何把K线数据API替换成自己的API数据](https://blog.csdn.net/jones2000/article/details/90747715)
11. [HQChart使用教程8-如何快速创建一个横屏分时图页面](https://blog.csdn.net/jones2000/article/details/90453776)
12. [HQChart使用教程14-分析家语法执行器](https://blog.csdn.net/jones2000/article/details/93731637)
13. [HQChart使用教程13-5分钟完成一个小程序K线图](https://blog.csdn.net/jones2000/article/details/91471252)
14. [HQChart使用教程12-如何在K线图上添加弹幕](https://blog.csdn.net/jones2000/article/details/91125408)
15. [HQChart使用教程15-分析家语法执行器python版本](https://blog.csdn.net/jones2000/article/details/94738592)
16. [HQChart使用教程16-py中使用麦语言指标可视化](https://blog.csdn.net/jones2000/article/details/94920596)
17. [HQChart使用教程17-多技术指标独立坐标叠加](https://blog.csdn.net/jones2000/article/details/95618901)
18. [HQChart使用教程18-K线截图](https://blog.csdn.net/jones2000/article/details/95738306)
19. [HQChart使用教程19-基于HQChart的后台单股票指标计算服务](https://blog.csdn.net/jones2000/article/details/96479448)
20. [HQChart使用教程20-单股票截面数据(财务数据)计算器](https://blog.csdn.net/jones2000/article/details/97135592)
21. [HQChart使用教程21-十字光标设置说明](https://blog.csdn.net/jones2000/article/details/97682466)
22. [HQChart使用教程22-如何创建移动筹码图](https://blog.csdn.net/jones2000/article/details/97928892)
23. [HQChart使用教程23-Y轴刻度显示设置](https://blog.csdn.net/jones2000/article/details/98320020)
24. [HQChart使用教程24-多语言设置](https://blog.csdn.net/jones2000/article/details/98734091)
25. [HQChart使用教程25-叠加多个品种设置](https://blog.csdn.net/jones2000/article/details/98878463)
26. [HQChart使用教程26-K线图及走势图数据自动更新设置](https://blog.csdn.net/jones2000/article/details/99483328)
27. [HQChart使用教程27-动态设置K线图指标模板](https://blog.csdn.net/jones2000/article/details/100079989)
28. [HQChart使用教程28-如何创建系统指标](https://blog.csdn.net/jones2000/article/details/100103486)
29. [HQChart使用教程31-走势图异动数据设置](https://blog.csdn.net/jones2000/article/details/100191957)
30. [HQChart使用教程32-如何K线图显示自定义SVG矢量图标](https://blog.csdn.net/jones2000/article/details/100613634)
33. [HQChart使用教程39-指标中如何绘制文本分割线](https://blog.csdn.net/jones2000/article/details/101487482)
34. [HQChart使用教程40-如何自定义分钟周期或日线周期K线](https://blog.csdn.net/jones2000/article/details/101722958)
35. [HQChart使用教程41-分钟K线设置拖拽自动下载历史数据](https://blog.csdn.net/jones2000/article/details/102471720)
36. [HQChart使用教程42-K线图如何对接数字货币](https://blog.csdn.net/jones2000/article/details/102493905)
37. [HQChart使用教程43-日K线设置拖拽自动下载历史数据](https://blog.csdn.net/jones2000/article/details/102511317)
38. [HQChart使用教程45-如何动态修改指标参数](https://blog.csdn.net/jones2000/article/details/102594672)
39. [HQChart使用教程46-分钟周期数据计算外部接口](https://blog.csdn.net/jones2000/article/details/102628045)
40. [HQChart使用教程47-如何自定义右键菜单](https://blog.csdn.net/jones2000/article/details/102720671)
41. [HQChart使用教程48-如何自定义X轴刻度](https://blog.csdn.net/jones2000/article/details/102741428)
42. [HQChart使用教程49-指标配置项说明](https://blog.csdn.net/jones2000/article/details/102928907)
43. [HQChart使用教程50-Y轴自定义刻度设置说明](https://blog.csdn.net/jones2000/article/details/103174483)
44. [HQChart使用教程51-指标切换按钮事件说明-h5版本](https://blog.csdn.net/jones2000/article/details/103187576)
45. [HQChart使用教程52-自定义手机端K线图Tooltip](https://blog.csdn.net/jones2000/article/details/103820718)
46. [HQChart使用教程53-log日志输出控制](https://blog.csdn.net/jones2000/article/details/104122774)
47. [HQChart使用教程54-K线缩放控制按钮接口说明](https://blog.csdn.net/jones2000/article/details/104346016)
48. [HQChart使用教程55-自定义PC端K线图Tooltip](https://blog.csdn.net/jones2000/article/details/104443471)
49. [HQChart使用教程56-内置品种对应后缀列表说明](https://blog.csdn.net/jones2000/article/details/104457569)
50. [HQChart使用教程57-如何调整K线的柱子缩放大小](https://blog.csdn.net/jones2000/article/details/104817724)
51. [HQChart使用教程58-如何在K线右侧绘制面积图(如深度图)](https://blog.csdn.net/jones2000/article/details/105026997)
52. [HQChart使用教程59-跨周期跨股票函数STKINDI使用说明](https://blog.csdn.net/jones2000/article/details/105401909)
53. [HQChart使用教程60-新版k线训练使用教程](https://blog.csdn.net/jones2000/article/details/105760924)
54. [HQChart使用教程61-画图工具接口使用教程](https://blog.csdn.net/jones2000/article/details/105835428)
55. [HQChart使用教程62-品种小数位数设置](https://blog.csdn.net/jones2000/article/details/106592730)
56. [HQChart使用教程64-前端自定义周期算法接口](https://blog.csdn.net/jones2000/article/details/107633707)
57. [HQChart使用教程65-设置指标输出动态变量名](https://blog.csdn.net/jones2000/article/details/108675254)
58. [HQChart使用教程66-自定义数据下载文字提示效果](https://blog.csdn.net/jones2000/article/details/109007027)
59. [HQChart使用教程67-鼠标点击K线柱子监听事件](https://blog.csdn.net/jones2000/article/details/109119390)
60. [HQChart使用教程68-配置DRAWTEXT,DRAWICON,DRAWNUMBER字体大小](https://blog.csdn.net/jones2000/article/details/109244069)
61. [HQChart使用教程69-获取指定股票的K线数据](https://blog.csdn.net/jones2000/article/details/111736960)
62. [HQChart使用教程70-通达信指标翻译](https://blog.csdn.net/jones2000/article/details/112998609)
63. [HQChart使用教程71-如何自定义Y轴刻度线](https://blog.csdn.net/jones2000/article/details/113666565)
64. [HQChart使用教程72-画图工具波浪尺刻度配置](https://blog.csdn.net/jones2000/article/details/113923817)
65. [HQChart使用教程73-使用Vue3.0创建HQChart图形](https://blog.csdn.net/jones2000/article/details/114954091)
66. [HQChart使用教程74-使用快速创建数字币深度图](https://blog.csdn.net/jones2000/article/details/115322752)
67. [HQChart使用教程75-K线图鼠标单击事件接口](https://blog.csdn.net/jones2000/article/details/115707759)
68. [HQChart使用教程76-K线图手势事件接口](https://blog.csdn.net/jones2000/article/details/115862159)
69. [HQChart使用教程77-Y轴刻度文字创建事件回调](https://blog.csdn.net/jones2000/article/details/116376898)<br>
70. [HQChart使用教程78-分时图集合竞价](https://blog.csdn.net/jones2000/article/details/116523681)<br>
71. [HQChart使用教程79-异常处理接口](https://blog.csdn.net/jones2000/article/details/117524401)<br>
72. [HQChart使用教程80-自定义指标标题信息](https://blog.csdn.net/jones2000/article/details/117803420)<br>
73. [HQChart使用教程81-自定义指标窗口高度](https://jones2000.blog.csdn.net/article/details/118652171)<br>
74. [HQChart使用教程82-动态修改叠加指标参数](https://jones2000.blog.csdn.net/article/details/118681399)<br>
75. [HQChart使用教程83-K线图最高最低价显示配置](https://jones2000.blog.csdn.net/article/details/118856130)<br>
## 小程序教程
1. [HQChart小程序教程1-如何快速的创建一个K线图](https://developers.weixin.qq.com/community/develop/article/doc/0006c451ac81589915b89d1c55bc13)
2. [HQChart小程序教程2-如何使用新版2D画布创建一个K线图](https://blog.csdn.net/jones2000/article/details/105632095)
3. [HQChart小程序教程3-新版2D单画布如何切换K线图和分时图](https://blog.csdn.net/jones2000/article/details/108378355)
## uni-app教程
1. [HQChart使用教程35-如何在uni-app创建K线图(h5)](https://blog.csdn.net/jones2000/article/details/101039026)
2. [HQChart使用教程36-如何在uni-app创建走势图(h5)](https://blog.csdn.net/jones2000/article/details/101039673)
3. [HQChart使用教程37-如何在uni-app创建k线图(app)](https://blog.csdn.net/jones2000/article/details/101075683)
4. [HQChart使用教程38-如何在uni-app创建走势图(app)](https://blog.csdn.net/jones2000/article/details/101481960)
5. [HQChart使用教程44-uniapp使用条件编译同时支持h5,app,小程序](https://blog.csdn.net/jones2000/article/details/102529190)
6. [HQChart使用教程60-解决uniapp-app页面隐藏后在显示白屏的问题](https://blog.csdn.net/jones2000/article/details/105484202)
7. [HQChart使用教程63-uniapp使用renderjs+hqchart(h5)](https://blog.csdn.net/jones2000/article/details/106933985)
8. [HQChart实战教程40-如何制作hqchart组件(uniapp版本)](https://blog.csdn.net/jones2000/article/details/116034602)
## 第3方数据前端接入教程(走势图)
1. [HQChart使用教程29-走势图如何对接第3方数据1](https://blog.csdn.net/jones2000/article/details/100132357)
2. [HQChart使用教程29-走势图如何对接第3方数据2-最新分时数据](https://blog.csdn.net/jones2000/article/details/100149703)
3. [HQChart使用教程29-走势图如何对接第3方数据3-多日分时数据](https://blog.csdn.net/jones2000/article/details/100150842)
4. [HQChart使用教程29-走势图如何对接第3方数据4-叠加股票分时数据](https://blog.csdn.net/jones2000/article/details/100167703)
5. [HQChart使用教程29-走势图如何对接第3方数据4-异动提示信息](https://blog.csdn.net/jones2000/article/details/100516071)
6. [HQChart使用教程29-走势图如何对接第3方数据5-指标数据](https://blog.csdn.net/jones2000/article/details/102426337)
7. [HQChart使用教程29-走势图如何对接第3方数据6-websocket分钟数据](https://blog.csdn.net/jones2000/article/details/102568258)
8. [HQChart使用教程29-走势图如何对接第3方数据7-叠加股票最新分时数据](https://blog.csdn.net/jones2000/article/details/110525351)
## 第3方数据前端接入教程(K线图)
1. [HQChart使用教程30-K线图如何对接第3方数据1](https://blog.csdn.net/jones2000/article/details/100181279)
2. [HQChart使用教程30-K线图如何对接第3方数据2-日K数据](https://blog.csdn.net/jones2000/article/details/100552022)
3. [HQChart使用教程30-K线图如何对接第3方数据3-1分钟K数据](https://blog.csdn.net/jones2000/article/details/100557649)
4. [HQChart使用教程30-K线图如何对接第3方数据4-流通股本数据](https://blog.csdn.net/jones2000/article/details/100574186)
5. [HQChart使用教程30-K线图如何对接第3方数据5-指标数据](https://blog.csdn.net/jones2000/article/details/100579223)
6. [HQChart使用教程30-K线图如何对接第3方数据6-分笔K线数据](https://blog.csdn.net/jones2000/article/details/100671849)
7. [HQChart使用教程30-K线图如何对接第3方数据7-日K数据分页下载](https://blog.csdn.net/jones2000/article/details/101275824)
8. [HQChart使用教程30-K线图如何对接第3方数据8-1分钟K线数据分页下载](https://blog.csdn.net/jones2000/article/details/101277092)
9. [HQChart使用教程30-K线图如何对接第3方数据9-BS指标数据](https://blog.csdn.net/jones2000/article/details/101350429)
10. [HQChart使用教程30-K线图如何对接第3方数据10-如何绘制自定义线段或多边行指标数据](https://blog.csdn.net/jones2000/article/details/101694618)
11. [HQChart使用教程30-K线图如何对接第3方数据11-如何绘制多组自定义图标](https://blog.csdn.net/jones2000/article/details/101757384)
12. [HQChart使用教程30-K线图如何对接第3方数据12-如何在指标中绘制文字](https://blog.csdn.net/jones2000/article/details/101864046)
13. [HQChart使用教程30-K线图如何对接第3方数据13-使用websocket更新最新K线数据](https://blog.csdn.net/jones2000/article/details/102138784)
14. [HQChart使用教程30-K线图如何对接第3方数据14-轮询增量更新日K数据](https://blog.csdn.net/jones2000/article/details/102518334)
15. [HQChart使用教程30-K线图如何对接第3方数据15-轮询增量更新1分钟K线数据](https://blog.csdn.net/jones2000/article/details/102518422)
16. [HQChart使用教程30-K线图如何对接第3方数据16-日K叠加股票](https://blog.csdn.net/jones2000/article/details/102661873)
17. [HQChart使用教程30-K线图如何对接第3方数据17-分钟K叠加股票](https://blog.csdn.net/jones2000/article/details/102887690)
18. [HQChart使用教程30-K线图如何对接第3方数据18-如何绘制自定义柱子](https://blog.csdn.net/jones2000/article/details/104417736)
19. [HQChart使用教程30-K线图如何对接第3方数据19-如何绘制彩色K线柱](https://blog.csdn.net/jones2000/article/details/104859784)
20. [HQChart使用教程30-K线图如何对接第3方数据20-信息地雷公告数据](https://blog.csdn.net/jones2000/article/details/105876161)
21. [HQChart使用教程30-K线图如何对接第3方数据21-跨周期函数数据](https://blog.csdn.net/jones2000/article/details/109063625)
22. [HQChart使用教程30-K线图如何对接第3方数据22-FINVALUE函数数据](https://blog.csdn.net/jones2000/article/details/111387095)
23. [HQChart使用教程30-K线图如何对接第3方数据23-FINANCE函数数据](https://blog.csdn.net/jones2000/article/details/111999910)
24. [HQChart使用教程30-K线图如何对接第3方数据24-如何填充K线背景色](https://blog.csdn.net/jones2000/article/details/112342980)
25. [HQChart使用教程30-K线图如何对接第3方数据25-指标脚本自定义变量](https://blog.csdn.net/jones2000/article/details/112755911)
26. [HQChart使用教程30-K线图如何对接第3方数据26-指标脚本自定义函数](https://blog.csdn.net/jones2000/article/details/112809781)
27. [HQChart使用教程30-K线图如何对接第3方数据27-如何在指标中渲染DOM元素](https://blog.csdn.net/jones2000/article/details/114006164)
28. [HQChart使用教程30-K线图如何对接第3方数据28-大盘数据](https://blog.csdn.net/jones2000/article/details/117712105)
29. [HQChart使用教程30-K线图如何对接第3方数据29-板块字符串函数数据](https://jones2000.blog.csdn.net/article/details/118887416)
## 实战教程
1. [HQChart实战教程1-外汇分时图](https://blog.csdn.net/jones2000/article/details/103254501)
2. [HQChart实战教程2-使用跨周期写指标](https://blog.csdn.net/jones2000/article/details/103275668)
3. [HQChart实战教程3-http+ws对接分钟K线数据](https://blog.csdn.net/jones2000/article/details/103882063)
4. [HQChart实战教程4-http+ws对接日K线数据](https://blog.csdn.net/jones2000/article/details/103966271)
5. [HQChart实战教程5-http+ws对接单日分时图数据](https://blog.csdn.net/jones2000/article/details/103966925)
6. [HQChart实战教程6-自定义分时图](https://blog.csdn.net/jones2000/article/details/104165374)
7. [HQChart实战教程7-自定义显示手势点击K线显示信息](https://blog.csdn.net/jones2000/article/details/104168610)
8. [HQChart实战教程8-如何手动重新初始化hqchart](https://blog.csdn.net/jones2000/article/details/105302626)
9. [HQChart实战教程9-自定义A股分时图](https://blog.csdn.net/jones2000/article/details/105587559)
10. [HQChart实战教程14-K线图对接第3方http/https数据教程整理](https://blog.csdn.net/jones2000/article/details/106064879)
11. [HQChart实战教程17-K线沙盘推演](https://blog.csdn.net/jones2000/article/details/106776837)
12. [HQChart实战教程18-多股同列](https://blog.csdn.net/jones2000/article/details/107193410)
## 火币对接完整教程(付费文章)
1. [HQChart实战教程10-全ws数据对接HQChart(数字货币对接实战)](https://blog.csdn.net/jones2000/article/details/105698038)
2. [HQChart实战教程11-火币网ws数据对接](https://blog.csdn.net/jones2000/article/details/105721190)
3. [HQChart实战教程12-火币网ws数据对接分时图](https://blog.csdn.net/jones2000/article/details/105756659)
4. [HQChart实战教程13-火币网ws数据对接K线(uniapp)](https://blog.csdn.net/jones2000/article/details/105804461)
5. [HQChart实战教程15-火币网ws数据对接拖拽下载历史K线图](https://blog.csdn.net/jones2000/article/details/106205584)
6. [HQChart实战教程16-K线图风格配色篇-仿火币网H5配色](https://blog.csdn.net/jones2000/article/details/106226272)
## 币安对接(源码收费)
1. [HQChart实战教程36-数字货币安币对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/114468807)
2. [HQChart实战教程41-新浪+腾讯A股数据源对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/117139756)
## httpA股数据对接教程(付费文章)
### 日K线
1. [HQChart实战教程29-A股日K线数据对接-Vue版本](https://blog.csdn.net/jones2000/article/details/113099783)
2. [HQChart实战教程30-A股日K线数据对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/113101342)
3. [HQChart实战教程34-A股日K线数据对接-小程序版本](https://blog.csdn.net/jones2000/article/details/113577904)
### 分钟K线
1. [HQChart实战教程31-A股分钟K线数据对接-Vue版本](https://blog.csdn.net/jones2000/article/details/113101407)
2. [HQChart实战教程32-A股分钟K线数据对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/113101448)
### 分时图
1. [HQChart实战教程33-A股分时图数据对接-Vue版本](https://blog.csdn.net/jones2000/article/details/113226866)
2. [HQChart实战教程35-A股分时图数据对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/113777111)
### 后台指标
1. [HQChart实战教程36-A股后台指标对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/114991081)
### 新浪接口对接
1. [HQChart实战教程37-新浪分钟K线数据对接-js版本](https://blog.csdn.net/jones2000/article/details/115388377)
2. [HQChart实战教程38-新浪期货数据对接-js版本](https://blog.csdn.net/jones2000/article/details/115408971)
## 高级应用实战教程(付费文章)
1. [HQChart实战教程19 - PC端分时图定制tooltip](https://blog.csdn.net/jones2000/article/details/108633991)
2. [HQChart实战教程20 - PC端K线图定制tooltip](https://blog.csdn.net/jones2000/article/details/108639960)
3. [HQChart实战教程21 - unapp app端分时图定制tooltip](https://blog.csdn.net/jones2000/article/details/108657043)
4. [HQChart实战教程21 - uniapp app端K线图定制tooltip](https://blog.csdn.net/jones2000/article/details/108674679)
5. [HQChart实战教程22 - PC端定制区间选择菜单](https://blog.csdn.net/jones2000/article/details/108907629)
6. [HQChart实战教程23 - 点击K线显示历史分钟走势图](https://blog.csdn.net/jones2000/article/details/109127873)
7. [HQChart实战教程24 - 自定义K线画图工具设置框(线段类)](https://blog.csdn.net/jones2000/article/details/109217719)
8. [HQChart实战教程25 - 自定义K线画图工具设置框(文字类)](https://blog.csdn.net/jones2000/article/details/109267078)
9. [HQChart实战教程30 - 配置K线画图](https://blog.csdn.net/jones2000/article/details/113819121)
10. [HQChart实战教程26 - K线画图工具增加自定义图标](https://blog.csdn.net/jones2000/article/details/109529224)
11. [HQChart实战教程27 - 走势图最后一个数据增加动画点](https://blog.csdn.net/jones2000/article/details/111599341)
12. [HQChart实战教程28 - 动态切换颜色风格](https://blog.csdn.net/jones2000/article/details/112563596)
13. [HQChart实战教程29 - 指标参数保存到本地缓存](https://blog.csdn.net/jones2000/article/details/113349967)
14. [HQChart实战教程39 - K线图键盘事件重载](https://blog.csdn.net/jones2000/article/details/115921430)
## 设计文档:
1. [如何(c++,js)写一个传统的K线图和走势图1](https://blog.csdn.net/jones2000/article/details/84779481) <br>
2. [如何(c++,js)写一个传统的K线图和走势图2-走势图](https://blog.csdn.net/jones2000/article/details/84840770) <br>
3. [如何(c++,js)写一个传统的K线图和走势图3-多指标窗口模式如何实现的](https://blog.csdn.net/jones2000/article/details/84979910) <br>
4. [如何(c++,js)写一个传统的K线图和走势图3-十字光标的绘制](https://blog.csdn.net/jones2000/article/details/85123680) <br>
5. [如何(c++,js)写一个传统的K线图和走势图4-K线图](https://blog.csdn.net/jones2000/article/details/85235463) <br>
6. [如何(c++,js)写一个传统的K线图和走势图5-移动筹码图](https://blog.csdn.net/jones2000/article/details/85356163) <br>
## HQChartPy2介绍(py版本指标引擎)
1. [HQChart(C++)指标计算引擎-介绍](https://blog.csdn.net/jones2000/article/details/107464517) <br>
2. [HQChart(C++)指标计算引擎-安装](https://blog.csdn.net/jones2000/article/details/107712259) <br>
3. [HQChart(C++)指标计算引擎-py接口类FastHQChart介绍](https://blog.csdn.net/jones2000/article/details/107725170) <br>
4. [HQChart(C++)指标计算引擎-py接口类IHQData K线数据对接](https://blog.csdn.net/jones2000/article/details/107728903) <br>
## HQChartPy2数据对接教程 (以tushare数据为例子)
1. [hqchartPy2数据对接教程1-K线数据](https://blog.csdn.net/jones2000/article/details/112060412)<br>
2. [hqchartPy2数据对接教程2-股本数据,筹码分布函数](https://blog.csdn.net/jones2000/article/details/112060761)<br>
3. [hqchartPy2数据对接教程3-FINANCE数据](https://blog.csdn.net/jones2000/article/details/112095070)<br>
4. [hqchartPy2数据对接教程4-DYNAINFO函数](https://blog.csdn.net/jones2000/article/details/112334485)<br>
5. [hqchartPy2数据对接教程5-引用指定股票数据函数](https://blog.csdn.net/jones2000/article/details/112335307)<br>
6. [hqchartPy2指标选股-KDJ选股](https://blog.csdn.net/jones2000/article/details/113667444)<br>
Loading…
Cancel
Save