Strategy · Pine Script v4 · Own pane

Line Break Strategy

by hasnocool

Line Break Strategy generates trading signals by fetching Line Break chart data using a synthetic ticker context.

View on GitHub

Repaints

GitHub stars106on the repository
Pine versionv4older, still runs
Lines of code19
Settings1inputs
LicenceGPL-3.0
Last update2 years ago18 Sep 2024

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

19 lines of Pine Script v4 from Best strategy for TradingView (fake).pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

Best strategy for TradingView (fake).pine
//@version=4
strategy("Line break strategy", "LBS", default_qty_type = strategy.percent_of_equity, default_qty_value=100, currency="USD", commission_type=strategy.commission.percent, commission_value=0.07)
lb_t = linebreak(syminfo.tickerid, input(3, 'break', input.integer))
lb_open = security(lb_t, timeframe.period, open, barmerge.gaps_on)
lb_high = security(lb_t, timeframe.period, high, barmerge.gaps_on)
lb_low = security(lb_t, timeframe.period, low, barmerge.gaps_on)
lb_close = security(lb_t, timeframe.period, close, barmerge.gaps_on)
plotcandle(lb_open, lb_high, lb_low, lb_close, color = lb_close >= lb_open ? color.green : color.red)
if lb_close > lb_open
    strategy.entry("Long", true)
else
    strategy.close("Long")
        
if lb_close < lb_open
    strategy.entry("Short", false)
else
    strategy.close("Short")    
        
Expand (22 lines)

Overview

Line Break Strategy plots custom Line Break candlesticks in a separate pane and checks whether the line break bar closed higher or lower than its open. The strategy enters a long position when the line break close exceeds its open and enters a short position when it falls below. Users can configure the line break count setting. Requesting non-standard chart types via the security function can cause repainting, and the script includes no default stop-loss rules.

Details

Published by

hasnocool on GitHub

Type

Strategy, Pine Script v4

Draws

Separate pane below the chart

Category

Trend, Candlestick patterns

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)
  • The strategy enters trades without a stop loss

Topics

analysisbtcusdtcryptocurrencydatapandaspythonsimulationtradingtradingview

Settings

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

SettingTypeDefaultVariable
breakint3break
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

330 stars

HA UnivLong&Short Futures calculates Heikin Ashi candles and builds a channel using simple moving averages of Heikin Ashi highs and lows. It enters long positions when the upper channel line crosses above the lower channel line and opens short positions on the

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of HA UnivLong&Short Futures
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

ESU2023-10M - V1

by dearvn
257 stars

ESU2023-10M - V1 is an intraday trend-reversal strategy designed for index futures contracts on the price chart. It calculates a 3-period moving average of candle highs and lows alongside specific three-bar price action patterns to detect short-term swing high

Strategy v5 TrendCandlestick patterns
Updated 6 weeks ago · None stated GitHub repository of ESU2023-10M - V1

Consecutive Up/Down Strategy

by TWODS-CAPITAL
37 stars

This strategy tracks consecutive bullish and bearish candlestick closes relative to the preceding bar. It enters a long position when price closes higher for a specified number of consecutive bars, and enters a short position when price closes lower for a desi

Strategy v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Consecutive Up/Down Strategy

DI Engulfing A002

by ruckard
13 stars

This strategy executes trades based on candlestick engulfing patterns aligned with a 200-period exponential moving average trend filter. It enters long positions when a bullish engulfing candle follows three consecutive bearish candles while price trades above

Strategy v5 Candlestick patternsTrend
Updated 1 year ago · None stated GitHub repository of DI Engulfing A002
7 stars

This strategy combines Ichimoku Kinko Hyo components, a Stochastic oscillator, and specific candlestick patterns to generate trade signals. It identifies Kumo twists and range breakouts while evaluating candle body shapes using Fibonacci threshold filters. Tra

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · MIT GitHub repository of Soulevement / Ressaut 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