-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
79 lines (69 loc) · 3.16 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE HTML>
<html>
<head>
<title>TSEC Chart</title>
<meta charset="UTF-8">
<!-- Fix for iOS Safari zooming bug -->
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script type="text/javascript" src="charting_library/charting_library.min.js"></script>
<script type="text/javascript" src="datafeeds/udf/dist/polyfills.js"></script>
<script type="text/javascript" src="datafeeds/udf/dist/bundle.js"></script>
<script type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
TradingView.onready(function () {
var widget = window.tvWidget = new TradingView.widget({
debug: true,
fullscreen: true,
symbol: '2330',
interval: 'D',
container_id: "tv_chart_container",
datafeed: new Datafeeds.UDFCompatibleDatafeed(`https://raw.githubusercontent.com/Asoul/tsec/master`),
library_path: "charting_library/",
locale: getParameterByName('lang') || "zh_TW",
disabled_features: ["use_localstorage_for_settings"],
// enabled_features: ["study_templates"],
// charts_storage_url: 'http://saveload.tradingview.com',
// charts_storage_api_version: "1.1",
// client_id: 'tradingview.com',
// user_id: 'public_user_id',
theme: getParameterByName('theme'),
timezone: 'Asia/Taipei',
toolbar_bg: '#171B2B',
// time_frames: [
// {text: "2y", resolution: "6M", description: "2 Years", title: "2年"},
// {text: "1y", resolution: "1M", description: "1 Years", title: "1年"},
// {text: "3m", resolution: "1W", description: "3 Month", title: "3月"},
// ],
theme: 'Dark',
loading_screen: { backgroundColor: "#171B2B" }, // 加载时的背景颜色
// disabled_features: ["left_toolbar", "on"], // 关闭左侧工具栏
overrides: {
"mainSeriesProperties.candleStyle.upColor": "#d75442",
"mainSeriesProperties.candleStyle.downColor": "#6ba583",
"mainSeriesProperties.candleStyle.drawWick": true,
"mainSeriesProperties.candleStyle.drawBorder": true,
"mainSeriesProperties.candleStyle.borderColor": "#378658",
"mainSeriesProperties.candleStyle.borderUpColor": "#5b1a13",
"mainSeriesProperties.candleStyle.borderDownColor": "#225437",
"mainSeriesProperties.candleStyle.wickUpColor": 'rgba( 115, 115, 117, 1)',
"mainSeriesProperties.candleStyle.wickDownColor": 'rgba( 115, 115, 117, 1)',
"mainSeriesProperties.candleStyle.barColorsOnPrevClose": false,
},
studies_overrides: {
"volume.volume.color.0": "#6ba583",
"volume.volume.color.1": "#d75442",
}
});
});
</script>
</head>
<body style="margin:0px;">
<div id="tv_chart_container"></div>
</body>
</html>