Strategy · Pine Script v6 · On the chart

BigStrategy

by hoox-sh

A simple price-action strategy that goes long on a bullish bar closing above the prior close with a higher high, and short on the mirror-image bearish bar.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code30
Settings0inputs
LicenceAGPL-3.0
Last update4 days ago25 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  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

30 lines of Pine Script v6 from scripts/big_strategy.pine, published under AGPL-3.0. Keep the author's credit and licence lines when you reuse it.

big_strategy.pine
//@version=6
strategy("BigStrategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)

// ── Price-action conditions ─────────────────────────────────────────────────
longCondition = close > open and close > close[1] and high > high[1]
shortCondition = close < open and close < close[1] and low < low[1]

// ── Entries ─────────────────────────────────────────────────────────────────
if longCondition and bar_index > 10
    strategy.entry("Long", strategy.long, qty=100, comment="bullish bar")
    strategy.exit("Long Exit", "Long", stop=low * 0.97, limit=close * 1.08, trail_price=close * 0.03)

if shortCondition and bar_index > 10
    strategy.entry("Short", strategy.short, qty=100, comment="bearish bar")
    strategy.exit("Short Exit", "Short", stop=high * 1.03, limit=close * 0.92, trail_price=close * 0.03)

// ── Close on reversal ───────────────────────────────────────────────────────
if shortCondition and strategy.position_size > 0
    strategy.close("Long", comment="reversed to short")

if longCondition and strategy.position_size < 0
    strategy.close("Short", comment="reversed to long")

// ── Periodic close ──────────────────────────────────────────────────────────
if bar_index % 20 == 0 and strategy.position_size != 0
    strategy.close_all(comment="periodic exit")

// ── Plots ───────────────────────────────────────────────────────────────────
plot(close, "Close", color=color.white, linewidth=1)
plot(open, "Open", color=color.gray, linewidth=1)

Overview

Each entry comes with a stop, a limit and a trailing value set as percentages of price. It also closes a position when the opposite signal appears and closes everything every twentieth bar. Orders use the full equity setting with a percentage commission, and it plots close and open on the price chart.

Details

Published by

hoox-sh on GitHub

Draws

On the price chart

Category

Breakout

Markets

Any symbol

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.

Topics

algorithmic-tradingcloudflare-workersedgepine-scriptpynepythontradinghoox

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

This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr

Strategy v6 BreakoutTrend
Updated yesterday · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout
257 stars

This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar
228 stars

This strategy detects price breakouts above rolling highest highs or below lowest lows over a customizable lookback period. It includes optional volume spike and ATR volatility threshold filters, along with bar confirmation rules. Positions are taken upon conf

Strategy v6 BreakoutVolatility & bands
Updated 3 months ago · None stated GitHub repository of Breakout Strategy Template

STRG-HOLP

by harryguiacorn
220 stars

STRG-HOLP is a trading strategy that identifies High of Low Period (HOLP) and Low of High Period (LOHP) breakout setups. It tracks the lowest low or highest high over a user-defined lookback window. A long trade opens when the close breaks above the high of th

Strategy v5 BreakoutSupport & resistance
Updated 1 year ago · None stated GitHub repository of STRG-HOLP

Bollinger Breakout

by hackingthemarkets
189 stars

This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w

Strategy v4 Volatility & bandsBreakout
Updated 3 years ago · None stated GitHub repository of Bollinger Breakout

More Breakout scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers