trading-view

TradingView图标颜色

动量柱上升 Red #ff5252 

动量柱下跌 Red #ffcdd2 

亮红 Red #fe0116 

亮红1 Red #df473d 

动量柱上升 Green #26a69a

动量柱下跌 Green #b2dfdb 

亮绿 Green #06ff10

亮绿1 Green #05c48e

TradingView 获取高热度指标

打开控制台,输入下方脚本,滚动页面往下即可

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
// treading view 高热度指标筛选脚本
let contentHeight = 0
const content = document.getElementById('tv-content')
document.addEventListener('scroll', () => {
if (content.clientHeight !== contentHeight) {
findTop5Hot()
contentHeight = content.clientHeight
}
})

let set = new Set()
const findTop5Hot = () => {
const count = document.getElementsByClassName('tv-card-social-item__count');
const elWithCount = [...count].map(el => {
const num = el.textContent
return {el, num: Number(num)}
});
const sorted = elWithCount.sort((a, b) => b.num - a.num)
for (const el of set) {
el.parentElement.removeChild(el)
console.log(el)
}
set = new Set()
for (let i = 0; i < 5; i++) {
const item = sorted[i]

if (item) {
item.el.style = 'background-color:red;color:white;font-size:16px;font-weight:bold;'
insertButton(item.el, item.num, i)
}
}
}

const insertButton = (el, num, i) => {
const btn = document.createElement('button')
btn.addEventListener('click', () => {
el && el.scrollIntoView({block: "center", inline: "center"})
})
btn.textContent = `指标热度:${num}`
btn.style = `
position: fixed;
top: ${i * 32}px;
right: 0px;
z-index: 200000;
color: #000;
font-weight: bold;
font-size: 18px;
`
set.add(btn)
document.body.append(btn)
}

(() => {
insertButton()
})()