Strategy · Pine Script v5 · On the chart

Hercules Srategy

by g-moe· code credited to goodgains

This strategy detects momentum breakouts identified as lightning candles where the absolute candle body size exceeds a user-defined tick threshold.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code184
Settings25inputs
LicenceNone stated
Last update5 months ago27 May 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

Hercules Srategy enters long positions on large bullish candles and short positions on large bearish candles, with an option to invert signals. Entries can be filtered by trading session, moving average direction, previous candle behavior, and daily open levels. Position exits are managed using an automated risk-to-reward target calculation or alternate fixed percentage and price stops and targets. All signals overlay on the main price chart.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

Draws

On the price chart

Markets

Forex

Timeframes

M1-M5, M15-H1

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
Inverse Signalsboolfalseinverse_settings
Lightning⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀int500min_ticks
What trades should be taken ?⠀ ⠀stringBOTHtradeType
Trading Sessionsession0900-1600trading_session
Previous Candle Filter⠀⠀⠀⠀boolfalseuse_prev_candle
timeframeprev_tf
MA Filterboolfalseuse_ma
stringSMAma_type
sourceclosema_source
int50ma_length
Prior Days Range⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀stringOutsideprev_day_range
Daily Open Filter⠀⠀⠀ ⠀⠀⠀⠀boolfalseuse_day_open
Show all 25 settings
SettingTypeDefaultVariable
session0930-0931day_open
Continuous Modeboolfalsecontinuous
R:R Auto-Calculationbooltrueuse_rr_tp
rr_tpfloat2.0rr_tp
Alt Target⠀⠀ ⠀⠀⠀⠀⠀boolfalseuse_tp
tp_amountfloat1.00tp_amount
tp_typestringPercenttp_type
Alt Stop Loss⠀ ⠀⠀⠀⠀boolfalseuse_sl
sl_amountfloat1.00sl_amount
sl_typestringPercentsl_type
TP R:Rfloat2.0tp
Backtesting Start Timetimetimestamp('01 Jan 2021 13:30 +0000')backtest_start
Backtesting End Timetimetimestamp('01 Dec 2023 19:30 +0000')backtest_end
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

53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized Strategy

Turtle MACD Time-Zone Filter

by skywalker0803r
42 stars

This strategy enters long when price closes above the prior Donchian high and short when it closes below the prior Donchian low, only while flat and inside a Taipei-hour window. It exits on a MACD histogram reversal or through an ATR stop and a percentage take

Strategy v5 BreakoutOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Turtle MACD Time-Zone Filter

Morning Scalp

by benso87
24 stars

This strategy tracks an opening session time range to establish directional bias and triggers pullback trades using Stochastic RSI. Once price breaks out of the initial range, it establishes a directional bias and enters when the Stochastic RSI crosses over in

Strategy v5 Sessions & timeBreakout
Updated 4 years ago · MPL-2.0 GitHub repository of Morning Scalp

ORB + Fib + MACD Strategy

by alboogycOdR
6 stars

This strategy builds a timed opening range and tracks session high and low on the price chart. It flags bullish and bearish breakouts of that range and uses Fibonacci levels for an entry zone, a default stop, and an optional take-profit extension. Take profit

Strategy v5 BreakoutSupport & resistance
Updated 7 months ago · None stated GitHub repository of ORB + Fib + MACD Strategy

Gap and Go

by Basant1Saini
1 stars

This strategy trades opening gap continuation on the price chart. It measures the gap between the daily open and the prior daily close, then enters long after a qualifying gap up or short after a qualifying gap down when price stays beyond the open and a trend

Strategy v5 BreakoutOscillators & momentum Repaints
Updated 8 months ago · None stated GitHub repository of Gap and Go

Hotch Break Strat

by rajatjpatel
1 stars

A strategy that combines several filters on one chart. Components include an ignition bar marker based on a candle body retracement percentage, fractal detection, three configurable moving averages, an RSI with overbought and oversold levels, a trading range l

Strategy v5 BreakoutOscillators & momentum Repaints
Updated 4 years ago · None stated GitHub repository of Hotch Break Strat

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