Instead of using if blocks, the visibility of each plot is controlled by passing na (not available) when the corresponding toggle is turned off. Usage of plot:
Each plot call is outside of any conditional block, ensuring it meets Pine Script's requirements. Inputs for User Control:
The show_pivots, show_supports, and show_resistances inputs control whether each level is plotted. How to Use: Copy and paste this script into the Pine Editor in TradingView. Click Add to Chart. Use the input options to toggle visibility for pivot, resistance, and support levels.