← All scripts
IndicatorOpen sourceVersion 1

Market Oracle Suite - independent

00

Adaptive Market Signals Toolkit brings directional signals, reversal analysis, dynamic price levels, and market-condition monitoring into one chart overlay. Its modular design lets traders select the components that fit their approach and build a consistent framework for evaluating potential setups

Market Oracle Suite - independent — screenshot 1 of 1

Screenshot 1 of 1 · Open image to view full size

About this script

Adaptive Market Signals Toolkit Adaptive Market Signals Toolkit brings directional signals, reversal analysis, dynamic price levels, and market-condition monitoring into one chart overlay. Its modular design lets traders select the components that fit their approach and build a consistent framework for evaluating potential setups. Trend and Reversal Signals Choose between signals that follow developing trends and signals that identify potential reversals. Adjustable sensitivity controls how readily the system responds to price changes, with lower tuning values generally producing more frequent signals. Optional automatic tuning selects parameters using historical results. Treat these settings as a starting point for evaluation: a configuration that performed well over a recent sample may behave differently as market conditions change. Custom Signal Builder Combine available toolkit conditions into personalized signals and alerts. A configurable lookback determines how close together the selected events must occur. For example, a custom condition can require both a directional signal and a supporting candlestick formation within a defined number of bars. This makes the relationship between observations explicit and helps apply the same criteria consistently. Adaptive Trend Filtering The Quantum Reactor provides a directional reference with a neutral gray state for unsettled or ranging conditions. Fast and slow response modes let users choose between quicker reactions and smoother trend assessment. Its role is to add context to individual signals. A signal appearing alongside a clear directional reading presents a different situation from one appearing while the filter remains neutral. Volatility-Adaptive Bands Quantum Bands combine momentum and volatility analysis to highlight areas of potential price extension and reversal. Higher-timeframe bands can be displayed on the active chart for broader context. A band interaction identifies an area to observe. Subsequent price behavior determines whether that interaction develops into a rejection, consolidation, or continued expansion. Dynamic Support, Resistance, and Ranges The Dynamic Reactor and Trend Assistant provide moving reference levels for trend assessment and potential support or resistance interactions. Multi-timeframe reactor settings extend that context beyond the current chart interval. Volume-weighted ranges add another set of reference zones, with coloring that reflects directional bias. These components require suitable volume data where volume enters the calculation. VWAP Channel Analysis Swing-based VWAP channels map potential mean-reversion areas. Upper and lower bands provide context for price extensions, while markers identify qualifying returns into the channel. Optional reset warnings indicate when the channel is preparing to anchor to new swing points, helping users recognize changes in the reference levels. Candlestick and Volatility Context Filtered candlestick labels highlight selected formations within the surrounding market activity. A separate volatility feature identifies unusually forceful candles, with an adjustable detection threshold. Market Overview Dashboard A compact dashboard brings together historical tuning guidance, directional scoring, consolidation readings, and a text-based market outlook. Higher directional scores indicate a more bullish assessment; lower scores indicate a more bearish one. Higher consolidation readings point toward greater range-bound behavior. Dashboard size and position can be adjusted to suit the chart layout. Exit References and Alerts Take-profit markers and projected levels support exit planning. Custom alerts allow selected combinations of conditions to be monitored without continuously watching the chart. These outputs provide analytical references; trade execution and position management remain part of the user’s own workflow. Flexible Visual Configuration Enable individual overlays, adjust signal responsiveness, and select candle-coloring styles to control how much information appears on the chart. A focused configuration makes the relationships between signals, trend filters, and price levels easier to review. Start by defining the type of setup you want to study, then select the relevant conditions and supporting references. Review how that configuration behaves across different market environments, including periods when signals conflict or fail. The toolkit supports structured analysis while leaving entry rules, invalidation, and risk limits under the trader’s control.

Source code

Read and review the complete source before using it in your account.

script("Market Oracle Suite - independent", kind="indicator")

input signalMode = 0

input manualLength = 21
input autoTune = 1
input tuningMin = 8
input tuningMax = 32
input tuningStep = 4
input tuningWindow = 120
input tuningFeeBps = 5
input atrLength = 14
input trendThreshold = 18
input bandMultiplier = 1.8
input useVolume = 1
input sessionSeconds = 86400
input sessionOffset = 0
input useMTF = 0
input higherFrame = 3600
input higherLength = 3
input showSignals = 1
input showBands = 1
input showRanges = 1
input showCloud = 1
input showTargets = 1
input showPatterns = 1
input showDashboard = 1
input candleHighlight = 1

