OPEN-SOURCE SCRIPT
纳斯达克涨2.5%以上

//version=5
indicator("纳斯达克大涨标记", shorttitle="NASDAQ+2.5%", overlay=true)
// 纳斯达克综合指数的符号
// 如果您想使用 E-mini 纳斯达克 100 期货 (NQ!) 或其他相关工具,请更改此符号
symbolName = "NASDAQ:IXIC"
// 目标涨幅百分比
targetPercentage = 2.5
// 获取纳斯达克指数的数据
// 使用 security() 函数获取不同品种的数据
nasdaq_close = request.security(symbolName, "D", close[1])
nasdaq_prev_close = request.security(symbolName, "D", close[2])
// 确保我们有足够的数据进行计算
isDataAvailable = not na(nasdaq_close) and not na(nasdaq_prev_close)
// 计算当天的涨幅百分比
// (今日收盘价 - 昨日收盘价) / 昨日收盘价 * 100
changePercentage = isDataAvailable ? (nasdaq_close - nasdaq_prev_close) / nasdaq_prev_close * 100 : na
// 检查条件:涨幅是否大于或等于目标百分比
isBigUpDay = changePercentage >= targetPercentage
// 绘制粉红色的点
plotshape(isBigUpDay,
title="大涨日",
location=location.belowbar, // 绘制在 K 线的下方
color=color.rgb(255, 0, 255, 0), // 纯粉红色
style=shape.circle,
size=size.small,
text="")
// 可以在图表底部显示涨幅百分比作为确认
plot(isBigUpDay ? changePercentage : na,
title="当日涨幅%",
color=color.rgb(255, 0, 255, 50),
style=plot.style_stepline,
trackprice=false)
// 警报示例 (可选)
// if isBigUpDay
// alert("纳斯达克当日涨幅达到 " + str.tostring(targetPercentage) + "% 或以上!", alert.freq_once_per_bar_close)
indicator("纳斯达克大涨标记", shorttitle="NASDAQ+2.5%", overlay=true)
// 纳斯达克综合指数的符号
// 如果您想使用 E-mini 纳斯达克 100 期货 (NQ!) 或其他相关工具,请更改此符号
symbolName = "NASDAQ:IXIC"
// 目标涨幅百分比
targetPercentage = 2.5
// 获取纳斯达克指数的数据
// 使用 security() 函数获取不同品种的数据
nasdaq_close = request.security(symbolName, "D", close[1])
nasdaq_prev_close = request.security(symbolName, "D", close[2])
// 确保我们有足够的数据进行计算
isDataAvailable = not na(nasdaq_close) and not na(nasdaq_prev_close)
// 计算当天的涨幅百分比
// (今日收盘价 - 昨日收盘价) / 昨日收盘价 * 100
changePercentage = isDataAvailable ? (nasdaq_close - nasdaq_prev_close) / nasdaq_prev_close * 100 : na
// 检查条件:涨幅是否大于或等于目标百分比
isBigUpDay = changePercentage >= targetPercentage
// 绘制粉红色的点
plotshape(isBigUpDay,
title="大涨日",
location=location.belowbar, // 绘制在 K 线的下方
color=color.rgb(255, 0, 255, 0), // 纯粉红色
style=shape.circle,
size=size.small,
text="")
// 可以在图表底部显示涨幅百分比作为确认
plot(isBigUpDay ? changePercentage : na,
title="当日涨幅%",
color=color.rgb(255, 0, 255, 50),
style=plot.style_stepline,
trackprice=false)
// 警报示例 (可选)
// if isBigUpDay
// alert("纳斯达克当日涨幅达到 " + str.tostring(targetPercentage) + "% 或以上!", alert.freq_once_per_bar_close)
Skrip sumber terbuka
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Penafian
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Skrip sumber terbuka
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Penafian
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.