本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
indicator("CARDONA PRO - OPEN DINAMICO 9:30", overlay=true, max_lines_count=500)
// Apertura oficial de Nueva York
string tz = "America/New_York"
string regularSession = "0930-1600:23456"
bool inSession = not na(time(timeframe.period, regularSession, tz))
bool newSession = inSession and not inSession[1]
// Precio de apertura
var float openPrice = na
var line openLine = na
if newSession
openPrice := open
openLine := line.new(
bar_index, openPrice,
bar_index, openPrice,
color=color.lime,
width=2,
style=line.style_dotted)
// Línea dinámica verde / roja
if inSession and not na(openLine)
color lineColor = close >= openPrice ? color.lime : color.red
line.set_x2(openLine, bar_index)
line.set_color(openLine, lineColor)