Strategy · Pine Script v5 · On the chart

IBOB Inside Bar Outside Bar

by Tradehook-org

A Pine v5 strategy that trades an outside bar after one or more inside bars.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code88
Settings6inputs
LicenceNone stated
Last update8 months ago16 Feb 2026

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

An inside bar has a lower high and higher low than the bar before it, and an outside bar exceeds both. After the chosen number of consecutive inside bars, an outside bar closing up opens a long and one closing down opens a short. Each trade gets an ATR-based stop and target. Size is 10 percent of equity, pyramiding is off, and signal markers, background and alerts are included.

Details

Published by

Tradehook-org on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Candlestick patterns, 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.

Settings

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

SettingTypeDefaultVariable
ATR Periodinteger14atrPeriod
Stop Loss Multiplier (ATR)float2.0slMultiplier
Take Profit Multiplier (ATR)float4.0tpMultiplier
Inside Bar Lookback (Consecutive IBs)integer1ibLookback
Show Entry SignalsbooltrueshowSignals
Show Background ColorbooltrueshowBG
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

BarUpDn Long Strategy

by hasnocool
106 stars

BarUpDn Long Strategy executes long trades based on price bar directional movements and previous bar closes. It places a long stop order above the current high when a bullish candle opens above a prior close. Because short entries are restricted to exiting lon

Strategy v4 Candlestick patternsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of BarUpDn Long Strategy

OutSide Bar Strategy

by TWODS-CAPITAL
37 stars

The OutSide Bar Strategy identifies outside bar candlestick patterns directly on the main price chart. It triggers a long entry when a bar's high exceeds the previous high and its low drops below the previous low, provided the bar closes higher than its open.

Strategy v5 Candlestick patternsBreakout
Updated 3 years ago · MIT GitHub repository of OutSide Bar Strategy
3 stars

This strategy plots Bollinger Bands on the price chart and enters long only when flat. It buys on a strong bullish close above the middle band or on a small-body pullback that tags the middle band with a long lower wick. The stop sits below the signal bar by a

Strategy v5 Volatility & bandsBreakout
Updated 2 days ago · None stated GitHub repository of H4 布林ATR型態多單策略
3 stars

This strategy detects Opening Range Breakouts in a specified session. It calculates the high and low of the opening range bar then plots these levels on the price chart and fills the area between them. Candles are colored based on their relation to the ORB hig

Strategy v5 BreakoutSupport & resistance
Updated 5 months ago · None stated GitHub repository of ORB Hooplah Strategy

Traffic Light Strategy

by Pa1-Tiwari
3 stars

The Traffic Light Strategy is a breakout trading system overlaid on the main price chart. It detects momentum transitions whenever two consecutive candles have opposing colors (bullish followed by bearish, or vice versa). Upon detection, it marks the combined

Strategy v6 BreakoutCandlestick patterns
Updated 10 months ago · MIT GitHub repository of Traffic Light 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