Browse Source

Merge branch 'zhaowenkang/feature-20251028181547-行情页面' into milestone-20251031-简版功能开发

lihuilin/feature-20251024095243-我的
zhaowenkang 4 weeks ago
parent
commit
65f89adc95
  1. 59
      common/dailyData.js
  2. 124
      pages/marketSituation/countryMarket.vue
  3. 165
      pages/marketSituation/marketCondition.vue
  4. 25
      pages/marketSituation/marketSituation.vue
  5. 1651
      uni_modules/jones-hqchart2/changelog.md
  6. 718
      uni_modules/jones-hqchart2/js_sdk/HQChartControl.vue
  7. 2079
      uni_modules/jones-hqchart2/js_sdk/umychart.ChartDrawPicture.wechart.js
  8. 48905
      uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.vue.js
  9. 57890
      uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.wechat.js
  10. 1032
      uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTestV2.wechat.js
  11. 3180
      uni_modules/jones-hqchart2/js_sdk/umychart.chartframe.wechat.js
  12. 10565
      uni_modules/jones-hqchart2/js_sdk/umychart.chartpaint.wechat.js
  13. 2138
      uni_modules/jones-hqchart2/js_sdk/umychart.charttitle.wechat.js
  14. 14788
      uni_modules/jones-hqchart2/js_sdk/umychart.complier.wechat.js
  15. 8
      uni_modules/jones-hqchart2/js_sdk/umychart.console.wechat.js
  16. 3676
      uni_modules/jones-hqchart2/js_sdk/umychart.coordinatedata.wechat.js
  17. 2443
      uni_modules/jones-hqchart2/js_sdk/umychart.data.wechat.js
  18. 144
      uni_modules/jones-hqchart2/js_sdk/umychart.element.wechart.js
  19. 1121
      uni_modules/jones-hqchart2/js_sdk/umychart.explainer.wechat.js
  20. 1191
      uni_modules/jones-hqchart2/js_sdk/umychart.extendchart.wechat.js
  21. 2438
      uni_modules/jones-hqchart2/js_sdk/umychart.framesplit.wechat.js
  22. 941
      uni_modules/jones-hqchart2/js_sdk/umychart.hqIndexformula.wechat.js
  23. 3502
      uni_modules/jones-hqchart2/js_sdk/umychart.index.data.wechat.js
  24. 4239
      uni_modules/jones-hqchart2/js_sdk/umychart.index.wechat.js
  25. 836
      uni_modules/jones-hqchart2/js_sdk/umychart.klineinfo.wechat.js
  26. 62
      uni_modules/jones-hqchart2/js_sdk/umychart.network.wechart.js
  27. 412
      uni_modules/jones-hqchart2/js_sdk/umychart.regressiontest.wechat.js
  28. 4044
      uni_modules/jones-hqchart2/js_sdk/umychart.report.wechat.js
  29. 1095
      uni_modules/jones-hqchart2/js_sdk/umychart.resource.wechat.js
  30. 1
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/brushSymbol.js
  31. 539
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/demo.css
  32. 1614
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/demo_index.html
  33. 263
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.css
  34. 1
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.js
  35. 443
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.json
  36. BIN
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.ttf
  37. BIN
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.woff
  38. BIN
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.woff2
  39. 6
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/fontSymbol.css
  40. 1
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/fontSymbol.js
  41. 747
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.css
  42. BIN
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.ttf
  43. BIN
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.woff
  44. BIN
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.woff2
  45. 1
      uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/readme.txt
  46. 467
      uni_modules/jones-hqchart2/js_sdk/umychart.style.wechat.js
  47. 107
      uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.canvas.helper.js
  48. 139407
      uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.h5.js
  49. 36
      uni_modules/jones-hqchart2/js_sdk/umychart.version.wechat.js
  50. 13463
      uni_modules/jones-hqchart2/js_sdk/umychart.wechat.3.0.js
  51. 40
      uni_modules/jones-hqchart2/js_sdk/用户协议.txt
  52. 78
      uni_modules/jones-hqchart2/package.json
  53. 293
      uni_modules/jones-hqchart2/readme.md
  54. 2
      vue.config.js

59
common/dailyData.js

@ -0,0 +1,59 @@
function generateDailyPacket(stock_code, startDate, days, basePrice) {
const data = [];
let prevClose = Number(basePrice);
const toStrDate = (dateVal) => (typeof dateVal === 'number' ? String(dateVal) : dateVal);
const addDays = (yyyymmdd, delta) => {
const y = parseInt(yyyymmdd.slice(0, 4), 10);
const m = parseInt(yyyymmdd.slice(4, 6), 10) - 1;
const d = parseInt(yyyymmdd.slice(6, 8), 10);
const dt = new Date(y, m, d);
dt.setDate(dt.getDate() + delta);
const yyyy = dt.getFullYear();
const mm = String(dt.getMonth() + 1).padStart(2, '0');
const dd = String(dt.getDate()).padStart(2, '0');
return `${yyyy}${mm}${dd}`;
};
const randDrift = () => (Math.random() - 0.5) * 0.02; // 每日 ±1% 漂移
const spread = 0.00050; // 买卖点差(可按需要调整)
let date = toStrDate(startDate);
for (let i = 0; i < days; i++) {
const open = +(prevClose * (1 + randDrift())).toFixed(5);
const close = +(open * (1 + randDrift())).toFixed(5);
const highRaw = Math.max(open, close) * (1 + Math.random() * 0.01);
const lowRaw = Math.min(open, close) * (1 - Math.random() * 0.01);
const high = +highRaw.toFixed(5);
const low = +lowRaw.toFixed(5);
const tick_qty = Math.floor(1000 + Math.random() * 5000); // 成交量
const amount = +(close * tick_qty).toFixed(2); // 成交额
const item = {
ts_code: stock_code,
trade_date: date,
bid_open: open,
bid_high: high,
bid_low: low,
bid_close: close,
ask_open: +(open + spread).toFixed(5),
ask_high: +(high + spread).toFixed(5),
ask_low: +(low + spread).toFixed(5),
ask_close: +(close + spread).toFixed(5),
tick_qty,
amount,
};
data.push(item);
prevClose = close;
date = addDays(date, 1);
}
return { stock_code, data };
}
// ... existing code ...
export const dailyDataPackets = {
// 如已存在同名键,可合并或覆盖
'GBPAUD.FXCM': generateDailyPacket('GBPAUD.FXCM', '20240101', 3000, 2.03893),
'EURUSD.FXCM': generateDailyPacket('EURUSD.FXCM', '20240101', 3000, 1.08350),
// 可按需继续添加更多代码
};

124
pages/marketSituation/countryMarket.vue