atr = ta.atr(atrLength)
adx = ta.adx(14)
manualReactor = ta.ema(close, manualLength)
tunedReactor = ta.tunedEma(close, tuningMin, tuningMax, tuningStep, tuningWindow, tuningFeeBps)
chosenLength = ta.tuneLength(close, tuningMin, tuningMax, tuningStep, tuningWindow, tuningFeeBps)
reactor = autoTune == 1 ? tunedReactor : manualReactor
optimalLength = autoTune == 1 ? chosenLength : manualLength
kernel = ta.kernelRQ(close, 12, 8, 32)
residual = close - kernel
noise = ta.stdev(residual, 32)
width = math.max(atr * bandMultiplier, nz(noise, 0) * 2)
upperBand = kernel + width
lowerBand = kernel - width
consolidation = math.clamp(10 - adx / 4, 0, 10)
ready = not na(atr) and not na(adx) and atr > 0
trend = not ready or adx < trendThreshold ? 0 : close > reactor and reactor > reactor[1] ? 1 : close < reactor and reactor < reactor[1] ? -1 : 0
shade = trend == 1 ? "#62E8A4" : trend == -1 ? "#F35A64" : "#87909F"
cloudUpper = showCloud == 1 ? reactor + atr * 0.15 : na
cloudLower = showCloud == 1 ? reactor - atr * 0.15 : na
bandTop = showBands == 1 ? upperBand : na
bandBottom = showBands == 1 ? lowerBand : na

priceSource = (high + low + close) / 3
sessionBasis = ta.sessionVwap(priceSource, sessionSeconds, sessionOffset)
sessionDeviation = ta.sessionVwapDev(priceSource, sessionSeconds, sessionOffset)
volumeReady = useVolume == 1 and not na(volume) and volume > 0 and not na(sessionBasis)
rangeBasis = showRanges == 1 and volumeReady ? sessionBasis : na
rangeTop = showRanges == 1 and volumeReady ? sessionBasis + sessionDeviation * 2 : na
rangeBottom = showRanges == 1 and volumeReady ? sessionBasis - sessionDeviation * 2 : na

htfBasis = na
htfWidth = na
if useMTF == 1 {
    htfBasis = ta.htfEma(close, higherFrame, higherLength)
    htfWidth = ta.htfAtr(higherFrame, higherLength)
}
htfTop = showBands == 1 and useMTF == 1 ? htfBasis + htfWidth * bandMultiplier : na
htfBottom = showBands == 1 and useMTF == 1 ? htfBasis - htfWidth * bandMultiplier : na

rsi = ta.rsi(close, 14)
priceScore = ready ? math.clamp((close - reactor) / atr, -2, 2) : 0
kernelScore = kernel > kernel[1] ? 1 : kernel < kernel[1] ? -1 : 0
momentumScore = not na(rsi) ? math.clamp((rsi - 50) / 25, -1, 1) : 0
volumeScore = volumeReady ? (close > sessionBasis ? 1 : close < sessionBasis ? -1 : 0) : 0
scoreWeight = volumeReady ? 5 : 4
primeScore = math.clamp(5 + (priceScore + kernelScore + momentumScore + volumeScore) * 5 / scoreWeight, 0, 10)
forecast = not ready ? "Warming up" : consolidation >= 6 ? "Ranging" : primeScore >= 6 ? "Bullish bias" : primeScore <= 4 ? "Bearish bias" : "Neutral"

bullTrend = ready and trend == 1 and nz(trend[1], 0) != 1
bearTrend = ready and trend == -1 and nz(trend[1], 0) != -1
bullReversal = ready and low < lowerBand and close > lowerBand and close > open
bearReversal = ready and high > upperBand and close < upperBand and close < open
bullEngulf = close > open and close[1] < open[1] and close >= open[1] and open <= close[1]
bearEngulf = close < open and close[1] > open[1] and close <= open[1] and open >= close[1]
htfBull = useMTF == 0 or (not na(htfBasis) and close > htfBasis)
htfBear = useMTF == 0 or (not na(htfBasis) and close < htfBasis)
longCandidate = signalMode == 0 ? trend == 1 : signalMode == 1 ? bullReversal : bullTrend and bullEngulf
shortCandidate = signalMode == 0 ? trend == -1 : signalMode == 1 ? bearReversal : bearTrend and bearEngulf
longQualified = longCandidate and htfBull
shortQualified = shortCandidate and htfBear
buy = isClosed and longQualified and not nz(longQualified[1], 0)
sell = isClosed and shortQualified and not nz(shortQualified[1], 0) and not buy

entry = buy or sell ? close : entry[1]
entryRisk = buy or sell ? atr * 1.5 : entryRisk[1]
entryDirection = buy ? 1 : sell ? -1 : nz(entryDirection[1], 0)
entryBar = buy or sell ? barIndex : nz(entryBar[1], -1)
stopPrice = entry - entryDirection * entryRisk
targetOne = entry + entryDirection * entryRisk
targetTwo = entry + entryDirection * entryRisk * 2
targetThree = entry + entryDirection * entryRisk * 3

plot(reactor, title="Adaptive Reactor", colorSeries=shade, width=3)
plot(kernel, title="Kernel Assistant", color="#8D91FF", width=1)
plot(bandTop, title="Reversal band high", color="#E67791", width=1)
plot(bandBottom, title="Reversal band low", color="#62DCC7", width=1)
fill(bandTop, kernel, color="#C65C7C", opacity=0.035)
fill(kernel, bandBottom, color="#43BDA7", opacity=0.035)
fill(cloudUpper, cloudLower, colorSeries=shade, opacity=0.22)
plot(rangeBasis, title="Session VWAP", color="#ECC06B", width=1)
plot(rangeTop, title="Session range high", color="#ECC06B", width=1)
plot(rangeBottom, title="Session range low", color="#ECC06B", width=1)
plot(htfTop, title="Closed HTF high", color="#B09AE6", style="step", width=1)
plot(htfBottom, title="Closed HTF low", color="#B09AE6", style="step", width=1)

plotText(low, when=buy and showSignals == 1, text="BUY", color="#11281D", background="#62E8A4", style="label", position="below", fontSize=10)
plotText(high, when=sell and showSignals == 1, text="SELL", color="#FFFFFF", background="#E34F63", style="label", position="above", fontSize=10)
plotShape(low, when=bullEngulf and showPatterns == 1, shape="diamond", color="#62E8A4", position="below", size=4)
plotShape(high, when=bearEngulf and showPatterns == 1, shape="diamond", color="#E34F63", position="above", size=4)
barcolor(candleHighlight == 1, color=shade)
alertcondition(buy, title="Oracle BUY", message="Independent Oracle: closed-bar BUY")
alertcondition(sell, title="Oracle SELL", message="Independent Oracle: closed-bar SELL")

if showTargets == 1 and entryBar >= 0 and not na(entryRisk) {
    draw.line("entry", entryBar, entry, barIndex + 8, entry, color="#A3ADBF", style="dotted", text="Entry {price}")
    draw.line("stop", entryBar, stopPrice, barIndex + 8, stopPrice, color="#E34F63", style="dashed", text="SL {price}")
    draw.line("tp1", entryBar, targetOne, barIndex + 8, targetOne, color="#62E8A4", style="dashed", text="TP1 {price}")
    draw.line("tp2", entryBar, targetTwo, barIndex + 8, targetTwo, color="#62E8A4", style="dashed", text="TP2 {price}")
    draw.line("tp3", entryBar, targetThree, barIndex + 8, targetThree, color="#62E8A4", style="dashed", text="TP3 {price}")
}

if showDashboard == 1 {
    table.cell("oracle", 0, 0, "ORACLE SUITE", color="#FFFFFF", background="#29334A")
    table.cell("oracle", 1, 0, "Independent", color="#AEBBDA", background="#29334A")
    table.cell("oracle", 0, 1, "Tuning")
    table.cell("oracle", 1, 1, "" + optimalLength, color="#ECC06B")
    table.cell("oracle", 0, 2, "Prime score")
    table.cell("oracle", 1, 2, "" + math.round(primeScore) + "/10", color=shade, progress=primeScore / 10)
    table.cell("oracle", 0, 3, "Consolidation")
    table.cell("oracle", 1, 3, ready ? "" + math.round(consolidation) + "/10" : "Warming", color="#B09AE6", progress=ready ? consolidation / 10 : 0)
    table.cell("oracle", 0, 4, "Outlook")
    table.cell("oracle", 1, 4, forecast, color=shade)
    table.cell("oracle", 0, 5, "Volume / VWAP")
    table.cell("oracle", 1, 5, volumeReady ? "Active" : "Inactive", color=volumeReady ? "#62E8A4" : "#87909F")
    table.cell("oracle", 0, 6, "HTF filter")
    table.cell("oracle", 1, 6, useMTF == 0 ? "Off" : na(htfBasis) ? "Warming" : "Closed only", color="#AEBBDA")
}

Version history

  1. Version 1
    View this version →

Discussion · 0

Support this script and join the discussion from your broker’s trading terminal using your author profile.

    No comments yet.