Swing Highs and Lows

Simple script to overlay swing highs and lows.
A Swing High (SH): a price bar high preceded by two lower highs (LH) and followed by two lower highs (LH).
Remove from Favorite Scripts Add to Favorite Scripts


Can you make a new version of this with a pricebar preceded by one LH and followed by one LL, that would be awesome.
thanks mate!
Hi Can this be used for automatic trading?
@dpanday, I'm very new to this TradingView tool and not exactly sure how I can connect this to automatic trading, but I guess you can do that...Feel free to use this code.
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out