@ -10,14 +10,14 @@
</view>
<!-- 大盘指数 -->
<view class="section">
<view class="section" v-if="activeTabIndex === 0">
<view class="section_header">
<text class="section_title">大盘指数</text>
<text class="section_action" @click="viewMore('indices')">查看更多 ></text>
</view>
<view class="indices_grid">
<view v-for="(index, i) in countryInfo.mainIndices" :key="i" class="index_item">
<IndexCard :market="countryInfo.market" :indexName="index.name" :currentPrice="index.price" :changeAmount="index.change" :changePercent="index.changePercent" :isRising="index.isRising" />
<view v-for="(index, i) in countryInfo" :key="i" class="index_item">
<IndexCard :market="index.market" :stockName="index.name" :currentPrice="index.price" :changeAmount="index.change" :changePercent="index.changePercent" :isRising="index.isRising" />
</view>
</view>
@ -39,13 +39,13 @@
</view>
<!-- 板块 -->
<view class="section">
<view class="section" v-if="activeTabIndex === 1">
<view class="section_header">
<text class="section_title">板块</text>
<text class="section_action" @click="viewMore('sectors')">查看更多 ></text>
</view>
<view class="sectors_grid">
<view v-for="(sec, i) in sectors" :key="i" class="sector_item">
<view v-for="(sec, i) in countryInfo" :key="i" class="sector_item">
<view class="sector_header">
<text class="sector_name">{{ sec.name }}</text>
<text :class="['sector_change', sec.isRising ? 'rising' : 'falling']">
@ -58,7 +58,7 @@
</view>
<!-- 股票 -->
<view class="section">
<view class="section" v-if="activeTabIndex === 2">
<view class="section_header">
<text class="section_title">股票</text>
<text class="section_action" @click="viewMore('stocks')">查看更多 ></text>
@ -69,7 +69,7 @@
<text class="cell price">最新</text>
<text class="cell change">涨幅</text>
</view>
<view class="table_row" v-for="(stk, i) in stocks" :key="i">
<view class="table_row" v-for="(stk, i) in countryInfo" :key="i">
<view class="cell name">
<text class="stk_name">{{ stk.name }}</text>
<text class="stk_code">{{ stk.code }}</text>
@ -92,14 +92,30 @@
</template>
<script setup>
import { ref, computed, onMounted } from "vue";
import { ref, computed, onMounted, watch } from "vue";
import IndexCard from "../../components/IndexCard.vue";
import { queryStockDataAPI } from "@/api/marketSituation/marketSituation";
onMounted(() => {
switchTab(0);
});
// Tab
// const marketTabs = ["", "", "", ""];
const activeTabIndex = ref(0);
const switchTab = (i) => {
activeTabIndex.value = i;
queryStockDataAPI({
parentId: props.countryId,
tradeId: activeTabIndex.value+1,
}).then((res) => {
if (res.code === 200) {
countryInfo.value = res.data.dataPage.records;
console.log(res.data)
console.log(res.data.dataPage.records)
console.log(countryInfo.value);
}
});
};
//
@ -125,80 +141,31 @@ const props = defineProps({
marketTabs: {
type: Array,
},
});
// /
const countryInfoMap = {
2: {
//
name: "新加坡",
flag: "🇸🇬",
isMarketOpen: true,
mainIndices: [
{ name: "海峡时报指数", price: "3,234.56", change: "+12.34", changePercent: "+0.38%", isRising: true },
{ name: "FTSE ST Mid Cap", price: "1,234.56", change: "-5.67", changePercent: "-0.46%", isRising: false },
],
hotStocks: [
{ name: "星展银行", code: "D05.SI", price: "35.20", change: "+0.15", isRising: true },
{ name: "华侨银行", code: "O39.SI", price: "13.45", change: "-0.05", isRising: false },
],
},
3: {
// 西
name: "马来西亚",
flag: "🇲🇾",
isMarketOpen: false,
mainIndices: [{ name: "富时大马KLCI指数", price: "1,567.89", change: "+8.90", changePercent: "+0.57%", isRising: true }],
hotStocks: [
{ name: "马来亚银行", code: "1155.KL", price: "9.85", change: "+0.10", isRising: true },
{ name: "大众银行", code: "1295.KL", price: "4.32", change: "-0.02", isRising: false },
],
},
4: {
// 西
name: "印度尼西亚",
flag: "🇮🇩",
isMarketOpen: true,
mainIndices: [{ name: "雅加达综合指数", price: "7,234.56", change: "+45.67", changePercent: "+0.63%", isRising: true }],
hotStocks: [],
},
5: {
//
name: "美国",
flag: "🇺🇸",
isMarketOpen: false,
mainIndices: [
{ name: "道琼斯", price: "45,757.90", change: "-125.22", changePercent: "-0.27%", isRising: false },
{ name: "纳斯达克", price: "22,333.96", change: "+125.22", changePercent: "+0.47%", isRising: true },
{ name: "标普500", price: "6,606.08", change: "+125.22", changePercent: "+0.27%", isRising: true },
],
hotStocks: [
{ name: "苹果", code: "AAPL", price: "195.89", change: "+2.34", isRising: true },
{ name: "微软", code: "MSFT", price: "378.85", change: "-1.23", isRising: false },
],
tabData: {
type: Object,
default: null
},
};
});
//
const countryInfo = computed(() => {
return (
countryInfoMap[props.countryId] || {
name: "未知地区",
flag: "🌍",
isMarketOpen: false,
mainIndices: [],
hotStocks: [],
const countryInfo = ref('')
//
const handleTabData = (tabData) => {
if (tabData && tabData.type === 'country' && tabData.data) {
if (tabData.data.dataPage && tabData.data.dataPage.records) {
countryInfo.value = tabData.data.dataPage.records;
console.log('countryMarket接收到数据:', countryInfo.value);
}
);
});
}
};
//
const sectors = computed(() => {
return countryInfoMap[props.countryId]?.sectors || [];
});
const stocks = computed(() => {
return countryInfoMap[props.countryId]?.stocks || [];
});
// tabData
watch(() => props.tabData, (newTabData) => {
if (newTabData) {
handleTabData(newTabData);
}
}, { immediate: true });
//
const viewMore = (type) => {
@ -257,11 +224,8 @@ const viewMore = (type) => {
}
.indices_grid {
padding: 20rpx;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
background-color: #f6f6f6;
}
/* 情绪温度 */

165
pages/marketSituation/marketCondition.vue

@ -202,6 +202,19 @@
<button @click="sendTcpMessage('init_real_time')">初始化获取行情历史数据</button>
<button @click="sendTcpMessage('stop_real_time')">停止实时推送</button>
</view>
<view class="test" v-else-if="klineTab === 11">
<view class="button-sp-area">
<button class="mini-btn" type="default" size="mini" @click="ChangeMinutePeriod(1)">分时</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeMinutePeriod(5)">5D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0)">D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(1)">W</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(4)">1M</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(5)">15M</button>
</view>
<view style='background-color:#ffffff;'>
<HQChartControl ref="HQChartCtrl" DefaultChart="{Type:'KLine'}" :DefaultSymbol="Symbol"> </HQChartControl>
</view>
</view>
<view v-else class="kline-chart-container">
<text>K线图开发中...</text>
</view>
@ -236,6 +249,147 @@ import { HCharts } from "@/common/canvasMethod.js";
import tcpConnection, { TCPConnection, TCP_CONFIG } from "../../api/tcpConnection";
import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
const marketSituationStore = useMarketSituationStore();
import HQChartControl from '@/uni_modules/jones-hqchart2/js_sdk/HQChartControl.vue'
//
import HQData from "@/uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.vue.js"
import { dailyDataPackets } from '@/common/dailyData.js'
//
const Symbol = ref('GBPAUD.FXCM')
const ChartWidth = ref(350)
const ChartHeight = ref(500)
const HQChartCtrl = ref(null)
//
const CreateHQChart = () => {
const chartHeight = ChartHeight.value
const hqchartCtrl = HQChartCtrl.value
if (!hqchartCtrl) return
//option
//hqchartCtrl.KLine.Option.
hqchartCtrl.NetworkFilter = NetworkFilter
hqchartCtrl.SetSize(ChartWidth.value, chartHeight)
hqchartCtrl.OnSize()
hqchartCtrl.KLine.Option.IsAutoUpdate = false
hqchartCtrl.KLine.Option.KLine.Period = 4
nextTick(() => {
hqchartCtrl.CreateHQChart()
})
}
const transformDailyDataToHQChart = (dailyDataPackets) => {
const symbol = dailyDataPackets.stock_code || Symbol.value
const rows = Array.isArray(dailyDataPackets.data) ? dailyDataPackets.data : []
// HQChart线: [Date, Open, High, Low, Close, Volume]
const data = rows.map((r, idx) => ([
parseInt(r.trade_date, 10), // Date: YYYYMMDD
Number(idx > 0 ? rows[idx - 1].bid_close : r.bid_close), // YClose:
Number(r.bid_open), // Open
Number(r.bid_high), // High
Number(r.bid_low), // Low
Number(r.bid_close), // Close
Number(r.tick_qty || 0), // Volume
Number(r.amount || 0) // Amount0
]))
return { name: symbol, symbol, ver: 2.0, data }
}
const ClearHQChart = () => {
const hqchartCtrl = HQChartCtrl.value
if (hqchartCtrl) hqchartCtrl.ClearChart()
}
const ChangeMinutePeriod = (days) => {
const hqchartCtrl = HQChartCtrl.value
if (hqchartCtrl) hqchartCtrl.ChangeMinutePeriod(days)
}
const ChangeKLinePeriod = (period) => {
const hqchartCtrl = HQChartCtrl.value
if (hqchartCtrl) hqchartCtrl.ChangeKLinePeriod(period)
}
const NetworkFilter = (data, callback) => {
console.log(`[App:NetworkFilter] Name=${data.Name} Explain=${data.Explain}`)
// HQDataCDN
data.PreventDefault = true
const reqSymbol = (data?.Request?.Data?.symbol) || Symbol.value || 'GBPAUD.FXCM'
switch (data.Name) {
// K
case 'KLineChartContainer::RequestHistoryData': {
const packet = dailyDataPackets[reqSymbol]
if (packet) {
const mock = transformDailyDataToHQChart(packet)
callback({ data: mock })
} else {
//
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
}
break
}
// K
case 'KLineChartContainer::RequestRealtimeData': {
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
break
}
// /
case 'KLineChartContainer::ReqeustHistoryMinuteData':
case 'KLineChartContainer::RequestMinuteRealtimeData':
case 'MinuteChartContainer::RequestMinuteData':
case 'MinuteChartContainer::RequestHistoryMinuteData': {
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
break
}
default: {
//
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
break
}
}
}
//
const handleShow = () => {
uni.getSystemInfo({
success: (res) => {
const width = res.windowWidth
const height = res.windowHeight
ChartWidth.value = width
ChartHeight.value = height - 65
nextTick(() => {
CreateHQChart()
})
}
})
}
//
const handleHide = () => {
ClearHQChart()
}
//
const handleUnload = () => {
ClearHQChart()
}
//
onMounted(() => {
handleShow()
})
onUnmounted(() => {
handleUnload()
})
// TCP
const tcpConnected = ref(false);
const connectionListener = ref(null);
@ -487,10 +641,13 @@ const selectKlineTab = (tabId) => {
});
break;
case 11:
uni.showToast({
title: "暂无年K数据",
icon: "none",
duration: 2000,
// K -
nextTick(() => {
CreateHQChart();
// K
setTimeout(() => {
ChangeKLinePeriod(3);
}, 100);
});
break;
default:

25
pages/marketSituation/marketSituation.vue

@ -37,7 +37,7 @@
<!-- 可滚动内容区域 -->
<scroll-view class="content_scroll" scroll-y="true" :style="{ top: contentTopPosition + 'px' }">
<!-- 动态组件切换 -->
<component :is="currentComponent" :countryId="currentChannelId" :marketTabs="getChildMarketTabs(currentChannelId)" />
<component :is="currentComponent" :countryId="currentChannelId" :marketTabs="getChildMarketTabs(currentChannelId)" :tabData="currentTabData"/>
</scroll-view>
</view>
@ -61,6 +61,7 @@
</view>
</view>
</view>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
</view>
</template>
@ -70,12 +71,13 @@ import footerBar from "../../components/footerBar.vue";
import forexMetals from "./forexMetals.vue";
import marketOverview from "./marketOverview.vue";
import countryMarket from "./countryMarket.vue";
import { getAllTabsAPI } from "../../api/marketSituation/marketSituation.js";
import { getAllTabsAPI, queryStockDataAPI } from "../../api/marketSituation/marketSituation.js";
const type = ref("marketSituation");
const iSMT = ref(0);
const searchValue = ref("");
const contentHeight = ref(0);
const headerHeight = ref(0); // header
const currentTabData = ref(null);
// Tab
const channelData = ref([{ id: 1, title: "概况" }]);
@ -191,11 +193,18 @@ const navClick = (index) => {
//
selectedCountry.value = currentItem.title;
uni.showToast({
title: `切换到: ${currentItem.title}`,
icon: "none",
});
// tab
queryStockDataAPI({
parentId: currentItem.id,
tradeId: 1,
}).then((res) => {
if (res.code == 200) {
currentTabData.value = {
type: 'country',
data: res.data
};
}
});
// tab
console.log("当前选中的 tab:", currentItem);
};
@ -586,4 +595,4 @@ watch(headerHeight, (newHeight) => {
.country_item.selected .country_text {
color: #fff;
}
</style>
</style>

1651
uni_modules/jones-hqchart2/changelog.md
File diff suppressed because it is too large
View File

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

@ -0,0 +1,718 @@
<template>
<!-- #ifdef H5 -->
<div class='kline' v-bind:id='KLineID' v-bind:style="{width: ChartWidth+'px', height: ChartHeight+'px'}" ref='kline'></div>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<canvas class="kline" v-bind:id='KLineID' type="2d"
v-bind:style="{width: ChartWidth+'px', height: ChartHeight+'px'}"
@touchstart="KLineTouchStart" @touchmove='KLineTouchMove' @touchend='KLineTouchEnd' />
<!-- #endif -->
<!-- #ifndef H5 || MP-WEIXIN -->
<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'
import './umychart.resource/font/iconfont.css'
// #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 HQChartHelper() { }
//Vue3markRowvue2
HQChartHelper.MarkRaw=function(value)
{
return value;
}
// #ifdef VUE3
HQChartHelper.MarkRaw=function(value)
{
return markRaw(value);
}
// #endif
function DefaultData() { }
DefaultData.GetKLineOption = function ()
{
let data =
{
Type: '历史K线图',
Windows: //
[
{Index:"MA",Modify: false, Change: false},
{Index:"VOL",Modify: false, Change: false},
{Index:"AMO",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:6,
IsShowTooltip:false,
DrawType:0,
DataWidth:10
},
KLineTitle: //K线
{
DateTimeSpace:1,
PeriodSpace:1,
NameSpace:1,
},
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:550,
ChartHeight:1000,
KLineID:"HQChart_"+DefaultData.CreateGuid(),
KLine:
{
Option:DefaultData.GetKLineOption(),
},
Minute:
{
Option:DefaultData.GetMinuteOption(),
},
ChartType:"Minute",
CanvasNode:null,
};
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(option)
{
// #ifdef H5
this.OnSize_h5(option);
// #endif
// #ifndef H5
this.OnSize_app(option);
// #endif
},
OnSize_h5(option)
{
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(option);
},
OnSize_app(option)
{
var jsChart=this.GetJSChart();
if (jsChart)
{
jsChart.CanvasElement.Width=this.ChartWidth;
jsChart.CanvasElement.Height=this.ChartHeight;
jsChart.OnSize(option);
}
},
SetHQChartStyle()
{
// #ifdef H5
this.SetHQChartStyle_h5();
// #endif
// #ifndef H5
this.SetHQChartStyle_app();
// #endif
},
SetHQChartStyle_h5()
{
var blackStyle=HQChart.HQChartStyle.GetStyleConfig(HQChart.STYLE_TYPE_ID.BLACK_ID);
HQChart.JSChart.SetStyle(blackStyle);
//this.$refs.kline.style.backgroundColor=blackStyle.BGColor; //div
},
SetHQChartStyle_app()
{
var blackStyle=JSCommonHQStyle.GetStyleConfig(JSCommonHQStyle.STYLE_TYPE_ID.BLACK_ID);
JSCommon.JSChart.SetStyle(blackStyle);
},
CreateHQChart()
{
this.SetHQChartStyle();
if (this.ChartType=="Minute")
return this.CreateMinuteChart();
else
return this.CreateKLineChart();
},
CreateKLineChart_h5() //K线
{
this.ClearChart();
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 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_WeChat()
{
this.ClearChart();
var id=`#${this.KLineID}`;
wx.createSelectorQuery().in(this)
.select(id)
.fields({
node: true,
size: true,
})
.exec((res)=>
{
console.log("[HQChartControl::CreateKLineChart_WeChat] 2")
this.CanvasNode= HQChartHelper.MarkRaw(res[0]);
var element = new JSCommon.JSCanvasElement();
element.ID = this.KLineID;
element.CanvasNode =this.CanvasNode;
element.Height = this.ChartHeight; //!!
element.Width = this.ChartWidth;
console.log("[HQChartControl::CreateKLineChart_WeChat] 3",this.ChartHeight,this.ChartWidth, res)
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
return this.CreateKLineChart_h5();
// #endif
// #ifdef MP-WEIXIN
return this.CreateKLineChart_WeChat();
// #endif
// #ifndef H5 || MP-WEIXIN
return this.CreateKLineChart_app();
// #endif
},
CreateMinuteChart_h5() //线
{
this.ClearChart();
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 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_WeChat()
{
this.ClearChart();
var id=`#${this.KLineID}`;
wx.createSelectorQuery().in(this)
.select(id)
.fields({
node: true,
size: true,
})
.exec((res)=>
{
this.CanvasNode= HQChartHelper.MarkRaw(res[0]);
var element = new JSCommon.JSCanvasElement();
element.ID = this.KLineID;
element.CanvasNode =this.CanvasNode;
element.Height = this.ChartHeight; //!!
element.Width = this.ChartWidth;
console.log("[HQChartControl::CreateMinuteChart_WeChat] 3",this.ChartHeight,this.ChartWidth, res)
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);
});
},
CreateMinuteChart()
{
this.ChartType="Minute";
// #ifdef H5
return this.CreateMinuteChart_h5();
// #endif
// #ifdef MP-WEIXIN
return this.CreateMinuteChart_WeChat();
// #endif
// #ifndef H5 || MP-WEIXIN
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();
if (!jsChart) return false;
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);
},
ChangeRight(right)
{
var jsChart=this.GetJSChart();
if (this.IsKLineChart() && jsChart) jsChart.ChangeRight(right);
},
ChangeKLineDrawType(id)
{
var jsChart=this.GetJSChart();
if (this.IsKLineChart() && jsChart) jsChart.ChangeKLineDrawType(id);
},
///////////////////////////////////////////////
// app/
//KLine
KLineTouchStart(event)
{
var jsChart=this.GetJSChart();
if (jsChart)
{
var backup=this.ConvertTouchEventData(event);
jsChart.OnTouchStart(event);
this.RestoreTouchEventData(backup, event);
}
},
KLineTouchMove (event)
{
var jsChart=this.GetJSChart();
if (jsChart)
{
var backup=this.ConvertTouchEventData(event);
jsChart.OnTouchMove(event);
this.RestoreTouchEventData(backup, event);
}
},
KLineTouchEnd (event)
{
var jsChart=this.GetJSChart();
if (jsChart)
{
var backup=this.ConvertTouchEventData(event);
jsChart.OnTouchEnd(event);
this.RestoreTouchEventData(backup, event);
}
},
ConvertTouchEventData(event)
{
if (Array.isArray(event.touches)) return null;
var touches=event.touches; //
var aryTouches=[];
for(var i=0;i<10;++i)
{
var key=i.toString();
var item=event.touches[key];
if (!item) break;
aryTouches[i]=item;
}
event.touches=aryTouches;
var changedTouches=event.changedTouches;
var aryChangedTouches=[];
for(var i=0;i<10;++i)
{
var key=i.toString();
var item=event.changedTouches[key];
if (!item) break;
aryChangedTouches[i]=item;
}
event.changedTouches=aryChangedTouches;
//console.log('ConvertTouchEventData' ,event )
return {Touches:touches, ChangedTouches:changedTouches };
},
RestoreTouchEventData(backup, event)
{
if (!backup) return;
event.touches=backup.Touches; //touches
event.changedTouches=backup.ChangedTouches
//console.log('RestoreTouchEventData' ,event )
},
/////////////////////////////////////////////////////////////////////////////////////////
NetworkFilter(data, callback)
{
console.log(`[HQChartTemplate:NetworkFilter] Name=${data.Name} Explain=${data.Explain}` );
},
},
}
</script>
<style>
</style>

2079
uni_modules/jones-hqchart2/js_sdk/umychart.ChartDrawPicture.wechart.js
File diff suppressed because it is too large
View File

48905
uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.vue.js
File diff suppressed because it is too large
View File

57890
uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.wechat.js
File diff suppressed because it is too large
View File

1032
uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTestV2.wechat.js
File diff suppressed because it is too large
View File

3180
uni_modules/jones-hqchart2/js_sdk/umychart.chartframe.wechat.js
File diff suppressed because it is too large
View File

10565
uni_modules/jones-hqchart2/js_sdk/umychart.chartpaint.wechat.js
File diff suppressed because it is too large
View File

2138
uni_modules/jones-hqchart2/js_sdk/umychart.charttitle.wechat.js
File diff suppressed because it is too large
View File

14788
uni_modules/jones-hqchart2/js_sdk/umychart.complier.wechat.js
File diff suppressed because it is too large
View File

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

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

3676
uni_modules/jones-hqchart2/js_sdk/umychart.coordinatedata.wechat.js
File diff suppressed because it is too large
View File

2443
uni_modules/jones-hqchart2/js_sdk/umychart.data.wechat.js
File diff suppressed because it is too large
View File

144
uni_modules/jones-hqchart2/js_sdk/umychart.element.wechart.js

@ -0,0 +1,144 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
画布节点元素
*/
//日志
import { JSConsole } from "./umychart.console.wechat.js"
import { JSCommonUniApp } from './umychart.uniapp.canvas.helper.js'
function JSCanvasElement()
{
this.Height;
this.Width;
this.ID;
this.WebGLCanvas;
this.IsUniApp=false; //uniapp app程序
this.IsUniAppX=false;
this.IsDingTalk=false; //钉钉小程序
this.IsDouYin=false; //抖音小程序
this.CanvasNode=null;
this.ComponentObject=null; //在自定义组件下,当前组件实例的this,表示在这个自定义组件下查找拥有 canvas-id 的 canvas ,如果省略则不在任何自定义组件内查找
this.PixelRatio=null;
//获取画布
this.GetContext = function ()
{
var canvas;
if (this.IsDingTalk)
{
canvas = dd.createCanvasContext(this.ID);
if (this.PixelRatio==null) this.PixelRatio=dd.getSystemInfoSync().pixelRatio;
canvas.restore();
canvas.save();
canvas.scale(this.PixelRatio,this.PixelRatio);
JSConsole.Chart.Log('[JSCanvasElement::GetContext] measureText() => JSUniAppCanvasHelper.MeasureText()');
JSCommonUniApp.JSUniAppCanvasHelper.GetCanvasFont=function(canvas)
{
return canvas.state.font;
}
canvas.measureText = function (text) //uniapp 计算宽度需要自己计算
{
var width = JSCommonUniApp.JSUniAppCanvasHelper.MeasureText(text, canvas);
return { width: width };
}
return canvas;
}
if (this.CanvasNode && this.CanvasNode.node)
{
const width = this.CanvasNode.width;
const height = this.CanvasNode.height;
var node = this.CanvasNode.node;
node._height = height;
node._width = width;
JSConsole.Chart.Log("[JSCanvasElement::GetContext] create by getContext('2d')");
canvas = node.getContext('2d');
const dpr = wx.getSystemInfoSync().pixelRatio;
this.PixelRatio=dpr;
node.width = width * dpr;
node.height = height * dpr;
canvas.restore();
canvas.save();
canvas.scale(dpr, dpr);
canvas.draw = (bDraw, callback) => { if (callback) callback(); };
canvas.DomNode = node;
}
else
{
if (this.ComponentObject) //小程序自定义组件
canvas=wx.createCanvasContext(this.ID,this.ComponentObject);
else
canvas=wx.createCanvasContext(this.ID);
}
if (this.IsUniApp)
{
JSConsole.Chart.Log('[JSCanvasElement::GetContext] measureText() => JSUniAppCanvasHelper.MeasureText()');
canvas.measureText = function (text) //uniapp 计算宽度需要自己计算
{
var width = JSCommonUniApp.JSUniAppCanvasHelper.MeasureText(text, canvas);
return { width: width };
}
canvas.fillText_backup=canvas.fillText; //uniapp fillText 填了最大长度就会失真, 所以去掉
canvas.fillText=function(text,x,y,maxWidth)
{
canvas.fillText_backup(text,x,y);
}
}
if (this.IsUniAppX)
{
var element = uni.getElementById(this.ID);
canvas = element.getContext("2d");
const dpr = uni.getSystemInfoSync().pixelRatio;
element.width = element.offsetWidth * dpr;
element.height = element.offsetHeight * dpr;
canvas.scale(dpr, dpr);
canvas.draw = () => { };
}
return canvas;
}
this.GetWebGLCanvas=function(id)
{
var self=this;
const query = wx.createSelectorQuery();
query.select(id).node().exec((res) => {
JSConsole.Chart.Log('[JSCanvasElement::GetWebGLCanvas] res ', res)
self.WebGLCanvas = res[0].node;
})
}
}
//导出统一使用JSCommon命名空间名
export
{
JSCanvasElement
};
/*
module.exports =
{
JSCommonElement:
{
JSCanvasElement: JSCanvasElement,
},
//单个类导出
JSCommonElement_JSCanvasElement: JSCanvasElement,
};
*/

1121
uni_modules/jones-hqchart2/js_sdk/umychart.explainer.wechat.js
File diff suppressed because it is too large
View File

1191
uni_modules/jones-hqchart2/js_sdk/umychart.extendchart.wechat.js
File diff suppressed because it is too large
View File

2438
uni_modules/jones-hqchart2/js_sdk/umychart.framesplit.wechat.js
File diff suppressed because it is too large
View File

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

@ -0,0 +1,941 @@
/*
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命名空间名
export
{
HQIndexFormula
};
/*
module.exports =
{
//单个类导出
JSCommon_HQIndexFormula: HQIndexFormula
};
*/

3502
uni_modules/jones-hqchart2/js_sdk/umychart.index.data.wechat.js
File diff suppressed because it is too large
View File

4239
uni_modules/jones-hqchart2/js_sdk/umychart.index.wechat.js
File diff suppressed because it is too large
View File

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

@ -0,0 +1,836 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
小程序信息地雷数据
*/
import {
g_JSChartResource,
} from './umychart.resource.wechat.js'
import
{
IFrameSplitOperator,
} from './umychart.framesplit.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.MaxRequestDataCount=1000;
this.StartDate=20160101;
this.Data;
this.ClassName='IKLineInfo';
this.Explain="IKLineInfo";
this.GetToday=function()
{
var date=new Date();
var today=date.getFullYear()*10000+(date.getMonth()+1)*100+date.getDate();
return today;
}
this.GetRequestData=function(hqChart)
{
var obj=
{
Symbol:hqChart.Symbol ,
MaxRequestDataCount: hqChart.MaxRequestDataCount, //日线数据个数
MaxRequestMinuteDayCount:hqChart.MaxRequestMinuteDayCount, //分钟数据请求的天数
Period:hqChart.Period //周期
};
//K线数据范围
var hisData=null;
if (hqChart.ChartOperator_Temp_GetHistroyData) hisData=hqChart.ChartOperator_Temp_GetHistroyData();
if (hisData)
obj.DateRange=hisData.GetDateRange();
return obj;
}
this.NetworkFilter=function(hqChart,callInfo)
{
if (!hqChart.NetworkFilter) return false;
var self=this;
var param=
{
HQChart:hqChart,
};
var obj=
{
Name:`${this.ClassName}::RequestData`, //类名::函数
Explain:this.Explain,
Request:this.GetRequestData(hqChart),
Self:this,
HQChart:hqChart,
CallInfo:callInfo,
PreventDefault:false
};
if (callInfo)
{
if (callInfo.Update==true)
{
obj.Update={ Start:{ Date: callInfo.StartDate } };
param.Update={ Start:{ Date: callInfo.StartDate } };
}
obj.CallFunctionName=callInfo.FunctionName; //内部调用函数名
}
hqChart.NetworkFilter(obj, function(data)
{
self.RecvData(data,param);
});
if (obj.PreventDefault==true) return true; //已被上层替换,不调用默认的网络请求
return false;
}
}
/*
互动易
*/
function InvestorInfo()
{
this.newMethod=IKLineInfo; //派生
this.newMethod();
delete this.newMethod;
this.ClassName="InvestorInfo";
this.Explain="互动易";
this.RequestData=function(hqChart, obj)
{
var self = this;
var param={ HQChart:hqChart };
this.Data=[];
if (this.NetworkFilter(hqChart,obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount,
},
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.ClassName='AnnouncementInfo';
this.Explain="公告";
this.RequestData=function(hqChart, obj)
{
var self = this;
var param={ HQChart:hqChart };
if (obj && obj.Update===true) //更新模式 不清内存数据
{
}
else
{
this.Data=[];
}
if (this.NetworkFilter(hqChart, obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount,
},
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.ClassName='PforecastInfo';
this.Explain='业绩预告';
this.RequestData=function(hqChart,obj)
{
var self = this;
this.Data = [];
var param={ HQChart:hqChart };
if (this.NetworkFilter(hqChart,obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount,
},
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.ClassName='ResearchInfo';
this.Explain='投资者关系';
this.RequestData=function(hqChart,obj)
{
var self = this;
var param= { HQChart:hqChart };
this.Data=[];
if (this.NetworkFilter(hqChart,obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount,
},
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.ClassName='BlockTrading';
this.Explain='大宗交易';
this.RequestData=function(hqChart,obj)
{
var self = this;
var param={ HQChart:hqChart,};
this.Data=[];
if (this.NetworkFilter(hqChart,obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount,
},
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.ClassName='TradeDetail';
this.Explain='龙虎榜';
this.RequestData=function(hqChart,obj)
{
var self = this;
var param={ HQChart:hqChart };
this.Data=[];
if (this.NetworkFilter(hqChart,obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount,
},
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.ClassName='PolicyInfo';
this.Explain='策略信息';
this.PolicyList = []; //筛选的策略名字 {Name:策略名, Guid:策略的GUID}
this.SetPolicyList=function(aryPolicy)
{
for(let i in aryPolicy)
{
this.PolicyList.push({Name:aryPolicy[i]});
}
}
this.RequestData = function (hqChart,obj)
{
var self = this;
this.Data = [];
var param = { HQChart: hqChart };
// setTimeout(function () { self.RecvData(null, param); }, 2000); //模拟数据到达
if (this.NetworkFilter(hqChart,obj)) return; //已被上层替换,不调用默认的网络请求
//请求数据
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.MaxRequestDataCount
},
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 (Array.isArray(item))
{
if (item.length < 2) continue;
var info = { Date: event.date, Time: item[0], Title: item[1], Type: 0 };
this.Data.push(info);
}
else //2.0 格式
{
if (!IFrameSplitOperator.IsNumber(item.Date) || !IFrameSplitOperator.IsNumber(item.Time) || !item.Title) continue;
var info={ Date:item.Date, Time:item.Time, Title:item.Title, Type:0 };
if (item.Color) info.Color=item.Color;
if (item.BGColor) info.BGColor=item.BGColor;
if (IFrameSplitOperator.IsNumber(item.Price)) info.Price=item.Price;
if (item.Content) info.Content=item.Content;
if (item.Link) info.Link=item.Link;
this.Data.push(info);
}
}
}
param.HQChart.UpdataChartInfo();
param.HQChart.Draw();
}
}
//导出统一使用JSCommon命名空间名
export
{
JSKLineInfoMap,
KLINE_INFO_TYPE,
JSMinuteInfoMap,
};
/*
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,
};
*/

62
uni_modules/jones-hqchart2/js_sdk/umychart.network.wechart.js

@ -0,0 +1,62 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
网络通讯
*/
function JSNetwork()
{
}
JSNetwork.IsDingTalk=false;
JSNetwork.IsUniApp=false;
JSNetwork.HttpRequest=function(obj)
{
if (JSNetwork.IsDingTalk)
{
JSNetwork.DD_httpRequest(obj);
}
else
{
JSNetwork.WX_Reqeust(obj);
}
}
JSNetwork.WX_Reqeust=function(obj)
{
wx.request({
url: obj.url,
data:obj.data,
method: obj.method,
dataType: obj.dataType,
success: obj.success,
error:obj.error
});
}
JSNetwork.DD_httpRequest=function(obj)
{
dd.httpRequest({
url: obj.url,
method: obj.method,
data:obj.data,
dataType: obj.dataType,
success: obj.success
});
}
export
{
JSNetwork
};

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

@ -0,0 +1,412 @@
/*
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;
}
//导出
var JSCommonTest=
{
RegressionTest: RegressionTest, //个股单策略回测
};
export
{
JSCommonTest
};

4044
uni_modules/jones-hqchart2/js_sdk/umychart.report.wechat.js
File diff suppressed because it is too large
View File

1095
uni_modules/jones-hqchart2/js_sdk/umychart.resource.wechat.js
File diff suppressed because it is too large
View File

1
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/brushSymbol.js
File diff suppressed because it is too large
View File

539
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/demo.css

@ -0,0 +1,539 @@
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

1614
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/demo_index.html
File diff suppressed because it is too large
View File

263
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.css

@ -0,0 +1,263 @@
@font-face {
font-family: "hqchart_drawtool"; /* Project id 4529603 */
src: url('iconfont.woff2?t=1716529516458') format('woff2'),
url('iconfont.woff?t=1716529516458') format('woff'),
url('iconfont.ttf?t=1716529516458') format('truetype');
}
.hqchart_drawtool {
font-family: "hqchart_drawtool" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-qushixianjiaodu:before {
content: "\e60c";
}
.icon-infoline:before {
content: "\e64a";
}
.icon-zitibeijingse:before {
content: "\e656";
}
.icon-zitiyanse:before {
content: "\e686";
}
.icon-huabi:before {
content: "\e663";
}
.icon-tuodong:before {
content: "\e6ff";
}
.icon-jiance:before {
content: "\e936";
}
.icon-tubiao_shizixian:before {
content: "\e79d";
}
.icon-xifu:before {
content: "\e71b";
}
.icon-maodianwenzi:before {
content: "\e62e";
}
.icon-maodian:before {
content: "\e6db";
}
.icon-feibonaqisuduzulishan:before {
content: "\e620";
}
.icon-feibonaqihuiche:before {
content: "\e621";
}
.icon-feibonaqiqixing:before {
content: "\e622";
}
.icon-feibonaqizhouqixian:before {
content: "\e662";
}
.icon-jiangenjiaoduxian:before {
content: "\e619";
}
.icon-GoldenSection:before {
content: "\e601";
}
.icon-PercentageLine:before {
content: "\e603";
}
.icon-a-xiangpicachuxiangpica:before {
content: "\e60b";
}
.icon-jiagefanwei:before {
content: "\e618";
}
.icon-shijianfanwei:before {
content: "\e61f";
}
.icon-buxiangjiaojiao:before {
content: "\e617";
}
.icon-tubiao_buxiangjiaotongdao:before {
content: "\e79c";
}
.icon-drawicon_1:before {
content: "\e660";
}
.icon-drawicon_2:before {
content: "\e661";
}
.icon-tooltiptext:before {
content: "\eb0f";
}
.icon-Tooltip:before {
content: "\e62f";
}
.icon-fangkuai:before {
content: "\e600";
}
.icon-draw_quadrangle:before {
content: "\e62c";
}
.icon-arrow:before {
content: "\e7e3";
}
.icon-draw_arc:before {
content: "\e602";
}
.icon-draw_line:before {
content: "\e605";
}
.icon-draw_rays:before {
content: "\e606";
}
.icon-rectangle:before {
content: "\e607";
}
.icon-draw_parallel_lines:before {
content: "\e608";
}
.icon-setting:before {
content: "\e609";
}
.icon-recycle_bin:before {
content: "\e60a";
}
.icon-draw_trendline:before {
content: "\e60e";
}
.icon-draw_goldensection:before {
content: "\e60f";
}
.icon-draw_gannfan:before {
content: "\e610";
}
.icon-draw_percentage:before {
content: "\e611";
}
.icon-draw_waveband:before {
content: "\e612";
}
.icon-draw_resline:before {
content: "\e613";
}
.icon-draw_text:before {
content: "\e614";
}
.icon-draw_parallelchannel:before {
content: "\e615";
}
.icon-draw_wavemw:before {
content: "\e616";
}
.icon-draw_triangle:before {
content: "\e61a";
}
.icon-draw_pricechannel:before {
content: "\e61b";
}
.icon-draw_circle:before {
content: "\e61c";
}
.icon-draw_symangle:before {
content: "\e61d";
}
.icon-draw_hline:before {
content: "\e61e";
}
.icon-linear_1:before {
content: "\e657";
}
.icon-linear_2:before {
content: "\e659";
}
.icon-linear_3:before {
content: "\e65a";
}
.icon-ruler:before {
content: "\e65b";
}
.icon-price_line:before {
content: "\e65c";
}
.icon-vertical_line:before {
content: "\e65d";
}
.icon-waveruler:before {
content: "\e65e";
}
.icon-draw_box:before {
content: "\e65f";
}
.icon-draw_head_shoulders_bt:before {
content: "\e6a0";
}
.icon-draw_p_rays_lines:before {
content: "\e6a1";
}
.icon-draw_hlinesegment:before {
content: "\e6a2";
}

1
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.js
File diff suppressed because it is too large
View File

443
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.json

@ -0,0 +1,443 @@
{
"id": "4529603",
"name": "HQChart_DrawTool",
"font_family": "hqchart_drawtool",
"css_prefix_text": "icon-",
"description": "hqchart画图工具",
"glyphs": [
{
"icon_id": "5668811",
"name": "趋势线角度",
"font_class": "qushixianjiaodu",
"unicode": "e60c",
"unicode_decimal": 58892
},
{
"icon_id": "7414214",
"name": "info line",
"font_class": "infoline",
"unicode": "e64a",
"unicode_decimal": 58954
},
{
"icon_id": "3634785",
"name": "字体背景色",
"font_class": "zitibeijingse",
"unicode": "e656",
"unicode_decimal": 58966
},
{
"icon_id": "12424469",
"name": "字体颜色",
"font_class": "zitiyanse",
"unicode": "e686",
"unicode_decimal": 59014
},
{
"icon_id": "2005644",
"name": "画笔",
"font_class": "huabi",
"unicode": "e663",
"unicode_decimal": 58979
},
{
"icon_id": "15272275",
"name": "拖动",
"font_class": "tuodong",
"unicode": "e6ff",
"unicode_decimal": 59135
},
{
"icon_id": "27520569",
"name": "监测",
"font_class": "jiance",
"unicode": "e936",
"unicode_decimal": 59702
},
{
"icon_id": "37944385",
"name": "图标_十字线",
"font_class": "tubiao_shizixian",
"unicode": "e79d",
"unicode_decimal": 59293
},
{
"icon_id": "13135882",
"name": "吸附",
"font_class": "xifu",
"unicode": "e71b",
"unicode_decimal": 59163
},
{
"icon_id": "5673904",
"name": "锚点文字",
"font_class": "maodianwenzi",
"unicode": "e62e",
"unicode_decimal": 58926
},
{
"icon_id": "11083005",
"name": "锚点",
"font_class": "maodian",
"unicode": "e6db",
"unicode_decimal": 59099
},
{
"icon_id": "5672309",
"name": "斐波那契速度阻力扇",
"font_class": "feibonaqisuduzulishan",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "5672353",
"name": "斐波那契回撤",
"font_class": "feibonaqihuiche",
"unicode": "e621",
"unicode_decimal": 58913
},
{
"icon_id": "5673045",
"name": "斐波那契契形",
"font_class": "feibonaqiqixing",
"unicode": "e622",
"unicode_decimal": 58914
},
{
"icon_id": "34041367",
"name": "斐波那契周期线",
"font_class": "feibonaqizhouqixian",
"unicode": "e662",
"unicode_decimal": 58978
},
{
"icon_id": "5671406",
"name": "江恩角度线",
"font_class": "jiangenjiaoduxian",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "36063035",
"name": "黄金分割线",
"font_class": "GoldenSection",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "36063039",
"name": "百分比线",
"font_class": "PercentageLine",
"unicode": "e603",
"unicode_decimal": 58883
},
{
"icon_id": "37278411",
"name": "擦除",
"font_class": "a-xiangpicachuxiangpica",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "10686101",
"name": "价格范围",
"font_class": "jiagefanwei",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "10736830",
"name": "时间范围",
"font_class": "shijianfanwei",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "5669509",
"name": "不相交角",
"font_class": "buxiangjiaojiao",
"unicode": "e617",
"unicode_decimal": 58903
},
{
"icon_id": "37944389",
"name": "图标_不相交通道",
"font_class": "tubiao_buxiangjiaotongdao",
"unicode": "e79c",
"unicode_decimal": 59292
},
{
"icon_id": "20086094",
"name": "drawicon_1",
"font_class": "drawicon_1",
"unicode": "e660",
"unicode_decimal": 58976
},
{
"icon_id": "20086105",
"name": "drawicon_2",
"font_class": "drawicon_2",
"unicode": "e661",
"unicode_decimal": 58977
},
{
"icon_id": "704860",
"name": "tooltip-text",
"font_class": "tooltiptext",
"unicode": "eb0f",
"unicode_decimal": 60175
},
{
"icon_id": "37432772",
"name": "Tooltip",
"font_class": "Tooltip",
"unicode": "e62f",
"unicode_decimal": 58927
},
{
"icon_id": "2410156",
"name": "方块",
"font_class": "fangkuai",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "7669738",
"name": "平行四边形",
"font_class": "draw_quadrangle",
"unicode": "e62c",
"unicode_decimal": 58924
},
{
"icon_id": "5810174",
"name": "arrow",
"font_class": "arrow",
"unicode": "e7e3",
"unicode_decimal": 59363
},
{
"icon_id": "7656282",
"name": "圆弧",
"font_class": "draw_arc",
"unicode": "e602",
"unicode_decimal": 58882
},
{
"icon_id": "7656318",
"name": "线段",
"font_class": "draw_line",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "7656337",
"name": "射线",
"font_class": "draw_rays",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "7656347",
"name": "矩形",
"font_class": "rectangle",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "7656351",
"name": "平行线",
"font_class": "draw_parallel_lines",
"unicode": "e608",
"unicode_decimal": 58888
},
{
"icon_id": "7656362",
"name": "设置",
"font_class": "setting",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "7656365",
"name": "垃圾桶",
"font_class": "recycle_bin",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "7658213",
"name": "趋势线",
"font_class": "draw_trendline",
"unicode": "e60e",
"unicode_decimal": 58894
},
{
"icon_id": "7658219",
"name": "黄金分割",
"font_class": "draw_goldensection",
"unicode": "e60f",
"unicode_decimal": 58895
},
{
"icon_id": "7658227",
"name": "江恩角度线",
"font_class": "draw_gannfan",
"unicode": "e610",
"unicode_decimal": 58896
},
{
"icon_id": "7658243",
"name": "百分比线",
"font_class": "draw_percentage",
"unicode": "e611",
"unicode_decimal": 58897
},
{
"icon_id": "7658252",
"name": "波段线",
"font_class": "draw_waveband",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "7658254",
"name": "阻速线",
"font_class": "draw_resline",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "7658255",
"name": "文本",
"font_class": "draw_text",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "7658337",
"name": "平行通道",
"font_class": "draw_parallelchannel",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "7659084",
"name": "M头W底",
"font_class": "draw_wavemw",
"unicode": "e616",
"unicode_decimal": 58902
},
{
"icon_id": "7659827",
"name": "三角形",
"font_class": "draw_triangle",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "7659834",
"name": "价格通道线",
"font_class": "draw_pricechannel",
"unicode": "e61b",
"unicode_decimal": 58907
},
{
"icon_id": "7659837",
"name": "圆",
"font_class": "draw_circle",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "7659838",
"name": "对称角线",
"font_class": "draw_symangle",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "7659841",
"name": "水平线",
"font_class": "draw_hline",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "19932330",
"name": "线形回归带",
"font_class": "linear_1",
"unicode": "e657",
"unicode_decimal": 58967
},
{
"icon_id": "19932332",
"name": "延长线形回归带",
"font_class": "linear_2",
"unicode": "e659",
"unicode_decimal": 58969
},
{
"icon_id": "19932333",
"name": "线形回归线",
"font_class": "linear_3",
"unicode": "e65a",
"unicode_decimal": 58970
},
{
"icon_id": "19932334",
"name": "尺子",
"font_class": "ruler",
"unicode": "e65b",
"unicode_decimal": 58971
},
{
"icon_id": "19941940",
"name": "标价线",
"font_class": "price_line",
"unicode": "e65c",
"unicode_decimal": 58972
},
{
"icon_id": "19941945",
"name": "垂直线",
"font_class": "vertical_line",
"unicode": "e65d",
"unicode_decimal": 58973
},
{
"icon_id": "19965759",
"name": "波浪尺",
"font_class": "waveruler",
"unicode": "e65e",
"unicode_decimal": 58974
},
{
"icon_id": "19967944",
"name": "箱型线",
"font_class": "draw_box",
"unicode": "e65f",
"unicode_decimal": 58975
},
{
"icon_id": "20982623",
"name": "头肩型",
"font_class": "draw_head_shoulders_bt",
"unicode": "e6a0",
"unicode_decimal": 59040
},
{
"icon_id": "20982634",
"name": "平行射线",
"font_class": "draw_p_rays_lines",
"unicode": "e6a1",
"unicode_decimal": 59041
},
{
"icon_id": "20985860",
"name": "水平线段",
"font_class": "draw_hlinesegment",
"unicode": "e6a2",
"unicode_decimal": 59042
}
]
}

BIN
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.ttf

BIN
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.woff

BIN
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/drawtool/iconfont.woff2

6
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/fontSymbol.css

@ -0,0 +1,6 @@
.symbolIkcon {
width: 1em; height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}

1
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/fontSymbol.js
File diff suppressed because it is too large
View File

747
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.css

@ -0,0 +1,747 @@
@font-face {
font-family: "iconfont"; /* Project id 1040563 */
src: url('iconfont.woff2?t=1714022152085') format('woff2'),
url('iconfont.woff?t=1714022152085') format('woff'),
url('iconfont.ttf?t=1714022152085') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-accountbox:before {
content: "\e6b0";
}
.icon-checked:before {
content: "\e6af";
}
.icon-eye:before {
content: "\e78f";
}
.icon-eye-close:before {
content: "\e6ae";
}
.icon-fangxiangsanjiao-xiangshang:before {
content: "\e6ad";
}
.icon-fangxiangsanjiao-xiangshang-copy:before {
content: "\e86d";
}
.icon-jiantou-shang:before {
content: "\e86b";
}
.icon-jiantou-xia:before {
content: "\e86c";
}
.icon-sanjiaoxing:before {
content: "\e6ac";
}
.icon-sanjiaoxing-xia:before {
content: "\e710";
}
.icon-banner:before {
content: "\e6ab";
}
.icon-location1:before {
content: "\e6aa";
}
.icon-export:before {
content: "\e6a9";
}
.icon-lingxing:before {
content: "\e6a8";
}
.icon-location:before {
content: "\e6a7";
}
.icon-Title:before {
content: "\e6a6";
}
.icon-maxmize-:before {
content: "\e6a5";
}
.icon-HQchart:before {
content: "\e6a4";
}
.icon-button_add:before {
content: "\e6a3";
}
.icon-draw_hlinesegment:before {
content: "\e6a2";
}
.icon-draw_p_rays_lines:before {
content: "\e6a1";
}
.icon-draw_head_shoulders_bt:before {
content: "\e6a0";
}
.icon-drawicon_49:before {
content: "\e69f";
}
.icon-drawicon_48:before {
content: "\e69e";
}
.icon-drawicon_47:before {
content: "\e69d";
}
.icon-drawicon_46:before {
content: "\e69c";
}
.icon-drawicon_45:before {
content: "\e69b";
}
.icon-drawicon_44:before {
content: "\e69a";
}
.icon-drawicon_43:before {
content: "\e699";
}
.icon-drawicon_42:before {
content: "\e698";
}
.icon-drawicon_41:before {
content: "\e697";
}
.icon-drawicon_40:before {
content: "\e696";
}
.icon-drawicon_39:before {
content: "\e695";
}
.icon-drawicon_38:before {
content: "\e694";
}
.icon-drawicon_37:before {
content: "\e693";
}
.icon-drawicon_36:before {
content: "\e692";
}
.icon-drawicon_35:before {
content: "\e691";
}
.icon-drawicon_34:before {
content: "\e690";
}
.icon-drawicon_33:before {
content: "\e68f";
}
.icon-drawicon_32:before {
content: "\e67f";
}
.icon-drawicon_31:before {
content: "\e67e";
}
.icon-drawicon_30:before {
content: "\e67d";
}
.icon-drawicon_28:before {
content: "\e67b";
}
.icon-drawicon_29:before {
content: "\e67c";
}
.icon-drawicon_27:before {
content: "\e67a";
}
.icon-drawicon_26:before {
content: "\e679";
}
.icon-drawicon_25:before {
content: "\e678";
}
.icon-drawicon_24:before {
content: "\e677";
}
.icon-drawicon_23:before {
content: "\e676";
}
.icon-drawicon_22:before {
content: "\e675";
}
.icon-drawicon_21:before {
content: "\e674";
}
.icon-drawicon_20:before {
content: "\e673";
}
.icon-drawicon_19:before {
content: "\e672";
}
.icon-drawicon_18:before {
content: "\e671";
}
.icon-drawicon_17:before {
content: "\e670";
}
.icon-drawicon_16:before {
content: "\e66f";
}
.icon-drawicon_15:before {
content: "\e66e";
}
.icon-drawicon_14:before {
content: "\e66d";
}
.icon-drawicon_13:before {
content: "\e66c";
}
.icon-drawicon_12:before {
content: "\e66b";
}
.icon-drawicon_11:before {
content: "\e66a";
}
.icon-drawicon_10:before {
content: "\e669";
}
.icon-drawicon_9:before {
content: "\e668";
}
.icon-drawicon_8:before {
content: "\e667";
}
.icon-drawicon_7:before {
content: "\e666";
}
.icon-drawicon_6:before {
content: "\e665";
}
.icon-drawicon_5:before {
content: "\e664";
}
.icon-drawicon_4:before {
content: "\e663";
}
.icon-drawicon_3:before {
content: "\e662";
}
.icon-drawicon_2:before {
content: "\e661";
}
.icon-drawicon_1:before {
content: "\e660";
}
.icon-draw_box:before {
content: "\e65f";
}
.icon-waveruler:before {
content: "\e65e";
}
.icon-vertical_line:before {
content: "\e65d";
}
.icon-price_line:before {
content: "\e65c";
}
.icon-ruler:before {
content: "\e65b";
}
.icon-linear_3:before {
content: "\e65a";
}
.icon-linear_2:before {
content: "\e659";
}
.icon-linear_1:before {
content: "\e657";
}
.icon-stockStar:before {
content: "\e658";
}
.icon-camera:before {
content: "\e654";
}
.icon-change_index:before {
content: "\e656";
}
.icon-overlay_index:before {
content: "\e655";
}
.icon-houtui:before {
content: "\e651";
}
.icon-qianjin:before {
content: "\e652";
}
.icon-exit:before {
content: "\e653";
}
.icon-refresh:before {
content: "\e650";
}
.icon-sub:before {
content: "\e64e";
}
.icon-add:before {
content: "\e64f";
}
.icon-guanbi:before {
content: "\e62b";
}
.icon-sousuo:before {
content: "\e62a";
}
.icon-margin:before {
content: "\e629";
}
.icon-shhk:before {
content: "\e628";
}
.icon-hk:before {
content: "\e627";
}
.icon-drawicon_message:before {
content: "\e64d";
}
.icon-drawicon_s:before {
content: "\e64c";
}
.icon-drawicon_b:before {
content: "\e70f";
}
.icon-drawicon_close:before {
content: "\e68c";
}
.icon-drawicon_dollar:before {
content: "\e626";
}
.icon-drawicon_up:before {
content: "\e625";
}
.icon-drawicon_down-copy:before {
content: "\e68b";
}
.icon-drawicon_bad:before {
content: "\e600";
}
.icon-drawicon_good:before {
content: "\e624";
}
.icon-kline_train_buy:before {
content: "\e64a";
}
.icon-kline_train_sell:before {
content: "\e64b";
}
.icon-bianji:before {
content: "\e623";
}
.icon-info_num_more:before {
content: "\e649";
}
.icon-info_num_11:before {
content: "\e635";
}
.icon-info_num_10:before {
content: "\e636";
}
.icon-info_num_12:before {
content: "\e637";
}
.icon-info_num_13:before {
content: "\e638";
}
.icon-info_num_14:before {
content: "\e639";
}
.icon-info_num_15:before {
content: "\e63a";
}
.icon-info_num_1:before {
content: "\e63b";
}
.icon-info_num_16:before {
content: "\e63c";
}
.icon-info_num_3:before {
content: "\e63d";
}
.icon-info_num_17:before {
content: "\e63e";
}
.icon-info_num_4:before {
content: "\e63f";
}
.icon-info_num_2:before {
content: "\e640";
}
.icon-info_num_6:before {
content: "\e641";
}
.icon-info_num_18:before {
content: "\e642";
}
.icon-info_num_20:before {
content: "\e643";
}
.icon-info_num_19:before {
content: "\e644";
}
.icon-info_num_5:before {
content: "\e645";
}
.icon-info_num_9:before {
content: "\e646";
}
.icon-info_num_7:before {
content: "\e647";
}
.icon-info_num_8:before {
content: "\e648";
}
.icon-info_quarter_announcement-copy:before {
content: "\e686";
}
.icon-info_block_trading:before {
content: "\e630";
}
.icon-info_investor:before {
content: "\e631";
}
.icon-info_research:before {
content: "\e632";
}
.icon-info_announcement:before {
content: "\e633";
}
.icon-info_quarter_announcement:before {
content: "\e634";
}
.icon-info_research_hscreen:before {
content: "\e688";
}
.icon-info_block_trading_hscreen:before {
content: "\e689";
}
.icon-info_investor_hscreen:before {
content: "\e684";
}
.icon-info_announcement-copy:before {
content: "\e685";
}
.icon-info_trade_detail_hscreen:before {
content: "\e68a";
}
.icon-info_trade_detail:before {
content: "\e62f";
}
.icon-info_pforecast_hscreen:before {
content: "\e687";
}
.icon-info_pforecast:before {
content: "\e62e";
}
.icon-jiacu:before {
content: "\e61f";
}
.icon-shezhi:before {
content: "\e620";
}
.icon-qingxieL:before {
content: "\e622";
}
.icon-xia:before {
content: "\e618";
}
.icon-shang:before {
content: "\e619";
}
.icon-drawicon_up2:before {
content: "\e68d";
}
.icon-drawicon_down2:before {
content: "\e68e";
}
.icon-menu_arraw_right:before {
content: "\e60b";
}
.icon-menu_arraw_left:before {
content: "\e60d";
}
.icon-right:before {
content: "\e601";
}
.icon-left:before {
content: "\e603";
}
.icon-draw_fibonacci:before {
content: "\e62d";
}
.icon-draw_quadrangle:before {
content: "\e62c";
}
.icon-arrow_down:before {
content: "\e681";
}
.icon-arrow_left:before {
content: "\e680";
}
.icon-arrow_right:before {
content: "\e682";
}
.icon-arrow_up:before {
content: "\e683";
}
.icon-chip_default:before {
content: "\e621";
}
.icon-draw_hline:before {
content: "\e61e";
}
.icon-draw_symangle:before {
content: "\e61d";
}
.icon-draw_circle:before {
content: "\e61c";
}
.icon-draw_pricechannel:before {
content: "\e61b";
}
.icon-draw_triangle:before {
content: "\e61a";
}
.icon-chip_date:before {
content: "\e617";
}
.icon-draw_wavemw:before {
content: "\e616";
}
.icon-draw_parallelchannel:before {
content: "\e615";
}
.icon-draw_text:before {
content: "\e614";
}
.icon-draw_resline:before {
content: "\e613";
}
.icon-draw_waveband:before {
content: "\e612";
}
.icon-draw_percentage:before {
content: "\e611";
}
.icon-draw_gannfan:before {
content: "\e610";
}
.icon-draw_goldensection:before {
content: "\e60f";
}
.icon-draw_trendline:before {
content: "\e60e";
}
.icon-close:before {
content: "\e60c";
}
.icon-recycle_bin:before {
content: "\e60a";
}
.icon-setting:before {
content: "\e609";
}
.icon-draw_parallel_lines:before {
content: "\e608";
}
.icon-rectangle:before {
content: "\e607";
}
.icon-draw_rays:before {
content: "\e606";
}
.icon-draw_line:before {
content: "\e605";
}
.icon-index_param:before {
content: "\e604";
}
.icon-draw_arc:before {
content: "\e602";
}

BIN
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.ttf

BIN
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.woff

BIN
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/iconfont.woff2

1
uni_modules/jones-hqchart2/js_sdk/umychart.resource/font/readme.txt

@ -0,0 +1 @@
iconfont.css 行情图形相关的图片资源

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

@ -0,0 +1,467 @@
/*
copyright (c) 2018 jones
http://www.apache.org/licenses/LICENSE-2.0
开源项目 https://github.com/jones2000/HQChart
jones_2000@163.com
不同风格行情配置文件 (微信小程序版本)
*/
function GetBlackStyle()
{
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)",
EmptyBarBGColor:'rgb(0,0,0)', //空心柱子背景色
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)',
IndexTitleColor:"rgb(101,104,112)",
OverlayIndexTitleBGColor:'rgba(0,0,0,0.7)', //叠加指标背景色
DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
UpTextColor: "rgb(238,21,21)",
DownTextColor: "rgb(25,158,0)",
UnchagneTextColor: "rgb(101,104,112)",
CloseLineColor: 'rgb(178,34,34)',
IndexTitle:
{
UpDownArrow: //数值涨跌箭头
{
//UpColor:"rgb(238,21,21)", //上涨
//DownColor:"rgb(25,158,0)", //下跌
UnchangeColor:"rgb(190, 190 ,190)" //不变
},
//NameArrow:{ Color:"rgb(190, 190 ,190)", Space:2, Symbol:'▼' },
},
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',
}
}
},
PriceGapStyple:
{
Line:{ Color:"rgb(128,128,128)" },
Text:{ Color:"rgb(219,220,220)", Font:`12px 微软雅黑` }
},
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(41,98,255)"
],
PointColor:
[
"rgb(41,98,255)", //选中颜色
"rgb(89,135,255)", //moveon颜色
"rgb(0,0,0)" //空心点背景色
],
},
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 //单行高度
}
},
//报价列表
Report:
{
BorderColor:'rgb(38,38,41)', //边框线
SelectedColor:"rgb(49,48,56)", //选中行
Header:
{
Color:"rgb(245,245,245)",
SortColor:"rgb(255,0,0)",
Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
Font:{ Size:15, Name:"微软雅黑" }
},
Item:
{
Mergin:{ Top:2, Bottom:0,Left:5, Right:5 },
Font:{ Size:15, Name:"微软雅黑"},
BarMergin:{ Top:2, Left:3, Right:3, Bottom:2 },
NameFont:{ Size:14, Name:"微软雅黑" },
SymbolFont:{ Size:12, Name:"微软雅黑" }
},
//固定行
FixedItem:
{
Font:{ Size:15, Name:"微软雅黑"},
},
LimitBorder:
{
Color:"rgb(64,64,64)",
Mergin:{ Top:1, Bottom:1,Left:0, Right:0 },
},
FieldColor:
{
Index:"rgb(245,245,245)", //序号
Symbol:"rgb(255,255,255)",
Name:"rgb(255,255,255)",
Amount:"rgb(2,226,244)", //成交金额
Vol:"rgb(192,192,0)", //成交量
BarTitle:'rgb(245,245,245)', //柱子文字
Text:"rgb(245,245,245)", //默认文本
},
UpTextColor:"rgb(238,21,21)", //上涨文字颜色
DownTextColor:"rgb(25,158,0)", //下跌文字颜色
UnchagneTextColor:"rgb(228,228,228)", //平盘文字颜色
PageInfo:
{
Font:{ Size:15, Name:"微软雅黑"},
TextColor:"rgb(255,255,255)",
BGColor:"rgba(49,48,56,0.8)",
Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
}
}
};
return BLACK_STYLE;
}
function GetWhiteStyle()
{
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)",
NightDay:
{
NightBGColor:"rgb(22,22,22)",
Font:`12px 微软雅黑`,
Day: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
Night: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
}
},
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)',
IndexTitle:
{
UpDownArrow: //数值涨跌箭头
{
UpColor:"rgb(238,21,21)", //上涨
DownColor:"rgb(25,158,0)", //下跌
UnchangeColor:"rgb(0, 0 ,0)" //不变
},
NameArrow:{ Color:"rgb(190, 190 ,190)", Space:2, Symbol:'▼' },
},
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)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //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)",
},
}
return WHITE_STYLE;
}
var STYLE_TYPE_ID=
{
BLACK_ID:1, //黑色风格
WHITE_ID:2 //白色风格
}
function GetStyleConfig(styleid) //获取一个风格的配置变量
{
switch (styleid)
{
case STYLE_TYPE_ID.BLACK_ID:
return GetBlackStyle();
case STYLE_TYPE_ID.WHITE_ID:
return GetWhiteStyle();
default:
return null;
}
}
var JSCommonHQStyle=
{
GetStyleConfig:GetStyleConfig,
STYLE_TYPE_ID:STYLE_TYPE_ID
};
export
{
JSCommonHQStyle
}
/*
module.exports =
{
JSCommonHQStyle:
{
GetStyleConfig:GetStyleConfig,
STYLE_TYPE_ID:STYLE_TYPE_ID
}
};
*/

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

