Trampoline-Liquidity Hunter( It Repaints ) |
The Trampoline-Liquidity Hunter script is a trading tool that combines momentum and liquidity detection techniques to provide high-probability trade signals, dynamic targets, and market structure visualization. This script was developed by modifying and combining existing methodologies:
- Oracle Script(Trampoline was Extracted from it)– originally created for trend and liquidity detection, converted and adapted by Sammer800.
- Liquidity Hunter ChartPrime – incorporated into the Trampoline logic, also converted and refined by Sammer800.
Key Features
Signal Detection
- Trampoline Entries
etects upthrusts (buy) and downthrusts (sell) using a combination of:
- Bollinger Bands breakouts
- RSI overbought/oversold levels
- Price action momentum (candlestick color & movement)
- Lookback Logic: Signals can account for momentum over the previous 5 bars to filter false triggers.
Trade Management
- Dynamic entry, stop-loss (SL), and profit target (TP) calculations based on ATR multiples.
- CHOCH (Change of Character) and BOS (Break of Structure) levels automatically tracked.
- Trade end markers indicate wins and losses visually.
Liquidity Hunter Integration
- Draws target and stop levels in the style of Liquidity Hunter.
- Cloud visualization between dynamic top/bottom levels to highlight active trades.
- Optional bar coloring to identify trades based on liquidity conditions.
Indicators & Visuals
- Bollinger Bands (upper, lower, middle) for volatility context
- ATR-based dynamic bands for adaptive trade sizing
- Optional chart bubbles and labels to highlight CHOCH/BOS points
- Real-time P/L, win-rate, and trade count displayed on chart
Inputs & Customization
- RSI length, thresholds, and source
- Bollinger Band length, source, and standard deviation
- ATR length, target multipliers, stop-loss multipliers
- Toggle visibility for signals, labels, clouds, and info panel
Alerts
- Configurable buy/sell alerts with sounds for immediate notification.
- Works seamlessly in live trading and backtesting environments.
Intended Use
This script is designed for active traders who want to:
- Identify high-probability entry points using liquidity and momentum
- Manage trades dynamically with ATR-based stops and targets
- Visualize market structure and key levels in real time
It is suitable for day trading, swing trading, and scalping, and can be applied across multiple asset classes (stocks, futures, forex).
Credits
- Original Oracle Script(Trampoline extracted): Adapted and converted by Sammer800
- Liquidity Hunter ChartPrime: Converted and integrated by Sammer800
- Trampoline-Liquidity Hunter Logic: Combined and enhanced by [CANDO13579]
Code:
# Trampoline-Liquidity Hunter
# Original Oracle Script(Trampoline extracted): Adapted and converted by Sammer800
# Liquidity Hunter ChartPrime: Converted and integrated by Sammer800
# Trampoline-Liquidity Hunter Logic: Combined and enhanced by [CANDO13579]
# ====================
# INPUTS
# ====================
# Inputs
input showInfoLabel = yes;
input colorLiquidityBars = yes;
input useFilter = no;
input filterLength = 14;
input showMarketCharacter = {Default "Lines & Labels", "Lines Only", "Labels Only", "Don't Show"};
input bodyPercentage = 30; # "Body %" tooltip = "Body Value will be lower than this "
input WickPercentage = 60; # "Wick %" tooltip = "Wick Value will be higher than this "
input ShowTargets = yes; # "Show Targets"
input lostSize = 100;
input targetMulti = 1.5; # "Profit Target "
input stopLossMulti = 1.5; # "SL Target "
input showLabels = yes;
input showATRLevels = yes;
input iBBThreshold = 0.0015; # Bollinger Lower Threshold
input RSIThreshold = 25; # RSI Lower Threshold
input RSIDown = 72; # RSI Upper Threshold
input rsiLengthInput = 14; # RSI Length
input rsiSourceInput = close; # Source for RSI
input lengthBB = 20; # Length for Bollinger Bands
input srcBB = close; # Source for Bollinger Bands
input multBB = 2.0; # StdDev for Bollinger Bands
input atrLength = 14; # ATR Length
# ====================
# VARIABLES
# ====================
def na = Double.NaN;
def bar = CompoundValue(1, AbsValue(BarNumber()), 1);
def last = !IsNaN(close);
def bar_index = if last then bar else bar_index[1];
# Market character settings
def SMCLine;
def SMCLabel;
Switch (showMarketCharacter) {
Case "Lines Only" :
SMCLine = yes;
SMCLabel = no;
Case "Labels Only" :
SMCLine = no;
SMCLabel = yes;
Case "Don't Show" :
SMCLine = no;
SMCLabel = no;
Default :
SMCLine = yes;
SMCLabel = yes;
}
# ====================
# SCRIPTS
# ====================
Script FindPivots {
input dat = close;
input HL = 0;
input lbL = 5;
input lbR = 1;
def _nan;
def _BN;
def _VStop;
def _V;
def _pivotRange;
_BN = BarNumber();
_nan = Double.NaN;
_pivotRange = lbL + lbL;
_VStop = if !isNaN(dat[_pivotRange]) and lbr > 0 and lbl > 0 then
fold a = 1 to lbR + 1 with b=1 while b do
if HL > 0 then dat > GetValue(dat,-a) else dat < GetValue(dat,-a) else _nan;
if (HL > 0) {
_V = if _BN > lbL and dat == Highest(dat, lbL+1) and _VStop then dat else _nan;
} else {
_V = if _BN > lbL and dat == Lowest(dat, lbL+1) and _VStop then dat else _nan;
}
plot result = if !IsNaN(_V) and _VStop then _V else _nan;
}
Script get_counts {
input condition = no;
input top = high;
input btm = low;
def count;
if condition {
count = 0;
} else {
count = count[1] + (if low < top and high > btm then 1 else 0);
}
plot cnt = count;
}
Script _Band {
input len = 5;
def nATR = ATR(LENGTH = len);
def Band = Min(nATR * 0.3, close * (0.3 / 100));
plot _Band = Band[20] / 2;
}
# ====================
# TRAMPOLINE
# ====================
def isRed = close < open;
def isGreen = close > open;
# Bollinger Bands Calculation
def basisBB = Average(srcBB, lengthBB);
def sd = StDev(srcBB, lengthBB);
def upperBB = basisBB + multBB * sd;
def lowerBB = basisBB - multBB * sd;
# Bollinger Band Width (Normalized)
def bbw = (upperBB - lowerBB) / basisBB;
# RSI Calculation
def rsiM = RSI(length = rsiLengthInput, price = rsiSourceInput);
# Trampoline Conditions
def backCond = isRed and rsiM <= RSIThreshold and close < lowerBB and bbw > iBBThreshold;
def backLookback = backCond[1] or backCond[2] or backCond[3] or backCond[4] or backCond[5];
def forCond = isGreen and rsiM >= RSIDown and close > upperBB and bbw > iBBThreshold;
def forLookback = forCond[1] or forCond[2] or forCond[3] or forCond[4] or forCond[5];
# Entry Signals
def weGoUp = isGreen and backLookback and high > high[1];
def upThrust = weGoUp and !weGoUp[1] and !weGoUp[2] and !weGoUp[3] and !weGoUp[4];
def weGoDown = isRed and forLookback and low < low[1];
def downThrust = weGoDown and !weGoDown[1] and !weGoDown[2] and !weGoDown[3] and !weGoDown[4];
# ========================
# LQUDTY-HUNTER-TRAMPOLINE
# ========================
def _Band_val = _Band(5);
def Zband = _Band(30);
# Trampoline signal
def signalActive = upThrust or downThrust;
# Store signal information
def signalType; # 1 for buy, -1 for sell
def signalPrice;
def signalIndex;
if upThrust {
signalType = 1;
signalPrice = close;
signalIndex = bar_index;
} else if downThrust {
signalType = -1;
signalPrice = close;
signalIndex = bar_index;
} else {
signalType = signalType[1];
signalPrice = signalPrice[1];
signalIndex = signalIndex[1];
}
#targets based on Liquidity Hunter logic
def nATR1 = ATR(Length = 14);
def longDiffSL = AbsValue(close - (low - nATR1 * stopLossMulti));
# Trade management(adapted for Trampoline)
def TradeisON;
def TP;
def SL;
def CHOCH;
def BOS;
def top;
def bot;
def ChochisON;
def BOSisON;
def ChoIndex;
def ChoIndex1;
def CHOCHLab;
def Bosindex;
def Bosindex1;
def bosLab;
def entry;
if signalActive and !TradeisON[1] {
entry = ohlc4;
TP = entry + (targetMulti * longDiffSL);
SL = entry - longDiffSL;
CHOCH = close + (targetMulti / 2 * longDiffSL);
BOS = low - (Zband * 15);
top = high + (Zband * 0.5);
bot = low - (Zband * 0.5);
ChoIndex = 0;
ChoIndex1 = 0;
Bosindex = 0;
Bosindex1 = 0;
CHOCHLab = na;
bosLab = na;
TradeisON = yes;
ChochisON = no;
BOSisON = no;
} else if TradeisON[1] {
entry = entry[1];
TP = TP[1];
SL = SL[1];
CHOCH = CHOCH[1];
BOS = BOS[1];
top = top[1];
bot = bot[1];
if close >= CHOCH and !ChochisON[1] {
ChoIndex = bar_index;
ChoIndex1 = signalIndex;
CHOCHLab = Floor((ChoIndex1 + ChoIndex) / 2);
ChochisON = yes;
} else {
ChoIndex = 0;
ChoIndex1 = 0;
CHOCHLab = na;
ChochisON = ChochisON[1];
}
if close <= BOS and !BOSisON[1] {
Bosindex = bar_index;
Bosindex1 = signalIndex;
bosLab = Floor((Bosindex1 + Bosindex) / 2);
BOSisON = yes;
} else {
Bosindex = 0;
Bosindex1 = 0;
bosLab = na;
BOSisON = BOSisON[1];
}
TradeisON = if high >= TP then no else if close <= SL then no else TradeisON[1];
} else {
entry = entry[1];
TP = TP[1];
SL = SL[1];
CHOCH = CHOCH[1];
BOS = BOS[1];
top = top[1];
bot = bot[1];
ChoIndex = 0;
ChoIndex1 = 0;
Bosindex = 0;
Bosindex1 = 0;
CHOCHLab = na;
bosLab = na;
TradeisON = if high >= TP then no else if close <= SL then no else TradeisON[1];
ChochisON = if TradeisON then ChochisON[1] else no;
BOSisON = if TradeisON then BOSisON[1] else no;
}
def plotCond = (TradeisON or TradeisON[2]);
def choChCond = TradeisON and bar_index >= HighestAll(ChoIndex1) - 1 and bar_index <= HighestAll(ChoIndex);
def bosCond = TradeisON and bar_index >= HighestAll(Bosindex1) - 1 and bar_index <= HighestAll(Bosindex);
def choChLabCond = bar_index == HighestAll(CHOCHLab);
def bosLabCond = bar_index == HighestAll(bosLab);
def topLine = if TradeisON and top then top else na;
def botLine = if TradeisON and bot then bot else na;
# ====================
# PLOTTING
# ====================
# Plot Trampoline signals
AddChartBubble(showLabels and upThrust, low, "T", Color.GREEN, no);
AddChartBubble(showLabels and downThrust, high, "T", Color.RED, yes);
# Plot Trampoline arrows
plot buySignal = upThrust;
buySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buySignal.SetDefaultColor(Color.GREEN);
buySignal.SetLineWeight(3);
buySignal.HideTitle();
plot sellSignal = downThrust;
sellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sellSignal.SetDefaultColor(Color.RED);
sellSignal.SetLineWeight(3);
sellSignal.HideTitle();
#Liquidity Hunter style levels(applied to Trampoline signals)
plot TpLine = if ShowTargets and plotCond and TP then TP else na;
plot SlLine = if ShowTargets and plotCond and SL then SL else na;
plot chLine = if SMCLine and choChCond then CHOCH else na;
plot boLine = if SMCLine and bosCond then BOS else na;
#levels like Liquidity Hunter
chLine.SetStyle(Curve.SHORT_DASH);
chLine.SetDefaultColor(CreateColor(4,123,136));
boLine.SetStyle(Curve.SHORT_DASH);
boLine.SetDefaultColor(Color.DARK_RED);
TpLine.SetDefaultColor(CreateColor(78, 255, 43));
SlLine.SetDefaultColor(Color.MAGENTA);
TpLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
SlLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#trade end markers
def endTrade = !TradeisON and TradeisON[1];
def win = high >= TP;
def los = close <= SL;
plot TradeEnd = if !ShowTargets then na else if endTrade[2] then if los[2] then SL[2] else TP[2] else na;
TradeEnd.SetLineWeight(2);
TradeEnd.AssignValueColor(if win[2] then Color.CYAN else Color.MAGENTA);
TradeEnd.SetPaintingStrategy(PaintingStrategy.SQUARES);
# ====================
# VISUAL ENHANCEMENTS
# ====================
# Clouds
AddCloud(topLine, botLine, Color.DARK_GRAY, Color.DARK_GRAY, yes);
# Chart bubbles
AddChartBubble(SMCLabel and choChLabCond, CHOCH + Zband, "C", Color.WHITE);
AddChartBubble(SMCLabel and bosLabCond, BOS - Zband, "B", Color.WHITE, no);
# Color bars based on liquidity detection
#AssignPriceColor(if colorLiquidityBars and TradeisON then Color.CYAN else Color.CURRENT);
# ====================
# INFO LABEL
# ====================
def winCnt = if endTrade then if win then winCnt[1] + 1 else winCnt[1] else winCnt[1];
def losCnt = if endTrade then if los then losCnt[1] + 1 else losCnt[1] else losCnt[1];
def PlAmt = if endTrade then if win then PlAmt[1] + (TP - entry) * lostSize else if los then PlAmt[1] - (entry - SL) * lostSize else PlAmt[1] else PlAmt[1];
def totTrade = winCnt + losCnt;
def winRate = if totTrade > 0 then winCnt / totTrade else 0;
def PL = Round(PlAmt, 2);
AddLabel(showInfoLabel, "Trades("+ totTrade+ ")" , Color.WHITE);
AddLabel(showInfoLabel, "P/L ($" + PL + ")", if PL > 0 then Color.GREEN else if PL < 0 then Color.RED else Color.GRAY);
AddLabel(showInfoLabel, "WinRate("+ AsPercent(winRate) + ")", if winRate > 0.50 then Color.GREEN else if winRate < 0.50 then Color.RED else Color.GRAY);
# ====================
# BOLLINGER BANDS
# ====================
plot BBUpper = upperBB;
BBUpper.SetDefaultColor(Color.GRAY);
BBUpper.SetLineWeight(1);
BBUpper.HideTitle();
plot BBLower = lowerBB;
BBLower.SetDefaultColor(Color.GRAY);
BBLower.SetLineWeight(1);
BBLower.HideTitle();
plot BBMiddle = basisBB;
BBMiddle.SetDefaultColor(Color.GRAY);
BBMiddle.SetLineWeight(1);
BBMiddle.SetStyle(Curve.SHORT_DASH);
BBMiddle.HideTitle();
# ====================
# ALERTS
# ====================
Alert(upThrust, "Trampoline BUY Signal", Alert.BAR, Sound.DING);
Alert(downThrust, "Trampoline SELL Signal", Alert.BAR, Sound.DING);
# ====================
# END OF SCRIPT
# ====================
Last edited by a moderator: