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)
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
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.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
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.