@ -0,0 +1,107 @@
/*
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.GetCanvasFont=function(canvas)
{
return canvas.font;
}
JSUniAppCanvasHelper.MeasureText=function(text, canvas)
{
var font= JSUniAppCanvasHelper.GetCanvasFont(canvas);
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 += 2.7;
}
else if (/-/.test(item))
{
width += 3.25;
}
else if (/_/.test(item))
{
width += 4.5;
}
else if (/[\u4e00-\u9fa5]/.test(item))
{
width += 10;
}
else if (/\(|\)/.test(item))
{
width += 3.73;
}
else if (/\s/.test(item)) //空格
{
width += 3.25;
}
else if (/%/.test(item))
{
width += 8;
}
else if (/:/.test(item))
{
width += 3.25;
}
else
{
width += 10;
}
}
return width * fontSize / 10;
}
//导出统一使用JSCommon命名空间名
var JSCommonUniApp=
{
JSUniAppCanvasHelper: JSUniAppCanvasHelper,
};
export
{
JSCommonUniApp
}
/*
module.exports =
{
JSCommonUniApp:
{
JSUniAppCanvasHelper: JSUniAppCanvasHelper,
}
};
*/

139407
uni_modules/jones-hqchart2/js_sdk/umychart.uniapp.h5.js
File diff suppressed because it is too large
View File

