Strategy · Pine Script v6 · On the chart

Confirmed HTF Pivots + Fib + EMA Strategy

by Trujillofa

A strategy that marks confirmed 4H and daily pivot highs and lows, draws Fibonacci levels with an optional golden zone shading, and plots EMA 50 and EMA 200.

View on GitHub

Repaints

GitHub stars1on the repository
Pine versionv6current
Lines of code703
Settings36inputs
LicenceNone stated
Last update5 days ago24 Oct 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

A Hardened MTF mode adds RSI confirmation, EMA alignment and candle checks, allowing one trade per confirmed swing, while a baseline mode keeps simpler marker logic. Exits use ATR-based stop and target distances plus a maximum hold in bars. Quantity is fixed, and it draws on the price chart.

Details

Published by

Trujillofa on GitHub

Draws

On the price chart

Markets

Forex, Gold

Timeframes

M15-H1

Risk Notes

  • Reads higher-timeframe data with lookahead on, so the history can show signals that were not there in real time

Topics

forexpythonrsitrading

Settings

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

SettingTypeDefaultVariable
Logic ModestringHardened MTFlogicMode
Order Quantityfloat3.0orderQuantity
ATR Lengthint14atrLength
Target ATRfloat1.5targetAtr
Stop ATRfloat1.5stopAtr
Maximum Hold Barsint32maxHoldBars
Enable Strategy OrdersbooltrueenableOrders
EMA 50 Lengthint50ema50Length
EMA 200 Lengthint200ema200Length
Show EMAsbooltrueshowEmas
4H Left Barsint5left4h
4H Right Barsint5right4h
Show all 36 settings
SettingTypeDefaultVariable
Show 4H Linesbooltrueshow4hLines
Show Latest 4H Labelsboolfalseshow4hLabels
4H Highcolorcolor.new(color.red, 10)color4hHigh
4H Lowcolorcolor.new(color.green, 10)color4hLow
Daily Left Barsint5leftDaily
Daily Right Barsint5rightDaily
Show Daily LinesbooltrueshowDailyLines
Show Latest Daily LabelsboolfalseshowDailyLabels
Daily Highcolorcolor.new(color.maroon, 0)colorDailyHigh
Daily Lowcolorcolor.new(color.lime, 0)colorDailyLow
Source Timeframestring4HfibSource
Show FibbooltrueshowFib
23.6%boolfalseshowFib236
38.2%boolfalseshowFib382
50.0%booltrueshowFib500
61.8%booltrueshowFib618
78.6%booltrueshowFib786
Shade 61.8%-78.6% ZonebooltrueshowGoldenZone
Start Fib at Swing Endpoint (backpainted)boolfalsebackpaintFib
Show Entry MarkersbooltrueshowMarkers
RSI Lengthint14rsiLength
Baseline Long RSI Maximumint35baselineLongRsi
Baseline Short RSI Minimumint65baselineShortRsi
Show Values TableboolfalseshowTable
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

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

Omar Edited WF

by Alorse
330 stars

Omar Edited WF is a trading strategy overlay built around Williams Fractals and multiple Exponential Moving Averages. It detects high and low fractal pivot points over configurable lookback periods alongside three adjustable EMA trendlines. Long entries are ma

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Omar Edited WF
257 stars

This strategy calculates dynamic support and resistance levels using pivot highs and lows alongside a custom smoothed trend filter and a 3-period EMA. It identifies entry opportunities when price breaks out relative to the trend filter and short-term EMA cross

Strategy v5 TrendSupport & resistance Repaints
Updated 6 weeks ago · None stated GitHub repository of 30s - ES 1m Strategy Candle Bar
106 stars

This overlay strategy plots a two-timeframe Ichimoku setup on the price chart, with Tenkan, Kijun, Chikou, and Kumo from a base higher timeframe and an optional highest-timeframe cloud. It allows two entries in the same direction and uses ATR-based trailing st

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of 2Tier Ichimoku Pyramiding [Takazudo]
104 stars

This strategy combines three Exponential Moving Averages with Williams Fractals to execute trend-following or mean-reverting trades. It analyzes price structure using short, medium, and long-term EMAs along with fractal highs and lows. Entries trigger when fra

Strategy v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of 3MA and Fractals Strategy

More Support & resistance 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