OPEN-SOURCE SCRIPT
First Candle com Targets

This Pine Script implements a "First Candle of the Day" breakout strategy with targets:
Strategy Logic:
Identifies the first hourly candle of each trading day
Calculates the high, low, and range (distance) of that candle
Draws four horizontal levels on the chart:
High level (red solid line)
Low level (green solid line)
Buy target (blue dashed): High + Daily Range
Sell target (purple dashed): Low - Daily Range
Generates signals when price breaks above/below these levels:
BUY signal: When price closes ABOVE the Buy target (High + Range)
SELL signal: When price closes BELOW the Sell target (Low - Range)
Visualizes all levels with labels showing exact price values
Key Features:
Uses 1-hour timeframe
Lines extend 500 bars forward from the first candle
Automatic cleanup and update of levels each new day
Includes alert conditions for automated trading notifications
Marks the first candle of each day with a blue label
Trading Approach:
Breakout long when price exceeds the first candle's high by its full daily range
Breakout short when price falls below the first candle's low by its full daily range
The strategy assumes the first candle's range establishes intraday volatility boundaries
Strategy Logic:
Identifies the first hourly candle of each trading day
Calculates the high, low, and range (distance) of that candle
Draws four horizontal levels on the chart:
High level (red solid line)
Low level (green solid line)
Buy target (blue dashed): High + Daily Range
Sell target (purple dashed): Low - Daily Range
Generates signals when price breaks above/below these levels:
BUY signal: When price closes ABOVE the Buy target (High + Range)
SELL signal: When price closes BELOW the Sell target (Low - Range)
Visualizes all levels with labels showing exact price values
Key Features:
Uses 1-hour timeframe
Lines extend 500 bars forward from the first candle
Automatic cleanup and update of levels each new day
Includes alert conditions for automated trading notifications
Marks the first candle of each day with a blue label
Trading Approach:
Breakout long when price exceeds the first candle's high by its full daily range
Breakout short when price falls below the first candle's low by its full daily range
The strategy assumes the first candle's range establishes intraday volatility boundaries
Open-source script
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.
Disclaimer
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.
Open-source script
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.
Disclaimer
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.