36
uni_modules/jones-hqchart2/js_sdk/umychart.version.wechat.js

@ -0,0 +1,36 @@
/********************************************************************************
* 版本信息输出
*
*/
var HQCHART_VERSION="1.1.14068";
function PrintHQChartVersion()
{
var log=
`*************************************************************************************************************
*
* HQChart Ver: ${HQCHART_VERSION}
*
* License: Apache License 2.0
* Source: https://github.com/jones2000/HQChart
*
*************************************************************************************************************
`
console.log(log);
}
PrintHQChartVersion();
export
{
HQCHART_VERSION
}

13463
uni_modules/jones-hqchart2/js_sdk/umychart.wechat.3.0.js
File diff suppressed because it is too large
View File

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. 如本协议中的任何条款完全或部分无效,本协议的其余条款仍有效并且有约束力

78
uni_modules/jones-hqchart2/package.json

@ -0,0 +1,78 @@
{
"id": "jones-hqchart2",
"displayName": "K线 分时 通达信指标 深度图 报价列表 订单流 筹码分布 hqchart.v2",
"version": "1.1.14084",
"description": "HQChart - H5, 微信小程序 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据替换接口",
"keywords": [
"jones-hqchart2"
],
"repository": "https://github.com/jones2000/HQChart",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/hqchart",
"type": "sdk-js"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"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",
"字节跳动": "y",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

293
uni_modules/jones-hqchart2/readme.md

@ -0,0 +1,293 @@
# 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)
- [HQChart商业使用说明及用户使用协议](https://blog.csdn.net/jones2000/article/details/123170153)
# 交流
前端技术交流群:在github首页里
有问题也可以直接github上发issue.
# demo说明
* 示例DEMO都是Vue2的版本, 如果需要Vue3的示例demo,可以去QQ群文件下载。
* hqchart2_test3 内置组件模式 支持H5, APP, 微信小程序
* hqchart2_test 单画布模式 支持H5, APP, 微信小程序
* hqchart2_test2 多画布模式 支持H5, APP,
* hqchart2_template 如何在外部封装hqchart模板 支持H5, APP, 微信小程序
* hqchart2_renderjs 使用renderjs创建hqchart, 直接使用npm hqchart
第3放数据对接案例:
- 源码地址:[https://github.com/jones2000/HQChart-Super](https://github.com/jones2000/HQChart-Super)
- 镜像地址:[https://gitee.com/jones2000/HQChart-Super](https://gitee.com/jones2000/HQChart-Super)
> 功能:
# 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. 走势图
- 支持指标
- 支持股票叠加
- 支持沪深和港股,国内期货(开发中)
- 分钟数据显示
- 支持多日分钟数据显示
-
# 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)
## 钉钉小程序
1. [HQChart钉钉小程序教程1-创建K线图](https://blog.csdn.net/jones2000/article/details/125226287)<br>
## 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)
9. [HQChart实战教程40-如何制作hqchart组件(uniapp版本)](https://blog.csdn.net/jones2000/article/details/116034602)
10. [HQChart使用教程100-uniapp如何在vue3运行微信小程序](https://jones2000.blog.csdn.net/article/details/139309202)
## 第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)
## 第3方数据前端接入教程(分笔明细)
1. [HQChart使用教程93-分笔明细表对接第3方数据1-全量分笔明细数据](https://blog.csdn.net/jones2000/article/details/124362666)<br>
2. [HQChart使用教程93-分笔明细表对接第3方数据2-增量分笔明细数据](https://jones2000.blog.csdn.net/article/details/124362858)<br>
## 第3方数据前端接入教程(报价列表)
1. [HQChart使用教程95-报价列表对接第3方数据1-码表数据](https://jones2000.blog.csdn.net/article/details/124567637)<br>
2. [HQChart使用教程95-报价列表对接第3方数据2-板块成分数据](https://jones2000.blog.csdn.net/article/details/124572386)<br>
3. [HQChart使用教程95-报价列表对接第3方数据3-股票数据](https://jones2000.blog.csdn.net/article/details/124578516)<br>
4. [HQChart使用教程95-报价列表对接第3方数据4-股票排序数据](https://jones2000.blog.csdn.net/article/details/124579725)<br>
## 实战教程
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对接火币完整教程](https://jones2000.github.io/HQChart/document/huobi_demo.html)
2. [HQChart对接欧易完整教程](https://jones2000.github.io/HQChart/document/okx_demo.html)
## 币安对接(源码收费)
1. [HQChart实战教程36-数字货币安币对接-uniapp版本](https://jones2000.github.io/HQChart/document/uniapp_binance.html)
2. [HQChart实战教程41-新浪+腾讯A股数据源对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/117139756)
3. [HQChart实战教程42-新浪期货数据源对接-uniapp版本](https://blog.csdn.net/jones2000/article/details/117757956)
## 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)
15. [HQChart实战教程43 - K线面积图最后一个数据增加动画点](https://jones2000.blog.csdn.net/article/details/118774299)<br>
16. [HQChart实战教程44 - 多指标窗口动态增长高度](https://jones2000.blog.csdn.net/article/details/119188383)<br>
17. [HQChart实战教程46 - 十字光标右侧按钮点击增加刻度线](https://jones2000.blog.csdn.net/article/details/120563461)<br>
18. [HQChart实战教程48 - 远程指标获取当前屏K线的范围](https://jones2000.blog.csdn.net/article/details/121913369)<br>
19. [HQChart实战教程49 - 点击修改K线颜色及背景色](https://jones2000.blog.csdn.net/article/details/121938122)<br>
20. [HQChart实战教程50 - 自定义指标栏工具按钮](https://blog.csdn.net/jones2000/article/details/122950050)<br>
21. [HQChart实战教程51 - 自定义指标列表](https://blog.csdn.net/jones2000/article/details/123538617)<br>
22. [HQChart实战教程52 - APP中使用DRAWICON绘制图标](https://jones2000.blog.csdn.net/article/details/124142225)<br>
23. [HQChart实战教程53 - 动态指定标识K线区间段背景颜色](https://blog.csdn.net/jones2000/article/details/124558493)<br>
## 设计文档:
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>

2
vue.config.js

@ -2,7 +2,7 @@ module.exports = {
devServer: {
proxy: {
'/api': { // 你的目标服务器的请求路径前缀
target: 'https://hwjb.homilychart.com', // 目标服务器的地址
target: 'https://dbqb.nfdxy.net/testApi', // 目标服务器的地址
changeOrigin: true, // 是否跨域
secure: false, // 如果是https接口,需要配置这个参数
pathRewrite: {

Loading…
Cancel
Save