Strategy · Pine Script v5 · On the chart

Breakout Strategy with Custom TP and SL

by Aksee123

This breakout strategy identifies trade entries when price breaks above recent swing highs or below swing lows.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code144
Settings23inputs
LicenceNone stated
Last update1 year ago20 Jul 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Entries are verified through optional filters, including a 233 EMA trend filter, ATR volatility threshold, volume multiplier confirmation, RSI bounds, MACD direction, and trading session hours. Exits are controlled by customizable take-profit percentages and either swing-based or fixed percentage stop losses, with an optional 1:1 risk-to-reward mode. Plots swing high and low levels on the main price chart alongside optional MACD pane outputs.

Details

Published by

Aksee123 on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Breakout, Trend, Volatility & bands, Oscillators & momentum

Markets

Crypto

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Swing Windowint20swingWindow
Trading Directionstringbothdirection
Take Profit (%)float1.0tpPercent
Stop Loss TypestringSwing SLslType
Fixed SL (%)float1.0fixedSlPercent
Use 1:1 Risk-Reward (TP = SL)boolfalseuseRR1
Use 233 EMA Filter (Other Pairs)booltrueuseEMAFilter
Use 233 EMA Filter (BTC Only)booltrueuseEMAFilterBTC
Use ATR Volatility FilterboolfalseuseATRFilter
ATR Periodint14atrPeriod
Min ATR (% of price)float0.5minAtr
Use Volume FilterboolfalseuseVolumeFilter
Show all 23 settings
SettingTypeDefaultVariable
Volume Multiplierfloat1.2volMultiplier
Use Session/Time FilterboolfalseuseSessionFilter
Start Hour (UTC)int8startHour
End Hour (UTC)int20endHour
Use RSI FilterboolfalseuseRSIFilter
RSI Periodint14rsiPeriod
Use MACD FilterboolfalseuseMACDFilter
Plot MACD on ChartboolfalseplotMACD
MACD Fast Lengthint12macdFastLength
MACD Slow Lengthint26macdSlowLength
MACD Signal Lengthint9macdSignalLength
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

16 stars

This strategy trades Donchian channel breakouts on the price chart and exits on a shorter Donchian channel. It sizes each unit from a percentage of equity and an ATR-based initial stop, then adds units as price moves a set ATR distance, up to a maximum unit co

Strategy v6 TrendBreakout
Updated 11 months ago · None stated GitHub repository of Seykota Alt 16: Anti-Chop Filters

GEO P Momentum Strategy

by newsfriend
2 stars

Implements a rule-based momentum trading strategy that detects Bollinger Band challenges followed by synchronized trendline or range breakouts on the price chart. Entries trigger under configurable strictness modes using multi-timeframe Tide and Wave alignment

Strategy v6 Oscillators & momentumVolatility & bands
Updated 8 weeks ago · None stated GitHub repository of GEO P Momentum Strategy

This strategy evaluates multi-factor breakout confluence using a customized scoring system on the price chart. It checks Minervini-style Volatility Contraction Pattern trend templates, TTM squeeze volatility compression, volume dry-up with OBV accumulation, mo

Strategy v6 BreakoutVolatility & bands
Updated 2 months ago · None stated GitHub repository of TnSovereign Breakout Confluence V6

Volume Breakout Strategy

by kanylbullen
1 stars

This strategy identifies breakouts using Keltner Channels combined with volume spike filters, ADX trend strength, RSI thresholds, and an optional EMA trend direction filter. It triggers long entries when price crosses above the upper channel and short entries

Strategy v5 BreakoutTrend Repaints
Updated 6 days ago · None stated GitHub repository of Volume Breakout Strategy
6 stars

This strategy identifies high-volatility expansion bars by comparing the high-low range to a moving average plus standard deviation threshold. When range expansion occurs, it checks momentum over a specified lookback period. It opens a long position if the cur

Strategy v5 Volatility & bandsOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TradersPost High-Low Range Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers