DRA0.09 - ATM_LabelDraw Indicator
This is a code to draw a label which displays the At The Money Strike as per the first 5 minute candle on an Index chart.
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © rahuld0890 //@version=6 indicator("DRA0.09 - ATM_LabelDraw Indicator", overlay=true, precision=0) // Get 5-minute timeframe values var float dailyFirstClose = na var int firstCloseBarIndex = na // Check for new day in 5-minute timeframe isNewDay = ta.change(time("D")) != 0 // Capture first 5-minute open/close on new day if isNewDay dailyFirstClose := close firstCloseBarIndex := bar_index else // Carry forward previous values dailyFirstClose := dailyFirstClose[1] // Calculate ATM Strike Price atm_strike = math.round(dailyFirstClose / 100) * 100 // Plot hidden series to display in Data Window plot(atm_strike, title="ATM Strike Price", display=display.none) // Optional: Display as text on chart var label atmLabel = label.new(na, na, "", style=label.style_label_left, size=size.small) label.set_xy(atmLabel, firstCloseBarIndex, dailyFirstClose) label.set_text(atmLabel, "ATM: " + str.tostring(atm_strike))