Strategy · Pine Script v5 · On the chart

OutSide Bar Strategy

by TWODS-CAPITAL

The OutSide Bar Strategy identifies outside bar candlestick patterns directly on the main price chart.

View on GitHub

GitHub stars37on the repository
Pine versionv5runs as is
Lines of code8
Settings0inputs
LicenceMIT
Last update3 years ago10 Feb 2023

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

8 lines of Pine Script v5 from Strategies/All Strategies are Here 🤩/Outside-Bar-Strategy.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

Outside-Bar-Strategy.pine
//@version=5
strategy("OutSide Bar Strategy", overlay=true)
if (high > high[1] and low < low[1])
    if (close > open)
        strategy.entry("OutBarLE", strategy.long, comment="OutBarLE")
    if (close < open)
        strategy.entry("OutBarSE", strategy.short, comment="OutBarSE")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)

Overview

OutSide Bar Strategy 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. Conversely, it triggers a short entry when an outside bar closes lower than its open. The strategy contains no customizable input parameters and reverses positions upon opposing signals. A key limitation is the absence of stop-loss or take-profit controls.

Details

Published by

TWODS-CAPITAL on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Candlestick patterns, Breakout

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss
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

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 today · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout
285 stars

Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy
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

STRG-HOLP

by harryguiacorn
219 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

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