Files
finance-talk/振幅锁仓策略/回测对比.html
T

144 lines
22 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FG 回测对比 · 开盘 vs 收盘</title>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.0/dist/echarts.min.js"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0f172a; color: #e2e8f0; padding: 24px; }
.wrap { max-width: 1200px; margin: 0 auto; }
h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.sub { font-size: 13px; color: #64748b; margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.card { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 16px 20px; }
.card .label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.card .vals { display: flex; gap: 24px; margin-top: 6px; }
.card .val { }
.card .val .v { font-size: 22px; font-weight: 700; }
.card .val .tag { font-size: 10px; color: #64748b; }
.v-open { color: #22c55e; }
.v-close { color: #22c55e; }
#chart { width: 100%; height: 500px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; }
.footer { margin-top: 20px; font-size: 12px; color: #475569; }
</style>
</head>
<body>
<div class="wrap">
<h1>玻璃期货 FG 主连 · 开盘 vs 收盘 入场合一视图</h1>
<p class="sub">累仓+3锁清仓策略 · 2024-01-02 → 2026-07-22 · 唯一变量:开仓价取开盘价 / 收盘价</p>
<div class="cards">
<div class="card">
<div class="label">总盈亏</div>
<div class="vals">
<div class="val"><div class="v v-open">+23.26万</div><div class="tag">开盘入场</div></div>
<div class="val"><div class="v v-close">+18.93万</div><div class="tag">收盘入场</div></div>
</div>
</div>
<div class="card">
<div class="label">最大回撤</div>
<div class="vals">
<div class="val"><div class="v v-open" style="font-size:18px">0.31万</div><div class="tag">开盘入场</div></div>
<div class="val"><div class="v v-close" style="font-size:18px">0.42万</div><div class="tag">收盘入场</div></div>
</div>
</div>
<div class="card">
<div class="label">差异</div>
<div class="vals">
<div class="val"><div class="v" style="color:#fbbf24; font-size:18px">+4.33万</div><div class="tag">开盘 收盘</div></div>
<div class="val"><div class="v" style="color:#fbbf24; font-size:18px">+18.6%</div><div class="tag">相对差异</div></div>
</div>
</div>
</div>
<div id="chart"></div>
<div class="footer">
策略: 每日累加1手空单 · 止盈=总浮盈≥5日均振幅 · 单笔锁仓=亏损达该手开仓时振幅 · 累计3锁清仓重来 · 生成 2026-07-23
</div>
</div>
<script>
var data = {"dates": ["2024-01-02", "2024-01-03", "2024-01-04", "2024-01-05", "2024-01-08", "2024-01-09", "2024-01-10", "2024-01-11", "2024-01-12", "2024-01-15", "2024-01-16", "2024-01-17", "2024-01-18", "2024-01-19", "2024-01-22", "2024-01-23", "2024-01-24", "2024-01-25", "2024-01-26", "2024-01-29", "2024-01-30", "2024-01-31", "2024-02-01", "2024-02-02", "2024-02-05", "2024-02-06", "2024-02-07", "2024-02-08", "2024-02-19", "2024-02-20", "2024-02-21", "2024-02-22", "2024-02-23", "2024-02-26", "2024-02-27", "2024-02-28", "2024-02-29", "2024-03-01", "2024-03-04", "2024-03-05", "2024-03-06", "2024-03-07", "2024-03-08", "2024-03-11", "2024-03-12", "2024-03-13", "2024-03-14", "2024-03-15", "2024-03-18", "2024-03-19", "2024-03-20", "2024-03-21", "2024-03-22", "2024-03-25", "2024-03-26", "2024-03-27", "2024-03-28", "2024-03-29", "2024-04-01", "2024-04-02", "2024-04-03", "2024-04-08", "2024-04-09", "2024-04-10", "2024-04-11", "2024-04-12", "2024-04-15", "2024-04-16", "2024-04-17", "2024-04-18", "2024-04-19", "2024-04-22", "2024-04-23", "2024-04-24", "2024-04-25", "2024-04-26", "2024-04-29", "2024-04-30", "2024-05-06", "2024-05-07", "2024-05-08", "2024-05-09", "2024-05-10", "2024-05-13", "2024-05-14", "2024-05-15", "2024-05-16", "2024-05-17", "2024-05-20", "2024-05-21", "2024-05-22", "2024-05-23", "2024-05-24", "2024-05-27", "2024-05-28", "2024-05-29", "2024-05-30", "2024-05-31", "2024-06-03", "2024-06-04", "2024-06-05", "2024-06-06", "2024-06-07", "2024-06-11", "2024-06-12", "2024-06-13", "2024-06-14", "2024-06-17", "2024-06-18", "2024-06-19", "2024-06-20", "2024-06-21", "2024-06-24", "2024-06-25", "2024-06-26", "2024-06-27", "2024-06-28", "2024-07-01", "2024-07-02", "2024-07-03", "2024-07-04", "2024-07-05", "2024-07-08", "2024-07-09", "2024-07-10", "2024-07-11", "2024-07-12", "2024-07-15", "2024-07-16", "2024-07-17", "2024-07-18", "2024-07-19", "2024-07-22", "2024-07-23", "2024-07-24", "2024-07-25", "2024-07-26", "2024-07-29", "2024-07-30", "2024-07-31", "2024-08-01", "2024-08-02", "2024-08-05", "2024-08-06", "2024-08-07", "2024-08-08", "2024-08-09", "2024-08-12", "2024-08-13", "2024-08-14", "2024-08-15", "2024-08-16", "2024-08-19", "2024-08-20", "2024-08-21", "2024-08-22", "2024-08-23", "2024-08-26", "2024-08-27", "2024-08-28", "2024-08-29", "2024-08-30", "2024-09-02", "2024-09-03", "2024-09-04", "2024-09-05", "2024-09-06", "2024-09-09", "2024-09-10", "2024-09-11", "2024-09-12", "2024-09-13", "2024-09-18", "2024-09-19", "2024-09-20", "2024-09-23", "2024-09-24", "2024-09-25", "2024-09-26", "2024-09-27", "2024-09-30", "2024-10-08", "2024-10-09", "2024-10-10", "2024-10-11", "2024-10-14", "2024-10-15", "2024-10-16", "2024-10-17", "2024-10-18", "2024-10-21", "2024-10-22", "2024-10-23", "2024-10-24", "2024-10-25", "2024-10-28", "2024-10-29", "2024-10-30", "2024-10-31", "2024-11-01", "2024-11-04", "2024-11-05", "2024-11-06", "2024-11-07", "2024-11-08", "2024-11-11", "2024-11-12", "2024-11-13", "2024-11-14", "2024-11-15", "2024-11-18", "2024-11-19", "2024-11-20", "2024-11-21", "2024-11-22", "2024-11-25", "2024-11-26", "2024-11-27", "2024-11-28", "2024-11-29", "2024-12-02", "2024-12-03", "2024-12-04", "2024-12-05", "2024-12-06", "2024-12-09", "2024-12-10", "2024-12-11", "2024-12-12", "2024-12-13", "2024-12-16", "2024-12-17", "2024-12-18", "2024-12-19", "2024-12-20", "2024-12-23", "2024-12-24", "2024-12-25", "2024-12-26", "2024-12-27", "2024-12-30", "2024-12-31", "2025-01-02", "2025-01-03", "2025-01-06", "2025-01-07", "2025-01-08", "2025-01-09", "2025-01-10", "2025-01-13", "2025-01-14", "2025-01-15", "2025-01-16", "2025-01-17", "2025-01-20", "2025-01-21", "2025-01-22", "2025-01-23", "2025-01-24", "2025-01-27", "2025-02-05", "2025-02-06", "2025-02-07", "2025-02-10", "2025-02-11", "2025-02-12", "2025-02-13", "2025-02-14", "2025-02-17", "2025-02-18", "2025-02-19", "2025-02-20", "2025-02-21", "2025-02-24", "2025-02-25", "2025-02-26", "2025-02-27", "2025-02-28", "2025-03-03", "2025-03-04", "2025-03-05", "2025-03-06", "2025-03-07", "2025-03-10", "2025-03-11", "2025-03-12", "2025-03-13", "2025-03-14", "2025-03-17", "2025-03-18", "2025-03-19", "2025-03-20", "2025-03-21", "2025-03-24", "2025-03-25", "2025-03-26", "2025-03-27", "2025-03-28", "2025-03-31", "2025-04-01", "2025-04-02", "2025-04-03", "2025-04-07", "2025-04-08", "2025-04-09", "2025-04-10", "2025-04-11", "2025-04-14", "2025-04-15", "2025-04-16", "2025-04-17", "2025-04-18", "2025-04-21", "2025-04-22", "2025-04-23", "2025-04-24", "2025-04-25", "2025-04-28", "2025-04-29", "2025-04-30", "2025-05-06", "2025-05-07", "2025-05-08", "2025-05-09", "2025-05-12", "2025-05-13", "2025-05-14", "2025-05-15", "2025-05-16", "2025-05-19", "2025-05-20", "2025-05-21", "2025-05-22", "2025-05-23", "2025-05-26", "2025-05-27", "2025-05-28", "2025-05-29", "2025-05-30", "2025-06-03", "2025-06-04", "2025-06-05", "2025-06-06", "2025-06-09", "2025-06-10", "2025-06-11", "2025-06-12", "2025-06-13", "2025-06-16", "2025-06-17", "2025-06-18", "2025-06-19", "2025-06-20", "2025-06-23", "2025-06-24", "2025-06-25", "2025-06-26", "2025-06-27", "2025-06-30", "2025-07-01", "2025-07-02", "2025-07-03", "2025-07-04", "2025-07-07", "2025-07-08", "2025-07-09", "2025-07-10", "2025-07-11", "2025-07-14", "2025-07-15", "2025-07-16", "2025-07-17", "2025-07-18", "2025-07-21", "2025-07-22", "2025-07-23", "2025-07-24", "2025-07-25", "2025-07-28", "2025-07-29", "2025-07-30", "2025-07-31", "2025-08-01", "2025-08-04", "2025-08-05", "2025-08-06", "2025-08-07", "2025-08-08", "2025-08-11", "2025-08-12", "2025-08-13", "2025-08-14", "2025-08-15", "2025-08-18", "2025-08-19", "2025-08-20", "2025-08-21", "2025-08-22", "2025-08-25", "2025-08-26", "2025-08-27", "2025-08-28", "2025-08-29", "2025-09-01", "2025-09-02", "2025-09-03", "2025-09-04", "2025-09-05", "2025-09-08", "2025-09-09", "2025-09-10", "2025-09-11", "2025-09-12", "2025-09-15", "2025-09-16", "2025-09-17", "2025-09-18", "2025-09-19", "2025-09-22", "2025-09-23", "2025-09-24", "2025-09-25", "2025-09-26", "2025-09-29", "2025-09-30", "2025-10-09", "2025-10-10", "2025-10-13", "2025-10-14", "2025-10-15", "2025-10-16", "2025-10-17", "2025-10-20", "2025-10-21", "2025-10-22", "2025-10-23", "2025-10-24", "2025-10-27", "2025-10-28", "2025-10-29", "2025-10-30", "2025-10-31", "2025-11-03", "2025-11-04", "2025-11-05", "2025-11-06", "2025-11-07", "2025-11-10", "2025-11-11", "2025-11-12", "2025-11-13", "2025-11-14", "2025-11-17", "2025-11-18", "2025-11-19", "2025-11-20", "2025-11-21", "2025-11-24", "2025-11-25", "2025-11-26", "2025-11-27", "2025-11-28", "2025-12-01", "2025-12-02", "2025-12-03", "2025-12-04", "2025-12-05", "2025-12-08", "2025-12-09", "2025-12-10", "2025-12-11", "2025-12-12", "2025-12-15", "2025-12-16", "2025-12-17", "2025-12-18", "2025-12-19", "2025-12-22", "2025-12-23", "2025-12-24", "2025-12-25", "2025-12-26", "2025-12-29", "2025-12-30", "2025-12-31", "2026-01-05", "2026-01-06", "2026-01-07", "2026-01-08", "2026-01-09", "2026-01-12", "2026-01-13", "2026-01-14", "2026-01-15", "2026-01-16", "2026-01-19", "2026-01-20", "2026-01-21", "2026-01-22", "2026-01-23", "2026-01-26", "2026-01-27", "2026-01-28", "2026-01-29", "2026-01-30", "2026-02-02", "2026-02-03", "2026-02-04", "2026-02-05", "2026-02-06", "2026-02-09", "2026-02-10", "2026-02-11", "2026-02-12", "2026-02-13", "2026-02-24", "2026-02-25", "2026-02-26", "2026-02-27", "2026-03-02", "2026-03-03", "2026-03-04", "2026-03-05", "2026-03-06", "2026-03-09", "2026-03-10", "2026-03-11", "2026-03-12", "2026-03-13", "2026-03-16", "2026-03-17", "2026-03-18", "2026-03-19", "2026-03-20", "2026-03-23", "2026-03-24", "2026-03-25", "2026-03-26", "2026-03-27", "2026-03-30", "2026-03-31", "2026-04-01", "2026-04-02", "2026-04-03", "2026-04-07", "2026-04-08", "2026-04-09", "2026-04-10", "2026-04-13", "2026-04-14", "2026-04-15", "2026-04-16", "2026-04-17", "2026-04-20", "2026-04-21", "2026-04-22", "2026-04-23", "2026-04-24", "2026-04-27", "2026-04-28", "2026-04-29", "2026-04-30", "2026-05-06", "2026-05-07", "2026-05-08", "2026-05-11", "2026-05-12", "2026-05-13", "2026-05-14", "2026-05-15", "2026-05-18", "2026-05-19", "2026-05-20", "2026-05-21", "2026-05-22", "2026-05-25", "2026-05-26", "2026-05-27", "2026-05-28", "2026-05-29", "2026-06-01", "2026-06-02", "2026-06-03", "2026-06-04", "2026-06-05", "2026-06-08", "2026-06-09", "2026-06-10", "2026-06-11", "2026-06-12", "2026-06-15", "2026-06-16", "2026-06-17", "2026-06-18", "2026-06-22", "2026-06-23", "2026-06-24", "2026-06-25", "2026-06-26", "2026-06-29", "2026-06-30", "2026-07-01", "2026-07-02", "2026-07-03", "2026-07-06", "2026-07-07", "2026-07-08", "2026-07-09", "2026-07-10", "2026-07-13", "2026-07-14", "2026-07-15", "2026-07-16", "2026-07-17", "2026-07-20", "2026-07-21", "2026-07-22"], "open": [0.0, 0.0, 0.0, 0.25, 0.25, 0.41, 0.64, 0.64, 0.88, 0.88, 0.88, 0.88, 1.1, 1.1, 1.1, 1.1, 1.1, 0.91, 0.91, 0.91, 0.91, 0.91, 1.17, 1.17, 1.17, 1.29, 1.29, 1.29, 1.49, 1.59, 1.59, 1.59, 1.59, 1.79, 1.79, 2.02, 2.02, 2.02, 2.25, 2.25, 2.25, 2.47, 2.47, 2.72, 2.72, 2.72, 2.9, 2.9, 3.17, 3.17, 3.17, 3.17, 3.32, 3.32, 3.48, 3.48, 3.6, 3.6, 3.6, 3.7, 3.7, 3.7, 3.7, 3.54, 3.54, 3.66, 3.76, 3.76, 3.76, 3.76, 3.76, 3.76, 3.76, 3.68, 3.68, 3.68, 3.86, 3.86, 3.86, 3.86, 3.86, 3.86, 3.56, 3.56, 3.75, 3.75, 3.75, 3.75, 3.75, 3.75, 3.75, 3.75, 3.59, 3.59, 3.72, 3.72, 3.72, 3.72, 4.15, 4.15, 4.15, 4.15, 3.94, 4.04, 4.04, 4.25, 4.25, 4.5, 4.5, 4.5, 4.65, 4.65, 4.87, 4.87, 4.87, 5.03, 5.03, 5.03, 5.03, 5.03, 5.03, 5.3, 5.38, 5.38, 5.55, 5.55, 5.55, 5.75, 5.75, 5.84, 5.84, 5.9, 5.9, 6.02, 6.02, 6.12, 6.12, 6.38, 6.38, 6.48, 6.48, 6.61, 6.61, 6.75, 6.75, 6.87, 6.87, 6.87, 7.01, 7.1, 7.1, 7.1, 7.22, 7.22, 7.22, 7.38, 7.38, 7.5, 7.5, 7.5, 7.5, 7.5, 8.28, 8.28, 8.47, 8.47, 8.47, 8.72, 8.72, 8.9, 9.03, 9.03, 9.14, 9.14, 9.14, 9.14, 9.05, 9.05, 9.05, 9.05, 8.84, 9.15, 9.15, 9.38, 9.38, 9.38, 9.2, 9.2, 9.71, 9.71, 9.71, 9.71, 9.71, 9.54, 9.54, 9.54, 9.54, 9.54, 9.54, 9.54, 10.16, 10.16, 10.16, 10.16, 10.31, 10.31, 10.49, 10.49, 10.68, 10.68, 10.9, 10.9, 10.9, 10.9, 11.0, 11.0, 11.1, 11.1, 11.1, 11.1, 11.1, 11.1, 11.27, 11.39, 11.39, 11.39, 11.39, 11.39, 11.39, 11.25, 11.34, 11.34, 11.34, 11.34, 11.34, 11.46, 11.46, 11.56, 11.56, 11.65, 11.65, 11.74, 11.74, 11.74, 11.79, 11.79, 11.97, 11.97, 11.97, 11.97, 11.97, 11.97, 11.9, 11.9, 12.05, 12.05, 12.15, 12.15, 12.22, 12.3, 12.3, 12.3, 12.3, 12.45, 12.45, 12.56, 12.67, 12.67, 12.76, 12.76, 12.76, 12.76, 12.9, 12.9, 13.03, 13.03, 13.11, 13.11, 13.19, 13.19, 13.32, 13.32, 13.43, 13.51, 13.51, 13.51, 13.62, 13.62, 13.62, 13.62, 13.62, 13.62, 13.62, 13.5, 13.5, 13.61, 13.61, 13.76, 13.76, 13.76, 13.76, 13.76, 13.93, 13.93, 14.14, 14.14, 14.27, 14.27, 14.27, 14.27, 14.36, 14.44, 14.44, 14.44, 14.44, 14.44, 14.44, 14.44, 14.65, 14.71, 14.71, 14.71, 14.9, 14.9, 14.99, 15.06, 15.06, 15.06, 15.15, 15.15, 15.15, 15.15, 15.21, 15.21, 15.21, 15.21, 15.21, 15.36, 15.36, 15.47, 15.47, 15.47, 15.47, 15.35, 15.35, 15.35, 15.47, 15.47, 15.52, 15.52, 15.52, 15.52, 15.52, 15.52, 15.52, 15.52, 15.52, 15.52, 15.41, 15.47, 15.47, 15.47, 15.47, 15.55, 15.55, 15.55, 15.55, 15.55, 15.55, 15.75, 15.75, 15.75, 15.75, 15.6, 15.6, 15.6, 15.5, 15.5, 15.94, 15.94, 15.94, 16.46, 16.46, 16.66, 16.66, 16.66, 16.78, 16.78, 16.87, 16.87, 16.87, 16.87, 16.87, 17.03, 17.03, 17.29, 17.29, 17.29, 17.29, 17.29, 17.29, 17.35, 17.35, 17.57, 17.57, 17.57, 17.67, 17.67, 17.67, 17.67, 17.8, 17.8, 17.8, 17.8, 17.71, 17.71, 17.84, 17.84, 17.94, 17.94, 17.94, 17.94, 17.94, 18.08, 18.08, 18.18, 18.18, 18.41, 18.5, 18.5, 18.5, 18.79, 18.79, 18.79, 18.91, 18.91, 18.91, 18.99, 18.99, 18.99, 19.08, 19.08, 19.08, 19.08, 19.08, 19.08, 19.08, 19.4, 19.4, 19.46, 19.46, 19.56, 19.56, 19.62, 19.62, 19.74, 19.79, 19.79, 19.79, 19.79, 19.7, 19.7, 19.79, 19.79, 19.87, 19.87, 19.97, 19.97, 20.05, 20.1, 20.1, 20.21, 20.21, 20.21, 20.21, 20.17, 20.17, 20.27, 20.27, 20.27, 20.27, 20.27, 20.27, 20.16, 20.16, 20.23, 20.23, 20.23, 20.23, 20.23, 20.32, 20.42, 20.42, 20.49, 20.49, 20.49, 20.49, 20.67, 20.67, 20.67, 20.67, 20.67, 20.67, 20.67, 20.8, 20.8, 20.8, 20.74, 20.74, 20.86, 20.86, 20.86, 20.95, 20.95, 21.05, 21.05, 21.05, 21.05, 21.05, 21.26, 21.26, 21.26, 21.26, 21.26, 21.26, 21.26, 21.26, 21.18, 21.18, 21.3, 21.3, 21.41, 21.41, 21.49, 21.49, 21.49, 21.49, 21.67, 21.67, 21.67, 21.81, 21.81, 21.91, 21.96, 21.96, 22.01, 22.01, 22.08, 22.08, 22.08, 22.08, 22.1, 22.1, 22.1, 22.1, 22.1, 22.04, 22.04, 22.09, 22.16, 22.16, 22.16, 22.16, 22.06, 22.06, 22.12, 22.12, 22.12, 22.25, 22.25, 22.34, 22.34, 22.44, 22.44, 22.44, 22.4, 22.4, 22.4, 22.4, 22.4, 22.4, 22.4, 22.4, 22.58, 22.63, 22.63, 22.67, 22.67, 22.71, 22.71, 22.71, 22.71, 22.71, 22.83, 22.83, 22.88, 22.88, 22.88, 22.97, 22.97, 23.01, 23.04, 23.04, 23.04, 23.04, 23.04, 23.04, 23.11, 23.11, 23.11, 23.11, 23.15, 23.19, 23.26, 23.26, 23.26, 23.26], "close": [0.0, 0.19, 0.19, 0.19, 0.53, 0.53, 0.77, 0.77, 0.96, 0.96, 0.96, 0.96, 1.18, 1.18, 1.18, 1.18, 1.3, 1.3, 1.4, 1.4, 1.4, 1.4, 1.6, 1.6, 1.6, 1.76, 1.76, 1.76, 2.1, 2.1, 2.1, 2.1, 2.1, 2.2, 2.2, 2.35, 2.35, 2.35, 2.6, 2.6, 2.6, 2.74, 2.74, 2.9, 2.9, 2.9, 3.06, 3.06, 3.22, 3.22, 3.22, 3.34, 3.34, 3.48, 3.48, 3.48, 3.59, 3.59, 3.72, 3.72, 3.72, 3.72, 3.83, 3.83, 3.83, 3.99, 3.99, 3.99, 4.13, 4.23, 4.23, 4.23, 4.23, 4.23, 4.07, 4.07, 4.21, 4.21, 4.21, 4.21, 4.21, 4.21, 4.21, 4.21, 4.48, 4.48, 4.57, 4.67, 4.67, 4.67, 4.67, 4.67, 4.62, 4.62, 4.62, 4.62, 4.62, 4.62, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.41, 5.41, 5.55, 5.55, 5.55, 5.7, 5.7, 5.83, 5.83, 5.93, 5.93, 6.05, 6.05, 6.12, 6.12, 6.12, 6.35, 6.35, 6.35, 6.35, 6.35, 6.35, 6.5, 6.5, 6.57, 6.57, 6.65, 6.65, 6.65, 6.65, 6.75, 6.75, 6.75, 6.75, 6.75, 6.64, 6.64, 6.75, 6.75, 6.75, 6.88, 6.88, 7.01, 7.01, 7.01, 7.01, 7.01, 7.01, 6.96, 6.96, 7.12, 7.12, 7.21, 7.21, 7.21, 7.32, 7.32, 7.49, 7.49, 7.49, 7.49, 7.63, 7.63, 7.63, 7.88, 7.88, 7.88, 7.88, 7.88, 7.88, 7.76, 7.88, 7.88, 7.88, 7.88, 7.73, 7.73, 7.73, 7.73, 7.73, 7.73, 7.46, 7.46, 7.71, 7.71, 7.71, 7.71, 7.71, 7.8, 7.8, 7.8, 7.8, 8.02, 8.02, 8.02, 8.38, 8.38, 8.38, 8.58, 8.58, 8.58, 8.58, 8.58, 8.75, 8.75, 8.75, 8.86, 8.86, 8.86, 9.01, 9.01, 9.12, 9.12, 9.12, 9.12, 9.14, 9.14, 9.23, 9.23, 9.23, 9.23, 9.16, 9.16, 9.16, 9.16, 9.23, 9.23, 9.23, 9.23, 9.23, 9.23, 9.23, 9.23, 9.51, 9.51, 9.58, 9.58, 9.58, 9.65, 9.65, 9.65, 9.65, 9.65, 9.65, 9.59, 9.59, 9.59, 9.59, 9.59, 9.59, 9.59, 9.79, 9.79, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 10.01, 10.01, 10.01, 10.01, 10.01, 10.01, 10.01, 9.87, 9.87, 9.94, 9.94, 10.02, 10.02, 10.09, 10.09, 10.17, 10.17, 10.24, 10.24, 10.24, 10.24, 10.24, 10.24, 10.18, 10.18, 10.18, 10.18, 10.18, 10.17, 10.17, 10.17, 10.17, 10.33, 10.33, 10.33, 10.33, 10.33, 10.68, 10.68, 10.86, 10.86, 10.86, 10.86, 10.76, 10.76, 10.76, 10.99, 10.99, 10.99, 10.99, 10.99, 11.07, 11.07, 11.13, 11.13, 11.13, 11.13, 11.21, 11.21, 11.28, 11.28, 11.28, 11.28, 11.39, 11.39, 11.39, 11.44, 11.44, 11.44, 11.44, 11.4, 11.4, 11.48, 11.48, 11.54, 11.61, 11.61, 11.61, 11.61, 11.61, 11.61, 11.73, 11.73, 11.73, 11.79, 11.79, 11.79, 11.79, 11.79, 11.79, 11.79, 11.79, 11.67, 11.67, 11.67, 11.73, 11.73, 11.73, 11.82, 11.82, 11.82, 11.82, 11.67, 11.67, 11.79, 11.79, 11.79, 11.79, 11.71, 11.88, 11.88, 11.88, 11.88, 12.22, 12.22, 12.22, 12.57, 12.57, 12.57, 12.78, 12.78, 12.78, 12.95, 12.95, 13.09, 13.09, 13.09, 13.09, 13.09, 13.09, 13.59, 13.59, 13.59, 13.59, 13.59, 13.59, 13.78, 13.78, 13.92, 13.92, 13.92, 14.02, 14.13, 14.22, 14.22, 14.31, 14.31, 14.31, 14.43, 14.43, 14.43, 14.57, 14.57, 14.65, 14.65, 14.65, 14.65, 14.65, 14.75, 14.75, 14.75, 14.75, 14.97, 14.97, 14.97, 14.97, 15.09, 15.09, 15.09, 15.2, 15.2, 15.2, 15.29, 15.29, 15.29, 15.45, 15.45, 15.45, 15.45, 15.45, 15.45, 15.45, 15.72, 15.72, 15.72, 15.79, 15.79, 15.79, 15.79, 15.79, 15.96, 15.96, 15.96, 15.96, 15.94, 15.94, 15.94, 16.04, 16.04, 16.04, 16.17, 16.17, 16.17, 16.26, 16.26, 16.26, 16.37, 16.37, 16.37, 16.37, 16.32, 16.32, 16.38, 16.38, 16.38, 16.38, 16.47, 16.47, 16.47, 16.47, 16.47, 16.56, 16.66, 16.66, 16.76, 16.76, 16.85, 16.85, 16.85, 16.85, 16.93, 16.93, 16.93, 17.01, 17.01, 17.08, 17.08, 17.08, 17.08, 17.15, 17.15, 17.15, 17.15, 17.15, 17.15, 17.28, 17.28, 17.28, 17.35, 17.35, 17.35, 17.35, 17.35, 17.41, 17.41, 17.41, 17.41, 17.41, 17.4, 17.4, 17.4, 17.4, 17.31, 17.31, 17.31, 17.47, 17.47, 17.47, 17.53, 17.61, 17.61, 17.61, 17.78, 17.78, 17.78, 17.88, 17.88, 17.88, 17.88, 17.88, 17.88, 17.88, 17.99, 17.99, 17.99, 17.99, 17.99, 18.06, 18.06, 18.11, 18.11, 18.11, 18.11, 18.19, 18.19, 18.19, 18.19, 18.19, 18.12, 18.12, 18.17, 18.17, 18.17, 18.27, 18.27, 18.33, 18.33, 18.33, 18.33, 18.33, 18.3, 18.3, 18.3, 18.3, 18.3, 18.3, 18.3, 18.3, 18.45, 18.45, 18.45, 18.45, 18.45, 18.51, 18.51, 18.51, 18.51, 18.51, 18.66, 18.66, 18.66, 18.7, 18.7, 18.76, 18.76, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.84, 18.84, 18.84, 18.84, 18.88, 18.88, 18.93, 18.93, 18.93, 18.93, 18.93]};
var dates = data.dates;
var openData = data.open;
var closeData = data.close;
var chart = echarts.init(document.getElementById('chart'));
var option = {
backgroundColor: '#0f172a',
tooltip: {
trigger: 'axis',
backgroundColor: '#1e293b',
borderColor: '#334155',
textStyle: { color: '#e2e8f0', fontSize: 12 },
formatter: function(ps) {
var s = '<b>' + ps[0].axisValue + '</b><br/>';
ps.forEach(function(p) {
s += '<span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:' + p.color + ';margin-right:6px;"></span>';
s += p.seriesName + ': <b>' + (p.value >= 0 ? '+' : '') + p.value.toFixed(2) + '万</b><br/>';
});
return s;
}
},
legend: {
data: ['开盘入场', '收盘入场'],
top: 12,
textStyle: { color: '#94a3b8', fontSize: 13 },
itemWidth: 20, itemHeight: 3
},
grid: { top: 50, right: 40, bottom: 30, left: 60 },
xAxis: {
type: 'category',
data: dates,
axisLine: { lineStyle: { color: '#334155' } },
axisLabel: { color: '#64748b', fontSize: 10 },
axisTick: { show: false },
splitLine: { show: false }
},
yAxis: {
type: 'value',
name: '万元',
nameTextStyle: { color: '#64748b' },
axisLine: { show: false },
axisLabel: { color: '#64748b', fontSize: 10, formatter: '{value}' },
splitLine: { lineStyle: { color: '#1e293b' } }
},
series: [
{
name: '开盘入场',
type: 'line',
data: openData,
smooth: false,
symbol: 'none',
lineStyle: { color: '#4ade80', width: 1.5 },
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(74, 222, 128, 0.15)' },
{ offset: 1, color: 'rgba(74, 222, 128, 0.01)' }
])
}
},
{
name: '收盘入场',
type: 'line',
data: closeData,
smooth: false,
symbol: 'none',
lineStyle: { color: '#60a5fa', width: 1.5 },
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(96, 165, 250, 0.15)' },
{ offset: 1, color: 'rgba(96, 165, 250, 0.01)' }
])
}
}
]
};
chart.setOption(option);
window.addEventListener('resize', function() { chart.resize(); });
</script>
</body>
</html>