1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
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.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Inverse Signals
bool
false
inverse_settings
Lightning⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀
int
500
min_ticks
What trades should be taken ?⠀ ⠀
string
BOTH
tradeType
Trading Session
session
0900-1600
trading_session
Previous Candle Filter⠀⠀⠀⠀
bool
false
use_prev_candle
timeframe
prev_tf
MA Filter
bool
false
use_ma
string
SMA
ma_type
source
close
ma_source
int
50
ma_length
Prior Days Range⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
string
Outside
prev_day_range
Daily Open Filter⠀⠀⠀ ⠀⠀⠀⠀
bool
false
use_day_open
Show all 25 settings
Setting
Type
Default
Variable
session
0930-0931
day_open
Continuous Mode
bool
false
continuous
R:R Auto-Calculation
bool
true
use_rr_tp
rr_tp
float
2.0
rr_tp
Alt Target⠀⠀ ⠀⠀⠀⠀⠀
bool
false
use_tp
tp_amount
float
1.00
tp_amount
tp_type
string
Percent
tp_type
Alt Stop Loss⠀ ⠀⠀⠀⠀
bool
false
use_sl
sl_amount
float
1.00
sl_amount
sl_type
string
Percent
sl_type
TP R:R
float
2.0
tp
Backtesting Start Time
time
timestamp('01 Jan 2021 13:30 +0000')
backtest_start
Backtesting End Time
time
timestamp('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.
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
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
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
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
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
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