Cari dalam skrip untuk "session"
Уровни SL/TP и значение ATR первого часаSession Range SL/TP Levels with Advanced ATR
Overview
The Session Range SL/TP Levels indicator is a comprehensive tool designed for session-based trading strategies, particularly for breakouts. It identifies the high and low of a user-defined time range (e.g., the Asian session) and uses a sophisticated, customizable Average True Range (ATR) calculation to project key Stop Loss (SL) and Take Profit (TP) levels.
This indicator helps traders visualize potential entry and exit points based on the volatility of a specific trading session, with all crucial data presented in a clean on-screen table.
Key Features
Customizable Trading Session: Define any time range to establish your core trading zone. The indicator will automatically find the high and low of this period.
Advanced ATR Calculation: The indicator uses an ATR calculated on a 5-minute timeframe for higher precision. You can customize:
The ATR length and smoothing method (RMA, SMA, EMA, WMA).
A unique percentage reduction from the ATR to create a more conservative volatility buffer.
Volatility-Based SL/TP Levels: Automatically calculates and plots multiple SL and TP levels for both long and short scenarios based on user-defined multipliers of the modified ATR.
Comprehensive On-Screen Display: A detailed on-screen table provides all critical data at a glance, including:
The original 5-min ATR value.
The modified ATR after the percentage reduction.
Three custom ATR-multiple values for quick reference.
All calculated SL and TP price levels for both Long and Short setups.
Copy-Friendly Data Logging: With a single click in the settings, you can print all calculated values into the Pine Logs panel, allowing for easy copying and pasting into other applications or trading journals.
How to Use
Define Your Session: In the settings, enter the time for the trading session you want to analyze (e.g., "0200-0300" for a part of the Asian session).
Identify the Range: The indicator will draw the high and low of this session once the time period is complete.
Plan Your Trade: The calculated levels provide potential targets for breakout trades.
For a Long Trade: If the price breaks above the session high, the green Take Profit lines (TP1, TP2, TP3) serve as potential exit points, while the Stop Loss (Long) level serves as a volatility-based stop.
For a Short Trade: If the price breaks below the session low, the red Take Profit lines serve as potential targets, with the Stop Loss (Short) level as the corresponding stop.
Reference the Table: Use the on-screen table to see the exact price levels and ATR values without needing to hover over the lines.
timer/tr/atr [keypoems]Session and Instant Volatility Ticker
What it actually does:
- Session ATR – Reports the historical (e.g. “0200-0600”) average true range of the past x sessions, reports the +1Stdev value.
- Real-time ATR feed – streams the current ATR value every tick.
- Ticker line – Sess. ATR +1Stdev | Current ATR | Previous TR | 🕒 Time-left-in-bar |
Think of it as a volatility check: a single glance tells you if the average candle size is compatible with your usual stop or not.
Open Source.
ORB 15m + MAs (v4.1)Session ORB Live Pro — Pre-Market Boxes & MA Suite (v4.1)
What it is
A precision Opening Range Breakout (ORB) tool that anchors every session to one specific 15-minute candle—then projects that same high/low onto lower timeframes so your 1m/5m levels always match the source 15m bar. Perfect for scalpers who want session structure without drift.
What it draws
Asia, Pre-London, London, Pre-New York, New York session boxes.
On 15m: only the high/low of the first 15-minute bar of each window (optionally persists for extra bars).
On 5m: mirrors the same 15m range, visible up to 10 bars.
On 1m: mirrors the same 15m range, visible up to 15 bars.
Levels update live while the 15m candle is forming, then lock.
Fully editable windows (easy UX)
Change session times with TradingView’s native input.session fields using the familiar format HHMM-HHMM:1234567. You can tweak each window independently:
Asia
Pre-London
London
Pre-New York
New York
Multi-TF logic (no guesswork)
Designed to show only on 1m, 5m, 15m (by default).
15m = ground truth. Lower timeframes never “recalculate a different range”—they mirror the 15m bar for that session, exactly.
Alerts
Optional breakout alerts when price closes above/below the session range.
Clean visuals
Per-session color controls (box + lines). Boxes extend only for the configured number of bars per timeframe, keeping charts uncluttered.
Built-in MA suite
SMA 50 and RMA 200.
Three extra MAs (SMA/EMA/RMA/WMA/HMA) with selectable color, width, and style (line, stepline, circles).
Why traders like it
Consistency: Lower-TF ranges always match the 15m source bar.
Speed: You see structure immediately—no waiting for N bars.
Control: Edit session times directly; tune how long boxes stay on chart per TF.
Clarity: Minimal, purposeful plotting with alerts when it matters.
Quick start
Set your session times via the five input.session fields.
Choose how long boxes persist on 1m/5m/15m.
Enable alerts if you want instant breakout notifications.
(Optional) Configure the MA suite for trend/bias context.
Best for
Intraday traders and scalpers who rely on repeatable session behavior and demand exact cross-TF alignment of ORB levels.
Sessions High/LowIndicator lines to show the prior days NY high/low, overnight Asian high/low, and recent London high/low. Time frame variables are included as well as the option to change colors for both the high and low. Good luck.
Sessions Rainbow EST with overlapsThis script displays the trading zones with overlaps based on the color of the rainbow. It is used with a Point&Figure chart to show trends associated with trading periods and overlapping trading periods.
Sessions - London NY overlapOther scripts show London closing at 5pm GMT whereas i believe the forex market on London closes at 4pm GMT. So i have adjusted an already published script to reflect this
SeparatorsSession - H1 and below Time Frame
Day - H4 and below Time Frame
Month - D Time Frame
Quarter - W Time Frame
Session Key Levels Lines (with Labels)This is an extension of the previous indicator, it just plots all the information you need automatically for you so you dont have to lift a finger. hope it helps :)
Session Moving AveragesAdds EMAs and SMAs to chart using 8am-8pm EST values. Completely configurable in settings.
Some platforms allow users to configure what time frame they would like to view market data. One popular selection is 8am-8pm EST as 8am is when institutional orders go through. An argument can be made that price action before 8am EST is not valid yet moving averages will use that data.
This matters less for shorter moving averages such as a 9 or 20 ema, but it dramatically changes the 200 or the 50 sma for example.
This script allows you to ignore that pre-market data (or any data you choose to configure in the settings) and select up to 3 moving averages (either Exponential or Simple) for a set time.
By default the moving averages include the 9-ema (gray), 20-ema (green), and 200-sma (purple) and is set to 8am-8pm EST
This is configurable in the settings including the time frame you would like the moving averages to start using market data.
By default the script will use your charts timeframe. You are able to use multi-time frames with this script just scroll down to "timeframe", then click "chart" in settings... this will then allow you to select a timeframe.
A popular choice is 5-minute value of 8am-8pm EST moving averages. This means regardless of the time frame you are on (sub 1-minute, 1-minute, etc.) the script will display 5-minute data.
Final note: In settings you are able to turn on/off shapes (the gray lines at the bottom) which shows when the data is being used. This can be helpful on certain tickers that trade continuously such as /ES or /NQ.
Session Time RangesHave you ever wondered if you are trading at the right time of the day or feel like all the good trades happen when you are sleeping? Well now you can check your theory :)
This Script allows you to highlight a time range on your chart over a 24hour time period. For example 3AM to 6AM
The script has two time variables, set your start time and end time based on a 24 hour clock and set the time zone offset variable to match your charts time zone. For example New York -4 (for utc just enter 0 for no offset )
This is a quick script I put together so hopefully it is error free enjoy :)
Session P4L MTFCorrected indicator for better support of smaller time frames. version 3.0 with better interface. thank you
Session P EdgesThis is an attempt to chart the primary balance ranges, however,
I have been having difficulty getting the lows to work in the graph, any assistance would be welcome
RTACoreLibrary "RTACore"
Advanced multi-timeframe technical analysis framework for Pine Script
@author WavesUnchained
@build 2025-10-14 22:41:47
newFloatResult(value, context)
Create a successful Result with float value
Parameters:
value (float)
context (string)
newStringResult(value, context)
Create a successful Result with string value
Parameters:
value (string)
context (string)
newBoolResult(value, context)
Create a successful Result with boolean value
Parameters:
value (bool)
context (string)
newErrorResult(errorCode, errorMessage, floatFallback, stringFallback, boolFallback, context)
Create an error Result with fallback values
Parameters:
errorCode (string)
errorMessage (string)
floatFallback (float)
stringFallback (string)
boolFallback (bool)
context (string)
addResultTag(result, tag)
Add a tag to Result
Parameters:
result (Result)
tag (string)
newSignalResult(signalStrength, signalType)
Create a signal Result with trading-specific tags
Parameters:
signalStrength (float)
signalType (string)
newIndicatorResult(value, indicatorName)
Create an indicator calculation Result with indicator tag
Parameters:
value (float)
indicatorName (string)
newTimeframeResult(value, timeframe, context)
Create a timeframe-specific Result
Parameters:
value (float)
timeframe (string)
context (string)
newConfluenceResult(confluenceScore, confidenceLevel)
Create a confluence Result with confidence level
Parameters:
confluenceScore (float)
confidenceLevel (string)
newValidationResult(context)
Create a new validation result (starts as valid)
Parameters:
context (string)
newValidationSuccess(context)
Create a successful validation result
Parameters:
context (string)
newValidationFailure(errors, context)
Create a failed validation result with errors
Parameters:
errors (array)
context (string)
addValidationError(result, field, error)
Add an error to validation result
Parameters:
result (ValidationResult)
field (string)
error (string)
addValidationWarning(result, field, warning)
Add a warning to validation result
Parameters:
result (ValidationResult)
field (string)
warning (string)
addValidationCorrection(result, correction)
Add a correction to validation result
Parameters:
result (ValidationResult)
correction (string)
setValidationMode(result, mode)
Set validation mode
Parameters:
result (ValidationResult)
mode (string)
getValidationMode(result)
Get validation mode
Parameters:
result (ValidationResult)
incrementValidatedFields(result)
Increment validated fields counter
Parameters:
result (ValidationResult)
setValidationTotalFields(result, total)
Set total fields for validation
Parameters:
result (ValidationResult)
total (int)
calculateValidationScore(result)
Calculate and update validation score based on errors/warnings
Parameters:
result (ValidationResult)
newPerformanceProfile(functionName)
Create a new performance profile
Parameters:
functionName (string)
startTiming(profile)
Start timing a performance profile (simple)
Parameters:
profile (PerformanceProfile)
endTiming(profile, hadError)
End timing and update performance profile
Parameters:
profile (PerformanceProfile)
hadError (bool)
updateMemoryEstimate(profile, arrayElements)
Set estimated memory usage (array elements)
Parameters:
profile (PerformanceProfile)
arrayElements (int)
newHealthyStatus()
Create a new healthy status
setComponentHealth(status, component, isOK, message)
Set component health status
Parameters:
status (HealthStatus)
component (string)
isOK (bool)
message (string)
isHealthyOverall(status)
Quick health check - are all components OK?
Parameters:
status (HealthStatus)
getHealthSummary(status)
Get simple health summary
Parameters:
status (HealthStatus)
hasValidFloat(result)
Check if Result contains a valid float value
Parameters:
result (Result)
hasValidString(result)
Check if Result contains a valid string value
Parameters:
result (Result)
getFloat(result, fallback)
Get float value from Result with fallback
Parameters:
result (Result)
fallback (float)
getString(result, fallback)
Get string value from Result with fallback
Parameters:
result (Result)
fallback (string)
getBool(result, fallback)
Get boolean value from Result with fallback
Parameters:
result (Result)
fallback (bool)
hasResultTag(result, tag)
Check if Result has specific tag
Parameters:
result (Result)
tag (string)
getResultTags(result)
Get all tags from Result
Parameters:
result (Result)
setResultContext(result, context)
Set operation context for Result
Parameters:
result (Result)
context (string)
filterResultsByTag(results, tag)
Filter Results by tag (utility for arrays of Results)
Parameters:
results (array)
tag (string)
getAllResultTags(results)
Get all unique tags from array of Results
Parameters:
results (array)
newDefaultAnalysisConfig()
Create default analysis configuration
newAggressiveAnalysisConfig()
Create aggressive trading configuration
newConservativeAnalysisConfig()
Create conservative trading configuration
newDefaultTimeframeConfig()
Create default timeframe configuration
newIntradayTimeframeConfig()
Create intraday timeframe configuration
newSwingTimeframeConfig()
Create swing trading timeframe configuration
getConfigSummary(config)
Get configuration summary string
Parameters:
config (AnalysisConfig)
cloneAnalysisConfig(source)
Clone analysis configuration
Parameters:
source (AnalysisConfig)
newGenericAnalysis(analysisType, timeframe)
Create a new generic analysis result
Parameters:
analysisType (string)
timeframe (string)
newConsensusData()
Create empty consensus data
newNeutralSignal(reason)
Create a neutral signal result
Parameters:
reason (string)
newBuySignal(score, confidence, reason)
Create a buy signal result
Parameters:
score (float)
confidence (float)
reason (string)
newSellSignal(score, confidence, reason)
Create a sell signal result
Parameters:
score (float)
confidence (float)
reason (string)
newMultiTimeframeResult(config, tfConfig)
Create new multi-timeframe result
Parameters:
config (AnalysisConfig)
tfConfig (TimeframeConfig)
getAnalysisAction(analysis)
Get analysis action string
Parameters:
analysis (GenericAnalysis)
isBullish(analysis)
Check if analysis is bullish
Parameters:
analysis (GenericAnalysis)
isBearish(analysis)
Check if analysis is bearish
Parameters:
analysis (GenericAnalysis)
getSignalSummary(signal)
Get signal summary string
Parameters:
signal (SignalResult)
hasStrongConsensus(consensus)
Check if consensus is strong
Parameters:
consensus (ConsensusData)
getConsensusSummary(consensus)
Get consensus summary
Parameters:
consensus (ConsensusData)
isActionableSignal(signal)
Check if signal is actionable
Parameters:
signal (SignalResult)
getSignalColor(signal)
Get signal color for UI display
Parameters:
signal (SignalResult)
validateAnalysisConfig(config)
Validate analysis configuration
Parameters:
config (AnalysisConfig)
validateTimeframeConfig(config)
Validate timeframe configuration
Parameters:
config (TimeframeConfig)
validatePriceData(prices)
Validate price data array
Parameters:
prices (array)
sanitizeFloat(value, minVal, maxVal, defaultVal)
Sanitize numeric input
Parameters:
value (float)
minVal (float)
maxVal (float)
defaultVal (float)
sanitizeInt(value, minVal, maxVal, defaultVal)
Sanitize integer input
Parameters:
value (int)
minVal (int)
maxVal (int)
defaultVal (int)
sanitizeFloatArray(arr)
Sanitize array by removing invalid values
Parameters:
arr (array)
logError(message)
Log error message
Parameters:
message (string)
logWarning(message)
Log warning message
Parameters:
message (string)
safeExecute(operationName, condition)
Safe execute wrapper
Parameters:
operationName (string)
condition (bool)
shouldAllowOperation(errorCount, maxErrors)
Circuit breaker pattern
Parameters:
errorCount (int)
maxErrors (int)
retryOperation(maxRetries)
Retry mechanism
Parameters:
maxRetries (int)
atrDistance(value1, value2, atr)
Calculate ATR-normalized distance between two values
Parameters:
value1 (float)
value2 (float)
atr (float)
atrDistance(value, reference, atrLength)
Calculate ATR-normalized distance between values
Parameters:
value (float)
reference (float)
atrLength (simple int)
percentDistance(value1, value2)
Calculate percentage-based distance between two values
Parameters:
value1 (float)
value2 (float)
withinATRTolerance(value, reference, atr, multiplier)
Check if value is within ATR-based tolerance of reference
Parameters:
value (float)
reference (float)
atr (float)
multiplier (float)
withinATRTolerance(value, reference, multiplier)
Check if value is within ATR-based tolerance of reference
Parameters:
value (float)
reference (float)
multiplier (float)
withinPercentTolerance(value, reference, percentTolerance)
Check if value is within percentage tolerance of reference
Parameters:
value (float)
reference (float)
percentTolerance (float)
proximityScore(value, reference, maxDistance)
Get proximity score (0-1, where 1 = very close)
Parameters:
value (float)
reference (float)
maxDistance (float)
sortArrayByValue(values, sortOrder)
Efficient array sorting using Pine Script native sort
Note: Replaces inefficient bubble sort implementations found in modules
Parameters:
values (array)
sortOrder (string)
safeArrayAverage(values)
Safe array average with null handling
Parameters:
values (array)
formatTableHeader(title, width)
Create formatted header for display tables
Parameters:
title (string)
width (int)
formatTableRow(key, value, width)
Format table row with key-value pair
Parameters:
key (string)
value (string)
width (int)
formatTableFooter(width)
Close table formatting
Parameters:
width (int)
truncateText(txt, maxLength, suffix)
Truncate text to specified length
Parameters:
txt (string)
maxLength (int)
suffix (string)
padText(txt, width, padChar, align)
Pad text to specified width
Parameters:
txt (string)
width (int)
padChar (string)
align (string)
titleCase(txt)
Convert text to title case
Parameters:
txt (string)
joinStrings(strings, separator)
Join array of strings with separator
Parameters:
strings (array)
separator (string)
formatTimestamp(timestamp, format)
Format timestamp to readable date/time
Parameters:
timestamp (int)
format (string)
evictLRU(cache)
Evict least recently used entry
Parameters:
cache (CacheManager)
newRiskAssessment()
Create a default risk assessment
calculateRiskAssessment(signal, volatility, volumeLevel)
Calculate comprehensive risk assessment
Parameters:
signal (SignalResult)
volatility (float)
volumeLevel (float)
newPositionData()
Create new empty position data
getConservativeStrategy()
Create conservative strategy template
getAggressiveStrategy()
Create aggressive strategy template
newDefaultStrategy()
Create default balanced strategy template
getStandardATR()
Get standard ATR(14) - cached per bar
getATR(length)
Get custom ATR with specified length
Parameters:
length (simple int)
getATRTolerance(multiplier)
Get ATR-based tolerance for distance calculations
Parameters:
multiplier (float)
getStandardVolumeAverage()
Get standard volume average SMA(20) - cached per bar
getVolumeAverage(length)
Get custom volume average
Parameters:
length (int)
getVolumeRatio()
Get volume ratio (current vs average)
getVolumeConfirmation(threshold)
Get volume confirmation (above threshold)
Parameters:
threshold (float)
getStandardEMAs()
Get standard EMAs (21, 50, 200) - cached per bar
getEMA21()
Get individual standard EMAs
getEMA50()
getEMA200()
getEMATrendAlignment()
Get EMA trend alignment score
getStandardRSI()
Get standard RSI(14) - cached per bar
getRSILevels(overbought, oversold)
Get RSI with overbought/oversold levels
Parameters:
overbought (float)
oversold (float)
getStandardMACD()
Get standard MACD (12, 26, 9) - cached per bar
getMACDSignal()
Get MACD trend signal
getMomentumScore()
Get comprehensive momentum score
getTrendStrength()
Get trend strength (0-100)
getIndicatorSummary()
Get indicator calculation summary (for debugging)
newZoneDetectionConfig()
Create default zone configuration
newZoneDetection(upperBoundary, lowerBoundary, creationBar, zoneType)
Create new zone
Parameters:
upperBoundary (float)
lowerBoundary (float)
creationBar (int)
zoneType (string)
calculateZoneOverlap(zone1Upper, zone1Lower, zone2Upper, zone2Lower)
Calculate zone overlap ratio
Parameters:
zone1Upper (float)
zone1Lower (float)
zone2Upper (float)
zone2Lower (float)
isPriceTouchingZone(zone, currentPrice, touchTolerance)
Check if price is touching zone
Parameters:
zone (ZoneDetection)
currentPrice (float)
touchTolerance (float)
getZonesInRange(zones, minPrice, maxPrice)
Get zones within price range
Parameters:
zones (array)
minPrice (float)
maxPrice (float)
getNearestZones(zones, currentPrice)
Get nearest support and resistance zones
Parameters:
zones (array)
currentPrice (float)
processZoneDetection(zones, config)
Complete zone detection and management system
Parameters:
zones (array)
config (ZoneDetectionConfig)
processZoneDetectionEngine(zones, config)
Parameters:
zones (array)
config (ZoneDetectionConfig)
newChannelConfig()
calcKeltnerChannel(config)
Parameters:
config (ChannelConfig)
checkKeltnerTouch(upper, lower)
Parameters:
upper (float)
lower (float)
getKeltnerDepth(basis, upper, lower)
Parameters:
basis (float)
upper (float)
lower (float)
checkKeltnerBreakout(upper, lower)
Parameters:
upper (float)
lower (float)
calcDonchianChannel(config)
Parameters:
config (ChannelConfig)
checkDonchianTouch(upper, lower)
Parameters:
upper (float)
lower (float)
checkDonchianReentry(upper, lower)
Parameters:
upper (float)
lower (float)
getDonchianWidth(upper, lower)
Parameters:
upper (float)
lower (float)
calcBollingerBands(config)
Parameters:
config (ChannelConfig)
calcSqueezeRatio(bbStdev, kcMultiplier, kcAtr)
Parameters:
bbStdev (float)
kcMultiplier (float)
kcAtr (float)
detectSqueezeState(squeezeRatio)
Parameters:
squeezeRatio (float)
detectSqueezeBreak(squeezeRatio, kcUpper, kcLower)
Parameters:
squeezeRatio (float)
kcUpper (float)
kcLower (float)
getSqueezeIntensity(squeezeRatio)
Parameters:
squeezeRatio (float)
processChannelDetection(config)
Parameters:
config (ChannelConfig)
detectChannelSignals(state)
Parameters:
state (ChannelState)
detectQualityZones(state)
Parameters:
state (ChannelState)
getChannelSignalText(state)
Parameters:
state (ChannelState)
analyzeChannelTrend(state)
Parameters:
state (ChannelState)
getChannelConfluence(state)
Parameters:
state (ChannelState)
newVwapConfig()
newVwapAnchors()
calcSessionVwap()
getPreviousSessionVwap(sessionVwap)
Parameters:
sessionVwap (float)
updateVwapAnchors(anchors, config)
Parameters:
anchors (VwapAnchors)
config (VwapConfig)
calcAnchoredVwap(anchors, isHigh)
Parameters:
anchors (VwapAnchors)
isHigh (bool)
detectPriceCrosses(sessionVwap)
Parameters:
sessionVwap (float)
detectStructureCrosses(sessionVwap, anchoredHigh, anchoredLow)
Parameters:
sessionVwap (float)
anchoredHigh (float)
anchoredLow (float)
detectVwapCluster(sessionVwap, anchoredHigh, anchoredLow, config)
Parameters:
sessionVwap (float)
anchoredHigh (float)
anchoredLow (float)
config (VwapConfig)
canShowSignal(anchors, config, signalType)
Parameters:
anchors (VwapAnchors)
config (VwapConfig)
signalType (string)
updateSignalThrottle(anchors, signalType)
Parameters:
anchors (VwapAnchors)
signalType (string)
calcCrossStrength(sessionVwap, isPriceCross)
Parameters:
sessionVwap (float)
isPriceCross (bool)
calcClusterStrength(vwapsInCluster, priceInCluster, tolerance)
Parameters:
vwapsInCluster (bool)
priceInCluster (bool)
tolerance (float)
calcStructureStrength(sessionVwap, anchoredHigh, anchoredLow)
Parameters:
sessionVwap (float)
anchoredHigh (float)
anchoredLow (float)
analyzeVwapTrend(sessionVwap)
Parameters:
sessionVwap (float)
processVwapDetection(anchors, config)
Parameters:
anchors (VwapAnchors)
config (VwapConfig)
generateVwapSignals(state)
Parameters:
state (VwapState)
getVwapBias(state)
Parameters:
state (VwapState)
getVwapConfluence(state)
Parameters:
state (VwapState)
newZoneConfig()
newZoneState()
stringToFloats(s)
Parameters:
s (string)
calculateBias(config)
Parameters:
config (ZoneConfig)
createZone(top, bottom, isBull, isHTF)
Parameters:
top (float)
bottom (float)
isBull (bool)
isHTF (bool)
updateZoneStatus(zone)
Parameters:
zone (Zone)
detectFVGOverlap(zone)
Parameters:
zone (Zone)
scoreZone(zone, config)
Parameters:
zone (Zone)
config (ZoneConfig)
sortAndTrimZones(zones, config)
Parameters:
zones (array)
config (ZoneConfig)
adjustZoneVisibility(zones, config)
Parameters:
zones (array)
config (ZoneConfig)
calculateTargetsATR(base, stepsString, atrLength)
Parameters:
base (float)
stepsString (string)
atrLength (simple int)
calculateTargetsSigma(base, stepsString, sigmaLength)
Parameters:
base (float)
stepsString (string)
sigmaLength (int)
calculateTargetsLiquidity(isLong, config)
Parameters:
isLong (bool)
config (ZoneConfig)
detectZoneSignals(zones, bias, config)
Parameters:
zones (array)
bias (int)
config (ZoneConfig)
processZoneManagement(state, config)
Parameters:
state (ZoneState)
config (ZoneConfig)
findNearestZones(state)
Parameters:
state (ZoneState)
newVolumeConfig()
newVolumeState()
getPriceSource(config)
Parameters:
config (VolumeConfig)
isInSession(config)
Parameters:
config (VolumeConfig)
isNewSession(config)
Parameters:
config (VolumeConfig)
calculateWindow(config)
Parameters:
config (VolumeConfig)
calculateProfile(config, windowStart, windowLength)
Parameters:
config (VolumeConfig)
windowStart (int)
windowLength (int)
detectVolumeNodes(binVolumes, binPrices, totalVolume)
Parameters:
binVolumes (array)
binPrices (array)
totalVolume (float)
calculateVolumeChoppiness(config)
Calculate choppiness index for volume profile
Parameters:
config (VolumeConfig)
detectMarketRegime(state, config)
Detect market regime based on multiple factors
Parameters:
state (VolumeState)
config (VolumeConfig)
calculateAdaptiveParameters(state, config)
Calculate adaptive volume profile parameters
Parameters:
state (VolumeState)
config (VolumeConfig)
updateMarketConditions(state, config)
Update volume state with market conditions
Parameters:
state (VolumeState)
config (VolumeConfig)
applyAdaptiveConfig(config, state)
Apply adaptive parameters to profile calculation
Parameters:
config (VolumeConfig)
state (VolumeState)
getHTFPivots(config)
Parameters:
config (VolumeConfig)
checkPivotConfluence(price, config, pivotHigh1, pivotLow1, pivotHigh2, pivotLow2)
Parameters:
price (float)
config (VolumeConfig)
pivotHigh1 (float)
pivotLow1 (float)
pivotHigh2 (float)
pivotLow2 (float)
calculateMOST()
Calculate MOST (Moving Stop) indicator
calculateTrendFilters(config)
Parameters:
config (VolumeConfig)
findNearestNodes(hvnNodes, lvnNodes)
Parameters:
hvnNodes (array)
lvnNodes (array)
detectVolumeSignals(config, profile, trendBullish, htfConfluence)
Parameters:
config (VolumeConfig)
profile (VolumeProfile)
trendBullish (bool)
htfConfluence (bool)
calculateVolumeScore(profile, trendBullish)
Parameters:
profile (VolumeProfile)
trendBullish (bool)
processVolumeProfile(state, config)
Parameters:
state (VolumeState)
config (VolumeConfig)
newHTFConfig()
newHTFStackState()
getOptimalTimeframes(chartTF)
Parameters:
chartTF (string)
calculateChoppiness(length)
Parameters:
length (int)
detectTrendEMA(length, threshold)
Parameters:
length (simple int)
threshold (float)
detectTrendSupertrend(atrLength, multiplier)
Parameters:
atrLength (simple int)
multiplier (float)
detectTrendMOST(length, multiplier)
Parameters:
length (simple int)
multiplier (float)
analyzeTrendForTF(tf, config)
Parameters:
tf (string)
config (HTFConfig)
calculateStackConfluence(tfData, config)
Parameters:
tfData (array)
config (HTFConfig)
calculateAutoTuningParams(choppiness, stackStrength, config)
Parameters:
choppiness (float)
stackStrength (float)
config (HTFConfig)
detectStackSignals(state, prevState, config)
Parameters:
state (HTFStackState)
prevState (HTFStackState)
config (HTFConfig)
createStackPanel(state, config)
Parameters:
state (HTFStackState)
config (HTFConfig)
processHTFStack(state, config)
Parameters:
state (HTFStackState)
config (HTFConfig)
processHTFStackSignals(state, prevState, config)
Parameters:
state (HTFStackState)
prevState (HTFStackState)
config (HTFConfig)
newRedefiningTechnicalAnalysisCore(analysisConfig, timeframeConfig, strategy)
Initialize RedefiningTechnicalAnalysis Core Library
Note: This function requires valid config objects to be passed in
The configuration module must be used directly to create default configs
Parameters:
analysisConfig (AnalysisConfig)
timeframeConfig (TimeframeConfig)
strategy (StrategyTemplate)
performAnalysis(core, prices, volumes, timestamps)
Perform complete multi-timeframe analysis
Parameters:
core (RedefiningTechnicalAnalysisCore)
prices (array)
volumes (array)
timestamps (array)
generateSignal(core, analysisResult)
Generate trading signal from analysis results
Parameters:
core (RedefiningTechnicalAnalysisCore)
analysisResult (MultiTimeframeResult)
assessRisk(core, signal)
Assess risk for trading decision
Parameters:
core (RedefiningTechnicalAnalysisCore)
signal (SignalResult)
executeFullWorkflow(core)
Execute complete analysis workflow
Parameters:
core (RedefiningTechnicalAnalysisCore)
updateAnalysisConfig(core, newConfig)
Update analysis configuration
Parameters:
core (RedefiningTechnicalAnalysisCore)
newConfig (AnalysisConfig)
updateStrategy(core, newStrategy)
Update strategy template
Parameters:
core (RedefiningTechnicalAnalysisCore)
newStrategy (StrategyTemplate)
checkSystemHealth(core)
Perform system health check
Parameters:
core (RedefiningTechnicalAnalysisCore)
generateStatusReport(core)
Generate comprehensive status report
Parameters:
core (RedefiningTechnicalAnalysisCore)
enableDebugMode(core, enabled)
Enable debug mode
Parameters:
core (RedefiningTechnicalAnalysisCore)
enabled (bool)
setFeatureFlag(core, flag, enabled)
Set feature flag
Parameters:
core (RedefiningTechnicalAnalysisCore)
flag (string)
enabled (bool)
getFeatureFlag(core, flag, defaultValue)
Get feature flag
Parameters:
core (RedefiningTechnicalAnalysisCore)
flag (string)
defaultValue (bool)
resetLibraryState(core)
Reset library state
Parameters:
core (RedefiningTechnicalAnalysisCore)
getLibraryInfo()
Get library version information
quickAnalysis(config, tfConfig, strategy)
Quick analysis - simplified entry point
Parameters:
config (AnalysisConfig)
tfConfig (TimeframeConfig)
strategy (StrategyTemplate)
getQuickStatus(core)
Get quick status string
Parameters:
core (RedefiningTechnicalAnalysisCore)
Result
Generic Result type for safe operations with error handling and fallbacks
Fields:
floatValue (series float)
stringValue (series string)
boolValue (series bool)
intValue (series int)
isSuccess (series bool)
errorCode (series string)
errorMessage (series string)
floatFallback (series float)
stringFallback (series string)
boolFallback (series bool)
intFallback (series int)
operationContext (series string)
timestamp (series int)
tags (array)
ValidationResult
Comprehensive validation result with errors, warnings, and corrections
Fields:
isValid (series bool)
errors (array)
warnings (array)
corrections (array)
suggestions (array)
validationScore (series float)
validationMode (series string)
validatedFields (series int)
totalFields (series int)
validationContext (series string)
validationTime (series int)
PerformanceProfile
Simplified performance profiling for Pine Script limitations
Fields:
executionTimeMs (series float)
averageExecutionMs (series float)
executionCount (series int)
errorCount (series int)
cacheHits (series int)
cacheMisses (series int)
cacheHitRatio (series float)
estimatedArrayElements (series int)
hasHeavyCalculation (series bool)
lastOptimizationHint (series string)
performanceGrade (series string)
performanceScore (series float)
functionName (series string)
profileStartTime (series int)
HealthStatus
Simplified health status for Pine Script limitations
Fields:
isHealthy (series bool)
healthScore (series float)
healthGrade (series string)
issues (array)
warnings (array)
recommendations (array)
dataValidationOK (series bool)
calculationsOK (series bool)
memoryUsageOK (series bool)
errorCountSession (series int)
warningCountSession (series int)
lastHealthCheck (series int)
healthCheckVersion (series string)
AnalysisConfig
Comprehensive analysis configuration with factor weights, thresholds, and extensible options
Fields:
activeFactors (array)
factorWeights (map)
thresholds (map)
features (map)
tradingMode (series string)
consensusMode (series string)
riskProfile (series string)
minConfidence (series float)
signalStrength (series float)
requireConsensus (series bool)
minConsensusCount (series int)
parameters (map)
options (map)
flags (map)
configName (series string)
version (series string)
description (series string)
createdTime (series int)
lastModified (series int)
validation (ValidationResult)
TimeframeConfig
Multi-timeframe configuration with weights and adjustments
Fields:
timeframes (array)
weights (array)
autoDetectChartTF (series bool)
includeHigherTFs (series bool)
tfAdjustments (map)
tfSensitivity (map)
tfFeatures (map)
minTimeframes (series int)
consensusThreshold (series float)
consensusMethod (series string)
normalizeWeights (series bool)
adaptiveBias (series bool)
higherTFBias (series float)
tfConfigName (series string)
configTimestamp (series int)
validation (ValidationResult)
GenericAnalysis
Generic analysis result that all specific analysis types extend
Fields:
totalScore (series float)
confidence (series float)
action (series string)
strength (series string)
riskLevel (series string)
factorScores (map)
factorWeights (map)
factorSignals (map)
factorReasons (map)
analysisType (series string)
timeframeAnalyzed (series string)
analysisTimestamp (series int)
marketCondition (series string)
dataQuality (series float)
performance (PerformanceProfile)
validation (ValidationResult)
numericData (map)
textData (map)
flags (map)
ConsensusData
Multi-timeframe consensus analysis data
Fields:
agreementCount (series int)
totalTimeframes (series int)
agreementPercentage (series float)
hasStrongConsensus (series bool)
hasMajorityConsensus (series bool)
agreeingTimeframes (array)
disagreeingTimeframes (array)
tfScores (map)
tfActions (map)
consensusMode (series string)
consensusScore (series float)
consensusAction (series string)
consensusStrength (series string)
tfWeights (map)
weightedConsensus (series bool)
weightedScore (series float)
consensusQuality (series float)
consensusReliability (series string)
consensusWarnings (array)
SignalResult
Comprehensive trading signal result
Fields:
strongBuy (series bool)
buy (series bool)
neutral (series bool)
sell (series bool)
strongSell (series bool)
overallScore (series float)
confidence (series float)
primaryAction (series string)
signalStrength (series string)
signalReason (series string)
contributingFactors (array)
factorContributions (map)
triggerCondition (series string)
consensus (ConsensusData)
consensusLevel (series string)
hasConsensus (series bool)
riskLevel (series string)
riskRewardRatio (series float)
successProbability (series float)
signalTimestamp (series int)
urgency (series string)
validityPeriod (series int)
marketPhase (series string)
warningFlags (array)
metadata (map)
MultiTimeframeResult
Multi-timeframe analysis result container
Fields:
primaryAnalysis (GenericAnalysis)
tfResults (map)
consensus (ConsensusData)
aggregatedScore (series float)
confidenceScore (series float)
dominantAction (series string)
consensusStrength (series string)
analyzedTimeframes (array)
failedTimeframes (array)
failureReasons (map)
performance (PerformanceProfile)
validation (ValidationResult)
dataQualityScore (series float)
config (AnalysisConfig)
tfConfig (TimeframeConfig)
analysisTimestamp (series int)
DebugLogEntry
Debug log entry
Fields:
timestamp (series int)
level (series string)
module (series string)
function (series string)
message (series string)
context (series string)
data (map)
barIndex (series int)
timeframe (series string)
DebugLogger
Debug logger with configurable levels
Fields:
entries (array)
maxEntries (series int)
currentLevel (series string)
enabled (series bool)
enabledModules (array)
showTimestamp (series bool)
showBarIndex (series bool)
outputFormat (series string)
PerformanceMeasurement
Performance measurement
Fields:
name (series string)
startTime (series int)
endTime (series int)
duration (series float)
iterations (series int)
avgDuration (series float)
status (series string)
context (series string)
TraceEntry
Execution trace entry
Fields:
function (series string)
module (series string)
entryTime (series int)
exitTime (series int)
isEntry (series bool)
parameters (series string)
returnValue (series string)
depth (series int)
ExecutionTracer
Execution tracer
Fields:
traces (array)
currentDepth (series int)
maxDepth (series int)
enabled (series bool)
maxTraces (series int)
CacheEntry
Cache entry
Fields:
key (series string)
data (series string)
timestamp (series int)
ttl (series int)
accessCount (series int)
lastAccess (series int)
CacheManager
Cache manager
Fields:
name (series string)
entries (map)
maxEntries (series int)
defaultTTL (series int)
enabled (series bool)
hits (series int)
misses (series int)
evictions (series int)
RiskAssessment
Core risk assessment result
Fields:
riskLevel (series string)
riskScore (series float)
riskRewardRatio (series float)
successProbability (series float)
maxDrawdownExpected (series float)
positionRisk (series float)
portfolioExposure (series float)
correlationRisk (series float)
concentrationRisk (series float)
volatilityRisk (series float)
liquidityRisk (series float)
timeframeRisk (series float)
newsEventRisk (series float)
supportResistanceRisk (series float)
trendRisk (series float)
momentumRisk (series float)
volumeRisk (series float)
hasHighRisk (series bool)
hasExtremeRisk (series bool)
riskWarnings (array)
riskFactors (array)
recommendedPositionSize (series float)
stopLossDistance (series float)
takeProfitDistance (series float)
shouldAvoidTrade (series bool)
riskMitigationStrategy (series string)
assessmentTimestamp (series int)
assessmentMethod (series string)
performance (PerformanceProfile)
PositionData
Comprehensive position data
Fields:
hasPosition (series bool)
positionSide (series string)
positionSize (series float)
entryPrice (series float)
entryTimestamp (series int)
entryReason (series string)
unrealizedPnL (series float)
realizedPnL (series float)
maxUnrealizedGain (series float)
maxUnrealizedLoss (series float)
totalReturn (series float)
stopLossPrice (series float)
takeProfitPrice (series float)
riskAmount (series float)
riskRewardRatio (series float)
currentRisk (RiskAssessment)
barsInPosition (series int)
maxBarsAllowed (series int)
isTimedOut (series bool)
timeframe (series string)
hasExitSignal (series bool)
exitReason (series string)
exitScore (series float)
shouldExit (series bool)
exitUrgency (series string)
actionHistory (array)
timestampHistory (array)
reasonHistory (array)
sharpeRatio (series float)
maxDrawdown (series float)
winRate (series float)
avgHoldTime (series float)
StrategyTemplate
Base strategy template
Fields:
name (series string)
description (series string)
category (series string)
timeframes (array)
entryThreshold (series float)
entryConfidenceMin (series float)
requiredSignals (array)
excludeConditions (array)
exitThreshold (series float)
stopLossPercent (series float)
takeProfitPercent (series float)
maxBarsInTrade (series int)
maxPositionSize (series float)
basePositionSize (series float)
useVolatilityAdjustment (series bool)
useConfidenceAdjustment (series bool)
maxRiskPerTrade (series float)
maxDailyRisk (series float)
maxDrawdownLimit (series float)
useAdaptiveRisk (series bool)
requireConsensus (series bool)
minConsensusPercent (series float)
avoidNewsEvents (series bool)
requireVolume (series bool)
targetSharpeRatio (series float)
targetWinRate (series float)
targetRiskReward (series float)
parameters (map)
flags (map)
settings (map)
MetricDataPoint
Performance metric data point
Fields:
timestamp (series int)
value (series float)
name (series string)
unit (series string)
labels (map)
source (series string)
MetricStats
Metric statistics
Fields:
min (series float)
max (series float)
avg (series float)
sum (series float)
count (series int)
p50 (series float)
p95 (series float)
p99 (series float)
stdDev (series float)
firstTimestamp (series int)
lastTimestamp (series int)
MetricDataPointArray
Wrapper for array of metric data points (to avoid nested collections)
Fields:
dataPoints (array)
MetricsCollector
Metrics collector
Fields:
metrics (map)
stats (map)
maxDataPoints (series int)
retentionPeriod (series int)
autoCleanup (series bool)
enabled (series bool)
enabledMetrics (array)
lastCleanupTime (series int)
ComponentHealth
Component health status
Fields:
name (series string)
status (series string)
healthScore (series float)
lastCheckTime (series int)
warnings (array)
errors (array)
metrics (map)
lastError (series string)
errorCount (series int)
warningCount (series int)
isOperational (series bool)
SystemHealth
System health overview
Fields:
overallStatus (series string)
overallScore (series float)
healthyComponents (series int)
degradedComponents (series int)
unhealthyComponents (series int)
components (array)
systemWarnings (array)
systemErrors (array)
lastFullCheckTime (series int)
autoHealing (series bool)
healingAttempts (series int)
HealthAlert
Health alert
Fields:
level (series string)
component (series string)
message (series string)
timestamp (series int)
acknowledged (series bool)
category (series string)
ZoneDetection
Advanced zone data structure
Fields:
upper (series float)
lower (series float)
mid (series float)
height (series float)
score (series float)
quality (series string)
touchCount (series int)
lastTouchBar (series int)
creationBar (series int)
role (series int)
zoneType (series string)
isActive (series bool)
isBroken (series bool)
flipBar (series int)
flipRetestCount (series int)
flipBestQuality (series float)
flipScore (series float)
hasFlipped (series bool)
htfOverlap (series bool)
htfTimeframe (series string)
htfConfidence (series float)
retestQuality (series float)
volumeProfile (series float)
volatilityProfile (series float)
freshnessScore (series float)
successfulBounces (series int)
failedBreakouts (series int)
successRate (series float)
avgHoldTime (series float)
zoneBox (series box)
midLine (series line)
zoneLabel (series label)
flipLabel (series label)
ZoneDetectionConfig
Zone analysis configuration
Fields:
pivotPeriod (series int)
atrMultiplier (series float)
atrLength (series int)
maxZones (series int)
mergeThreshold (series float)
minTouchesForSignificance (series int)
weightTouches (series float)
weightFreshness (series float)
weightVolume (series float)
weightHTF (series float)
minWickPercent (series float)
maxBodyPercent (series float)
freshnessHalfLife (series int)
useHTFProjection (series bool)
htfTimeframe (series string)
htfPivotCount (series int)
htfProjectionMultiplier (series float)
ChannelConfig
Fields:
kcEmaLength (series int)
kcAtrLength (series int)
kcMultiplier (series float)
dcLength (series int)
bbLength (series int)
bbMultiplier (series float)
pivotLength (series int)
atrThreshold (series float)
minBarsPerLeg (series int)
minTouchCount (series int)
mergeThreshold (series float)
ChannelState
Fields:
kcUpper (series float)
kcLower (series float)
kcBasis (series float)
kcAtr (series float)
dcUpper (series float)
dcLower (series float)
dcMid (series float)
bbUpper (series float)
bbLower (series float)
bbBasis (series float)
bbStdev (series float)
squeezeRatio (series float)
isSqueezeActive (series bool)
isExpanding (series bool)
touchKcUpper (series bool)
touchKcLower (series bool)
touchDcUpper (series bool)
touchDcLower (series bool)
kcBreakoutUp (series bool)
kcBreakoutDown (series bool)
dcReentryUp (series bool)
dcReentryDown (series bool)
squeezeBreakUp (series bool)
squeezeBreakDown (series bool)
kcDepth (series float)
dcWidth (series float)
squeezeIntensity (series float)
ChannelSignal
Fields:
signalType (series string)
direction (series int)
strength (series float)
description (series string)
isQualitySignal (series bool)
VwapConfig
Fields:
pivotLeftBars (series int)
pivotRightBars (series int)
clusterTolerancePercent (series float)
minBarsBetweenSignals (series int)
crossThreshold (series float)
enableThrottling (series bool)
detectClusters (series bool)
VwapState
Fields:
sessionVwap (series float)
sessionVwapPrev (series float)
anchoredVwapHigh (series float)
anchoredVwapLow (series float)
hasAnchoredHigh (series bool)
hasAnchoredLow (series bool)
priceCrossUp (series bool)
priceCrossDown (series bool)
canShowPriceCross (series bool)
structureCrossUp (series bool)
structureCrossDown (series bool)
canShowStructureCross (series bool)
isClusterActive (series bool)
canShowCluster (series bool)
clusterTolerance (series float)
vwapsInCluster (series bool)
priceInCluster (series bool)
priceVwapPosition (series int)
priceVwapDistance (series float)
priceVwapDistancePercent (series float)
crossStrength (series float)
clusterStrength (series float)
structureStrength (series float)
VwapSignal
Fields:
signalType (series string)
direction (series int)
strength (series float)
description (series string)
isHighConfidence (series bool)
barIndex (series int)
VwapAnchors
Fields:
cumulativePV (series float)
cumulativeV (series float)
anchorPV_High (series float)
anchorV_High (series float)
hasHighAnchor (series bool)
anchorPV_Low (series float)
anchorV_Low (series float)
hasLowAnchor (series bool)
lastPriceCrossBar (series int)
lastStructureCrossBar (series int)
lastClusterBar (series int)
ZoneConfig
Fields:
htfTimeframe (series string)
useHTF (series bool)
maxZonesPerSide (series int)
rankFavorHTF (series bool)
rankFavorFVG (series bool)
rankFavorFresh (series bool)
showOnlyTopRank (series bool)
alphaTop (series int)
alphaRest (series int)
biasLength (series int)
biasBandMultiplier (series float)
targetMode (series string)
atrLength (series int)
atrSteps (series string)
sigmaLength (series int)
sigmaSteps (series string)
useSSL (series bool)
useFVGFills (series bool)
confirmMidline (series bool)
confirmBreak (series bool)
requireBias (series bool)
lazyTargets (series bool)
nearPercent (series float)
Zone
Fields:
top (series float)
bottom (series float)
mid (series float)
bornTime (series int)
isBull (series bool)
isHTF (series bool)
touched (series bool)
violated (series bool)
hasFVG (series bool)
score (series float)
rank (series int)
zoneBox (series box)
midLine (series line)
isActive (series bool)
ZoneState
Fields:
zonesTF (array)
zonesHTF (array)
bias (series int)
biasScore (series float)
biasRegime (series string)
vwapLevel (series float)
bandUpper (series float)
bandLower (series float)
targetLevels (array)
targetLines (array)
activeBullZones (series int)
activeBearZones (series int)
totalZones (series int)
avgZoneScore (series float)
longSignal (series bool)
shortSignal (series bool)
nearestBullZone (Zone)
nearestBearZone (Zone)
ZoneSignal
Fields:
signalType (series string)
sourceZone (Zone)
strength (series float)
description (series string)
confirmed (series bool)
barIndex (series int)
VolumeConfig
Fields:
profileMode (series string)
fixedLength (series int)
rollingLength (series int)
sessionString (series string)
binCount (series int)
valueAreaPercent (series float)
useHLC3 (series bool)
useHTF1 (series bool)
htfTimeframe1 (series string)
useHTF2 (series bool)
htfTimeframe2 (series string)
pivotLookback (series int)
pivotToleranceATR (series float)
enableAutoTuning (series bool)
vaPct_eff (series float)
epsATR_eff (series float)
adaptiveAlpha (series float)
choppinessLength (series int)
choppyThreshold (series float)
trendingThreshold (series float)
useMarketRegime (series bool)
enableLVNSignals (series bool)
enableVASignals (series bool)
maxRetestDistanceATR (series float)
useEMAFilter (series bool)
useSupertrendFilter (series bool)
useMOSTFilter (series bool)
showPOC (series bool)
showValueArea (series bool)
showNodes (series bool)
showSilhouette (series bool)
silhouetteOffset (series int)
silhouetteWidth (series int)
zoneOpacity (series int)
enableSessionSplits (series bool)
maxSessionCount (series int)
VolumeNode
Fields:
price (series float)
volume (series float)
nodeType (series string)
prominence (series float)
isSignificant (series bool)
VolumeProfile
Fields:
pocPrice (series float)
pocVolume (series float)
valueAreaHigh (series float)
valueAreaLow (series float)
totalVolume (series float)
windowStart (series int)
windowLength (series int)
windowHigh (series float)
windowLow (series float)
binVolumes (array)
binPrices (array)
hvnNodes (array)
lvnNodes (array)
nearestLVN (series float)
nearestHVN (series float)
htfConfluence (series bool)
pocLine (series line)
valueAreaBox (series box)
nodeBoxes (array)
silhouette (series polyline)
VolumeState
Fields:
currentProfile (VolumeProfile)
sessionProfiles (array)
trendBullish (series bool)
emaConfluence (series float)
supertrendBull (series bool)
mostBull (series bool)
choppiness (series float)
isChoppy (series bool)
isTrending (series bool)
marketRegime (series string)
vaPct_current (series float)
epsATR_current (series float)
smoothingFactor (series float)
longLVNSignal (series bool)
shortLVNSignal (series bool)
longVASignal (series bool)
shortVASignal (series bool)
volumeScore (series float)
passFilter (series bool)
inValueArea (series bool)
abovePOC (series bool)
pocRising (series bool)
nearLVN (series bool)
VolumeSignal
Fields:
signalType (series string)
direction (series int)
strength (series float)
description (series string)
triggerPrice (series float)
hasConfluence (series bool)
barIndex (series int)
HTFConfig
Fields:
timeframes (array)
tfWeights (array)
autoSelectTFs (series bool)
maxTimeframes (series int)
trendLength (series int)
trendThreshold (series float)
trendMethod (series string)
stackThreshold (series float)
requireAllTFs (series bool)
confluenceBonus (series float)
enableAutoTuning (series bool)
choppinessLength (series int)
choppyThreshold (series float)
trendingThreshold (series float)
showStackPanel (series bool)
panelPosition (series string)
panelRows (series int)
panelCols (series int)
showTooltips (series bool)
HTFTrendData
Fields:
timeframe (series string)
trendStrength (series float)
trendDirection (series string)
confidence (series float)
isValid (series bool)
weight (series float)
trendColor (series color)
HTFStackState
Fields:
tfData (array)
bullConfluence (series float)
bearConfluence (series float)
stackStrength (series float)
stackBias (series string)
choppiness (series float)
isChoppy (series bool)
isTrending (series bool)
marketRegime (series string)
vaPct_eff (series float)
epsATR_eff (series float)
adaptiveAlpha (series float)
bullStackSignal (series bool)
bearStackSignal (series bool)
stackBreakSignal (series bool)
stackTable (series table)
tfLabels (array)
strengthBars (array)
RedefiningTechnicalAnalysisCore
Main library state container
Fields:
analysisConfig (AnalysisConfig)
timeframeConfig (TimeframeConfig)
activeStrategy (StrategyTemplate)
lastAnalysis (MultiTimeframeResult)
lastSignal (SignalResult)
lastRisk (RiskAssessment)
currentPosition (PositionData)
isInitialized (series bool)
lastUpdateTime (series int)
currentTimeframe (series string)
globalPerformance (PerformanceProfile)
systemHealth (SystemHealth)
metricsCollector (MetricsCollector)
analysisCache (CacheManager)
calculationCache (CacheManager)
recentErrors (array)
recentWarnings (array)
errorCount (series int)
warningCount (series int)
debugLogger (DebugLogger)
debugMode (series bool)
extensionData (map)
featureFlags (map)
Tweezer & Kangaroo Zones [WavesUnchained]Tweezer & Kangaroo Zones
Pattern Recognition with Supply/Demand Zones
Indicator that detects tweezer and kangaroo tail (pin bar) reversal patterns and creates supply and demand zones. Includes volume validation, trend context, and confluence scoring.
What You See on Your Chart
Pattern Labels:
"T" (Red) - Tweezer Top detected above price → Bearish reversal signal
"T" (Green) - Tweezer Bottom detected below price → Bullish reversal signal
"K" (Red) - Kangaroo Bear (Pin Bar rejection from top) → Bearish signal
"K" (Green) - Kangaroo Bull (Pin Bar rejection from bottom) → Bullish signal
Label Colors Indicate Pattern Strength:
Dark Green/Red - Strong pattern (score ≥8.0)
Medium Green/Red - Good pattern (score ≥6.0)
Light Green/Red - Valid pattern (score <6.0)
Zone Boxes:
Red Boxes - Supply Zones (resistance, potential short areas)
Green Boxes - Demand Zones (support, potential long areas)
White Border - Active zone (fresh, not tested yet)
Gray Border - Inactive zone (expired or invalidated)
Pattern Detection
Tweezer Patterns (Classic Double-Top/Bottom):
Flexible Lookback - Detects patterns up to 3 bars apart (not just consecutive)
Precision Matching - 0.2% level tolerance for high-quality signals
Wick Similarity Check - Both candles must show similar rejection wicks
Volume Validation - Second candle requires elevated volume (0.8x average)
Pattern Strength Score - 0-1 quality rating based on level match + wick similarity
Optional Trend Context - Can require trend alignment (default: OFF for more signals)
Kangaroo Tail / Pin Bar Patterns:
No Pivot Delay - Instant detection without waiting for pivot confirmation
Body Position Check - Body must be at candle extremes (30% tolerance)
Volume Spike - Rejection must occur with volume (0.9x average)
Rejection Strength - Scores based on wick length (0.5-0.9 of range)
Optional Trend Context - Bearish in uptrends, Bullish in downtrends (default: OFF)
Zone Management
Auto-Created Zones - Every valid pattern creates a supply/demand zone
Overlap Prevention - Zones too close together (50% overlap) are not duplicated
Lifetime Control - Zones expire after 400 bars (configurable)
Smart Invalidation - Zones invalidate when price closes through them
Styling Options - Choose between Solid, Dashed, or Dotted borders
Border Width - 2px width for better visibility
Confluence Scoring System
Multi-factor confluence scoring (0-10 scale) with configurable weights:
Regime (EMA+HTF) - Trend alignment across timeframes (Weight: 2.0)
HTF Stack - Multi-timeframe trend confluence (Weight: 3.0)
Structure - Higher lows / Lower highs confirmation (Weight: 1.0)
Relative Volume - Volume surge validation (Weight: 1.0)
Chop Advantage - Favorable market conditions (Weight: 1.0)
Zone Thinness - Tight zones = better R/R (Weight: 1.0)
Supertrend - Trend indicator alignment (Weight: 1.0)
MOST - Moving Stop alignment (Weight: 1.0)
Pattern Strength - Quality of detected pattern (Weight: 1.5)
Zone Retest Signals
Signals generated when zones are retested:
BUY Signal - Price retests demand zone from above (score ≥4.5)
SELL Signal - Price retests supply zone from below (score ≥5.5)
Normalized Score - Displayed as 0-10 for easy interpretation
Optional Trend Gate - Require trend alignment for signals (default: OFF)
Alert Ready - Built-in alertconditions for automation
Additional Features
Auto-Threshold Tuning - Adapts to ATR and Choppiness automatically
Session Profiles - Different settings for RTH vs ETH sessions
Organized Settings - 15+ input groups for easy configuration
Optional Panels - HTF Stack overview and performance metrics (default: OFF)
Data Exports - Hidden plots for strategy/library integration
RTA Health Monitoring - Built-in performance tracking
Setup & Configuration
Quick Start:
1. Apply indicator to any timeframe
2. Patterns and zones appear automatically
3. Adjust pattern detection sensitivity if needed
4. Configure zone styling (Solid/Dashed/Dotted)
5. Set up alerts for zone retests
Key Settings to Adjust:
Pattern Detection:
• Min RelVolume: Lower = more signals (0.8 Tweezer, 0.9 Kangaroo)
• Require trend context: Enable for stricter, higher-quality patterns
• Check wick similarity: Ensures proper rejection structure
Zone Management:
• Zone lifetime: How long zones remain active (default: 400 bars)
• Invalidate on close-through: Remove zones when price breaks through
• Max overlap: Prevent duplicate zones (default: 50%)
Scoring:
• Min Score BUY/SELL: Higher = fewer but better signals (default: 4.5/5.5)
• Component weights: Customize what factors matter most
• Signals require trend gate: OFF = more signals, ON = higher quality
Visual Customization
Zone Colors - Light red/green with 85% transparency (non-intrusive)
Border Styles - Solid, Dashed, or Dotted
Label Intensity - Darker greens for better readability
Clean Charts - All panels OFF by default
Understanding the Zones
Supply Zones (Red):
Created from bearish patterns (Tweezer Tops, Kangaroo Bears). Price made a high attempt to push higher, but was rejected. These become resistance areas where sellers may step in again.
Demand Zones (Green):
Created from bullish patterns (Tweezer Bottoms, Kangaroo Bulls). Price made a low with strong rejection. These become support areas where buyers may step in again.
Zone Quality Indicators:
• White border = Fresh zone, not tested yet
• Gray border = Zone expired or invalidated
• Thin zones (tight range) = Better risk/reward ratio
• Thick zones = Less precise, wider stop required
Trading Applications
Reversal Trading - Enter at pattern detection with tight stops
Zone Retest Trading - Wait for retests of established zones
Trend Confluence - Trade only when patterns align with trend
Risk Management - Use zone boundaries for stop placement
Target Setting - Opposite zones become profit targets
Pro Tips
Best signals occur when pattern + zone retest + trend all align
Lower timeframes = more signals but more noise
Higher timeframes = fewer but more reliable signals
Start with default settings, adjust based on your market
Combine with other analysis (structure, key levels, etc.)
Use alerts to avoid staring at charts all day
Important Notes
Not all patterns will lead to successful trades
Use proper risk management and position sizing
Patterns work best in trending or range-bound markets
Very choppy conditions may produce lower-quality signals
Always confirm with your own analysis before trading
Technical Specifications
• Pine Script v6
• RTA-Core integration
• RTA Core Library integration
• Maximum 200 boxes, 500 labels
• Auto-tuning based on ATR and Choppiness
• Session-aware threshold adjustments
• Memory-optimized zone management
What's Included
Tweezer Top/Bottom detection
Kangaroo Tail / Pin Bar detection
Automatic supply/demand zone creation
Volume validation system
Pattern strength scoring
Zone retest signals
Multi-factor confluence scoring
Optional HTF Stack panel
Optional performance metrics
Session profile support
Auto-threshold tuning
Alert conditions
Data exports for strategies
Author Waves Unchained
Version 1.0
Status Public Indicator
Summary
Reversal pattern detection with zone management, volume validation, and confluence scoring for tweezer and kangaroo tail patterns.
---
Disclaimer: This indicator is for educational and informational purposes only. Trading involves risk. Past performance does not guarantee future results. Always practice proper risk management.
Order Flow RSI — Price / CVD / OIOrder Flow RSI blends three powerful market perspectives — Price , Cumulative Volume Delta (CVD) , and Open Interest (OI) — into one unified RSI-style oscillator.
It reveals momentum and imbalance across these data streams and highlights situations where participation, liquidity, and positioning disagree — moments that often precede reversals.
What it does
The indicator converts:
Price → RSI (classic momentum),
CVD → RSI (buy/sell pressure balance),
OI → RSI (position expansion/contraction)
…then plots all three RSIs together on the same 0–100 scale.
A fourth Consensus RSI (average of any two or all three) can optionally be shown to simplify the view.
Core logic
CVD engine – based on TradingView’s native volume-delta request.
Modes: Continuous (default, smooth line), Anchored (resets each session), Rolling window.
Open Interest – pulled automatically from the symbol’s “_OI” feed; aligns to chart timeframe for real-time flow.
RSI calculation – standard RSI applied to each data stream, optionally smoothed (SMA / EMA / RMA / WMA / VWMA).
Signals – optional background highlights when:
All three RSIs are overbought (red) or oversold (green), or
Any pair show opposite extremes (e.g., price overbought + OI oversold).
Consensus RSI – arithmetic mean of the selected RSIs, summarizing overall market tone.
Inputs overview
CVD settings: anchor period, lower-TF delta, mode, rolling length
RSI lengths: separate for price, CVD, OI
Smoothing: type + period applied to all RSIs at once
Consensus: choose which RSIs to average
Signals: enable/disable each combination; optional alerts
Levels: adjustable OB/MID/OS (default 70 / 50 / 30)
Visuals: fill between active RSIs, background highlights, level lines, colors in Style tab
How to read it
All 3 overbought (red): broad exhaustion → possible correction
All 3 oversold (green): broad depletion → possible bounce
Opposite pairs: divergence between price and participation
Price↑ but OI↓ (red) → weak rally, fading participation
Price↓ but CVD↑ (green) → hidden accumulation
Combine with structure and volume profile for confirmation.
Notes
Works best on assets with full CVD + OI data (futures, BTC, etc.).
Use Continuous CVD for smooth RSI, Anchored for session analysis.
Smoothing 2–5 EMA is a good starting point to reduce noise.
All styling (colors, line types, thickness) is adjustable in the Style tab.
Limitations & caveats
CVD requires accurate tick/volume/delta data from your data feed. Performance may differ across instruments.
OI availability varies by exchange / symbol. Where OI is absent, pairwise OI signals are not evaluated.
This indicator is a tool — it generates signals of interest, not guaranteed profitable trades. Backtest and combine with your risk rules.
Smoothing introduces lag; longer smoothing reduces noise but delays signals.
Order Flow RSI bridges traditional momentum analysis and order-flow context — giving a multi-dimensional view of when markets are truly stretched or quietly reloading.
Sometimes it works, sometimes it doesn't.
AMDX/XAMD indicatorThe AMDX/XAMD indicator is designed to highlight specific trading sessions on the chart using distinct colors and optional vertical lines. Users can choose between two session types, AMDX or XAMD, and customize the visual appearance of the sessions. This tool is particularly useful for traders who want to analyze market behavior during different trading periods.
Meaning of AMDX:
A: Accumulation
M: Manipulation
D: Distribution
X: Continuation Or Reversal
Features:
Session Highlighting:
AMDX Sessions: Split into four segments - A, M, D, X.
XAMD Sessions: Split into four segments - X, A, M, D.
Customizable Colors:
Choose individual colors for each session (A, M, D, X).
Adjust the transparency of the session boxes for better visual integration with the chart.
Drawing Styles:
Box Style: Draws colored boxes around the session ranges.
Line Style: Draws vertical lines at session start and end times.
Vertical Lines:
Option to enable or disable vertical lines at session boundaries.
Customizable line style: Solid, Dotted, or Dashed.
Session Labels:
Automatically labels each session for easy identification.
Customization Options:
Session Type: Select between AMDX and XAMD session types.
Colors: Set custom colors for each session and vertical lines.
Border Width: Adjust the width of the session box borders.
Transparency: Control the transparency level of the session boxes.
Drawing Style: Choose between Box and Line styles for session representation.
Vertical Lines: Enable or disable vertical lines and select the line style.
How It Works:
The indicator calculates the start and end times for each session based on the selected session type (AMDX or XAMD). It then draws either boxes or lines to highlight these sessions on the chart. The indicator also includes options to draw vertical lines at the session boundaries and labels each session with a corresponding letter (A, M, D, X).
Use Cases:
Market Session Analysis: Easily identify and analyze market behavior during different trading sessions.
Intraday Trading: Helps intraday traders to focus on specific time segments of the trading day.
Visual Segmentation: Provides a clear visual segmentation of the trading day, aiding in better decision-making.
Times for AMDX/XAMD session:
A Session: 18:00 (previous day) to 03:00 (current day)
M Session: 03:00 to 09:00
D Session: 09:00 to 12:00
X Session: 12:00 to 18:00
Time for the XAMD session :
X Session: 18:00 (previous day) to 00:00 (current day)
A Session: 00:00 to 09:00
M Session: 09:00 to 12:00
D Session: 12:00 to 18:00
Time Zone PSenseiTitle: Time Zone PS Indicator
Author: Orlando Depablos
Description:
The Time Zone PS Indicator is a tool designed to help traders visualize different trading sessions on their charts. It allows users to specify three different trading sessions: the start of the day, the London session, and the New York (NYC) session. Each session is represented by a distinct color-coded background on the chart.
Features:
Customizable Sessions: Traders can define the start time and end time for each trading session according to their preference. This flexibility enables users to tailor the indicator to their specific trading strategies session time zones.
Session Display Control: Users have the option to choose whether they want to display each trading session on the chart. This feature allows for a clutter-free charting experience, where traders can focus on the sessions relevant to their analysis.
Visual Clarity: The indicator uses distinct colors for each trading session, making it easy for traders to differentiate between different time zones. This visual clarity aids in quickly identifying key trading periods throughout the day.
How to Use:
Setting Up Sessions: Use the input options to define the start and end times for the start of the day, the London session, and the NYC session. Adjust these values based on your trading preferences and time zone.
Display Preferences: Toggle the display options to choose which trading sessions you want to visualize on the chart. This allows for a customizable charting experience tailored to your specific needs.
Interpreting the Chart: Once configured, the indicator will display color-coded backgrounds on the chart corresponding to the defined trading sessions. Interpret these visual cues to identify key trading periods and plan your trading strategies accordingly.
Originality:
The Time Zone PS Indicator adds value to the TradingView community by providing traders with a customizable tool to visualize different trading sessions. While similar indicators exist, this script offers flexibility and ease of use, enhancing the charting experience for traders across various time zones.
Use Cases:
Session-Based Analysis: Traders can use the indicator to analyze price action within specific trading sessions, such as the London or NYC session, to identify potential trading opportunities.
Time Zone Adjustment: Traders operating in different time zones can adjust the indicator settings to align with their local trading hours, ensuring accurate visualization of relevant trading sessions.
Strategy Development: The indicator can aid in the development of trading strategies that capitalize on price movements during specific trading sessions, helping traders optimize their trading performance.
Chart Visualization:
The indicator provides a clear and concise visualization of different trading sessions on the chart. Each session is represented by a color-coded background, allowing traders to quickly identify key trading periods and make informed trading decisions.
Volume Profile [Makit0]VOLUME PROFILE INDICATOR v0.5 beta
Volume Profile is suitable for day and swing trading on stock and futures markets, is a volume based indicator that gives you 6 key values for each session: POC, VAH, VAL, profile HIGH, LOW and MID levels. This project was born on the idea of plotting the RTH sessions Value Areas for /ES in an automated way, but you can select between 3 different sessions: RTH, GLOBEX and FULL sessions.
Some basic concepts:
- Volume Profile calculates the total volume for the session at each price level and give us market generated information about what price and range of prices are the most traded (where the value is)
- Value Area (VA): range of prices where 70% of the session volume is traded
- Value Area High (VAH): highest price within VA
- Value Area Low (VAL): lowest price within VA
- Point of Control (POC): the most traded price of the session (with the most volume)
- Session HIGH, LOW and MID levels are also important
There are a huge amount of things to know of Market Profile and Auction Theory like types of days, types of openings, relationships between value areas and openings... for those interested Jim Dalton's work is the way to come
I'm in my 2nd trading year and my goal for this year is learning to daytrade the futures markets thru the lens of Market Profile
For info on Volume Profile: TV Volume Profile wiki page at www.tradingview.com
For info on Market Profile and Market Auction Theory: Jim Dalton's book Mind over markets (this is a MUST)
BE AWARE: this indicator is based on the current chart's time interval and it only plots on 1, 2, 3, 5, 10, 15 and 30 minutes charts.
This is the correlation table TV uses in the Volume Profile Session Volume indicator (from the wiki above)
Chart Indicator
1 - 5 1
6 - 15 5
16 - 30 10
31 - 60 15
61 - 120 30
121 - 1D 60
This indicator doesn't follow that correlation, it doesn't get the volume data from a lower timeframe, it gets the data from the current chart resolution.
FEATURES
- 6 key values for each session: POC (solid yellow), VAH (solid red), VAL (solid green), profile HIGH (dashed silver), LOW (dashed silver) and MID (dotted silver) levels
- 3 sessions to choose for: RTH, GLOBEX and FULL
- select the numbers of sessions to plot by adding 12 hours periods back in time
- show/hide POC
- show/hide VAH & VAL
- show/hide session HIGH, LOW & MID levels
- highlight the periods of time out of the session (silver)
- extend the plotted lines all the way to the right, be careful this can turn the chart unreadable if there are a lot of sessions and lines plotted
SETTINGS
- Session: select between RTH (8:30 to 15:15 CT), GLOBEX (17:00 to 8:30 CT) and FULL (17:00 to 15:15 CT) sessions. RTH by default
- Last 12 hour periods to show: select the deph of the study by adding periods, for example, 60 periods are 30 natural days and around 22 trading days. 1 period by default
- Show POC (Point of Control): show/hide POC line. true by default
- Show VA (Value Area High & Low): show/hide VAH & VAL lines. true by default
- Show Range (Session High, Low & Mid): show/hide session HIGH, LOW & MID lines. true by default
- Highlight out of session: show/hide a silver shadow over the non session periods. true by default
- Extension: Extend all the plotted lines to the right. false by default
HOW TO SETUP
BE AWARE THIS INDICATOR PLOTS ONLY IN THE FOLLOWING CHART RESOLUTIONS: 1, 2, 3, 5, 10, 15 AND 30 MINUTES CHARTS. YOU MUST SELECT ONE OF THIS RESOLUTIONS TO THE INDICATOR BE ABLE TO PLOT
- By default this indicator plots all the levels for the last RTH session within the last 12 hours, if there is no plot try to adjust the 12 hours periods until the seesion and the periods match
- For Globex/Full sessions just select what you want from the dropdown menu and adjust the periods to plot the values
- Show or hide the levels you want with the 3 groups: POC line, VA lines and Session Range lines
- The highlight and extension options are for a better visibility of the levels as POC or VAH/VAL
THANKS TO
@watsonexchange for all the help, ideas and insights on this and the last two indicators (Market Delta & Market Internals) I'm working on my way to a 'clean chart' but for me it's not an easy path
@PineCoders for all the amazing stuff they do and all the help and tools they provide, in special the Script-Stopwatch at that was key in lowering this indicator's execution time
All the TV and Pine community, open source and shared knowledge are indeed the best way to help each other
IF YOU REALLY LIKE THIS WORK, please send me a comment or a private message and TELL ME WHAT you trade, HOW you trade it and your FAVOURITE SETUP for pulling out money from the market in a consistent basis, I'm learning to trade (this is my 2nd year) and I need all the help I can get
GOOD LUCK AND HAPPY TRADING