OPEN-SOURCE SCRIPT

First Candle +0.9% Line

91
//version=5
indicator("First Candle +0.9% Line", overlay=true)

// Capture the closing price of the first candle
var float first_candle_close = na

if (bar_index == 0)
first_candle_close := close

// Calculate the 0.9% level above the first candle's closing price
level = first_candle_close * 1.009 // 0.9% above the first candle close

// Plot the line at the calculated level
plot(series=level, color=color.red, linewidth=2, title="0.9% Above First Candle")

// Optional: Add a label to mark the level
if not na(first_candle_close)
label.new(x=bar_index, y=level, text="+0.9% Level", color=color.red, style=label.style_label_down, textcolor=color.white)

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.