OPEN-SOURCE SCRIPT

Swing High/Low Strategy

This TradingView strategy uses EMA/SMA crossovers, Swing High/Low levels, and volume filtering to generate long and short trades. It includes customizable take-profit and trailing stop-loss options for controlled exits.

Long Entry
Entry: Price closes above the latest Swing High, and volume exceeds the 200-period moving average.
Exit:
Take Profit: At a user-defined percentage above the entry.
Trailing Stop (if enabled): Trails by a user-defined percentage as price rises.
Short Entry
Entry: Price closes below the latest Swing Low, and volume exceeds the 200-period moving average.
Exit:
Take Profit: At a user-defined percentage below the entry.
Trailing Stop (if enabled): Trails by a user-defined percentage as price drops.
This setup is designed for breakout trades with volume confirmation, and it manages risk using take-profit and trailing stop-loss options.
Moving AveragesPivot points and levelsVolume

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer