This Pine Script indicator is designed to identify specific bullish and bearish structures on a price chart based on user-defined conditions. The indicator highlights buy and sell signals and allows customization through input checkboxes to include or exclude additional conditions for generating these signals.
Key Features: User Input Checkboxes:
Use Additional Buy Condition: Enables or disables an extra condition for buy signals. Use Additional Sell Condition: Enables or disables an extra condition for sell signals. Bullish Structure (Case 01):
The closing price of the candle 2 bars ago is greater than the closing price of the candle 1 bar ago. The current candle's closing price is greater than the opening price of the candle 1 bar ago. Additional Buy Condition: The closing price of the candle 2 bars ago is less than the closing price of the candle 1 bar ago. Bearish Structure (Case 01):
The closing price of the candle 1 bar ago is greater than the closing price of the candle 2 bars ago. The current candle's closing price is less than the opening price of the candle 1 bar ago. Additional Sell Condition: The closing price of the candle 1 bar ago is less than the closing price of the candle 2 bars ago. Signal Tracking:
The script tracks whether it is currently in a long (buy) or short (sell) state to avoid consecutive identical signals. Only one buy signal is allowed until a sell signal is generated, and vice versa. Plotting Signals:
Buy signals are plotted as green labels below the bar. Sell signals are plotted as red labels above the bar. Background colors are used to highlight bars where signals are generated: Green for buy signals. Red for sell signals. Previous Candle Plotting:
Signals are plotted on the previous candle to clearly indicate where the signal conditions were met. Script Usage: Overlay:
The indicator is plotted directly on the price chart (overlay=true). User Inputs:
Users can toggle the additional conditions for buy and sell signals through the checkboxes provided in the input settings. Customization:
The indicator can be customized further to suit different trading strategies or market conditions by modifying the conditions and input parameters. Example Usage: Add the indicator to your TradingView chart. Use the input checkboxes to include or exclude additional conditions for buy and sell signals. Observe the plotted signals and background highlights to identify potential buy and sell opportunities based on the defined conditions. This indicator provides a flexible tool for traders to identify specific bullish and bearish market structures and helps in making informed trading decisions.
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.