OPEN-SOURCE SCRIPT
JonnyFutures Scalpomatic

This indicator combines Fair Value Gap (FVG) detection with Exponential Moving Average (EMA) signals to help identify potential trade entry points based on market inefficiencies and trend direction.
⚙️ Main Components
1. EMAs
Two EMAs are calculated:
EMA 20 (short-term trend)
EMA 50 (medium-term trend)
ema20 = ta.ema(close, len20)
ema50 = ta.ema(close, len50)
These are plotted on the chart:
Orange line = EMA 20
Purple line = EMA 50
2. Fair Value Gaps (FVGs)
The script looks for gaps in price structure (imbalances):
Bullish FVG → when the high from two bars ago is less than the current bar’s low
→ Indicates a potential bullish inefficiency.
Bearish FVG → when the low from two bars ago is greater than the current bar’s high
→ Indicates a potential bearish inefficiency.
bullishFVG = high[2] < low[0]
bearishFVG = low[2] > high[0]
When found, the background color changes:
Light Green for bullish FVGs
Light Red for bearish FVGs
bgcolor(bullishFVG ? color.new(color.green,90) : na)
bgcolor(bearishFVG ? color.new(color.red,90) : na)
3. EMA Crossover Signals
The script plots visual buy/sell markers when the closing price crosses above or below each EMA:
For EMA 20:
✅ Long signal (triangle up, lime): close crosses above EMA 20
❌ Short signal (triangle down, red): close crosses below EMA 20
For EMA 50:
✅ Long signal (triangle up, aqua): close crosses above EMA 50
❌ Short signal (triangle down, maroon): close crosses below EMA 50
These signals help identify potential trend-following entries or exits.
📈 How to Use It
Trend Confirmation:
Watch the EMAs — if EMA20 > EMA50, the trend is generally bullish; if EMA20 < EMA50, it’s bearish.
FVG Zones:
When a bullish or bearish FVG appears, it highlights potential retracement zones where price may rebalance before continuing the trend.
Entry Timing:
Combine FVGs with EMA cross signals for confluence:
Long bias → bullish FVG + price crossing above EMA 20 or 50.
Short bias → bearish FVG + price crossing below EMA 20 or 50.
🎯 Summary
This indicator:
Detects Fair Value Gaps and shades them visually.
Plots EMA 20 and EMA 50 to define short- and mid-term trends.
Marks entry/exit signals when price crosses these EMAs.
Is designed for trend-following trades with FVG confirmation
⚙️ Main Components
1. EMAs
Two EMAs are calculated:
EMA 20 (short-term trend)
EMA 50 (medium-term trend)
ema20 = ta.ema(close, len20)
ema50 = ta.ema(close, len50)
These are plotted on the chart:
Orange line = EMA 20
Purple line = EMA 50
2. Fair Value Gaps (FVGs)
The script looks for gaps in price structure (imbalances):
Bullish FVG → when the high from two bars ago is less than the current bar’s low
→ Indicates a potential bullish inefficiency.
Bearish FVG → when the low from two bars ago is greater than the current bar’s high
→ Indicates a potential bearish inefficiency.
bullishFVG = high[2] < low[0]
bearishFVG = low[2] > high[0]
When found, the background color changes:
Light Green for bullish FVGs
Light Red for bearish FVGs
bgcolor(bullishFVG ? color.new(color.green,90) : na)
bgcolor(bearishFVG ? color.new(color.red,90) : na)
3. EMA Crossover Signals
The script plots visual buy/sell markers when the closing price crosses above or below each EMA:
For EMA 20:
✅ Long signal (triangle up, lime): close crosses above EMA 20
❌ Short signal (triangle down, red): close crosses below EMA 20
For EMA 50:
✅ Long signal (triangle up, aqua): close crosses above EMA 50
❌ Short signal (triangle down, maroon): close crosses below EMA 50
These signals help identify potential trend-following entries or exits.
📈 How to Use It
Trend Confirmation:
Watch the EMAs — if EMA20 > EMA50, the trend is generally bullish; if EMA20 < EMA50, it’s bearish.
FVG Zones:
When a bullish or bearish FVG appears, it highlights potential retracement zones where price may rebalance before continuing the trend.
Entry Timing:
Combine FVGs with EMA cross signals for confluence:
Long bias → bullish FVG + price crossing above EMA 20 or 50.
Short bias → bearish FVG + price crossing below EMA 20 or 50.
🎯 Summary
This indicator:
Detects Fair Value Gaps and shades them visually.
Plots EMA 20 and EMA 50 to define short- and mid-term trends.
Marks entry/exit signals when price crosses these EMAs.
Is designed for trend-following trades with FVG confirmation
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.