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
オープンソーススクリプト
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
免責事項
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
オープンソーススクリプト
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
免責事項
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.