持仓量+成交量及预警
// 该指标由 AICOIN研究院 创建,如遇任何使用问题,可加入指标社群咨询
// @version=2
indicator(precision=2)
// 持仓量预警阈值
interestLimit = 15*10000
// 成交量预警阈值
volumeLimit = 10*10000
// 调用多数据源函数,获取持仓量的数据
symbol = syminfo.tickerid
key = "interest:"+symbol
interest = security(key, '', close)
// 定义预警条件
cvol = volume > volumeLimit
cinterest = interest > interestLimit
volCrossInterest = crossup(volume, interest)
// 创建预警
alertcondition(cvol, title='成交量上涨', direction='')
alertcondition(cinterest, title='持仓量上涨', direction='')
alertcondition(volCrossInterest, title='成交量上穿持仓量', direction='')
plot(interest, title="持仓量")
plotColumn(volume, title="成交量", color= close > open ? "green" : "red")
plotShape(volCrossInterest and close > open, title="看多", shape='arrowUp', color='green', refSeries=interest, placement='bottom', fill=true)
plotShape(volCrossInterest and close < open, title="看空", shape='arrowDown', color='red', refSeries=interest, placement='top', fill=true)
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
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