Eric Crooks - Software Engineer - Raleigh, North Carolina
Eric Crooks
Software engineer, Nasdaq trader, and US Army Veteran. Based in Apex, North Carolina.
Back to all journal entries

TradingView Development: 4H Sweep/Close

A PineScript indicator that marks sweep setups on the 1H and 4H charts.

The 4H Sweep/Close indicator The 4H Sweep/Close indicator

This is a new PineScript indicator, and it joins my daily highs/lows and higher timeframe separators indicators. It marks sweep setups on the 1H and 4H charts.

The Setups#

  • Bearish setup: a bearish candle sweeps the high of the bullish candle before it, then closes below that candle's close.
  • Bullish setup: a bullish candle sweeps the low of the bearish candle before it, then closes above that candle's close.

Labels#

Each setup gets a line and a label:

LabelSetup
4HS-Bearish sweep on the 4H
4HS+Bullish sweep on the 4H
1HS-Bearish sweep on the 1H
1HS+Bullish sweep on the 1H

The 1H chart also shows the 4H sweeps, so I can see both timeframes without switching charts.

Options#

You can choose to show bearish setups, bullish setups, or both, and you can set up an alert for each one.

Source#

trading viewpinescriptopen sourceclaude

Looking to connect?