المؤشرات والاستراتيجيات
Market Structure HH/LLThis script automatically plots basic market structure points: Higher Highs (HH) and Lower Lows (LL), based on 5-bar pivots.
Useful for identifying trends, reversals, and change of character (ChoCH) in price action setups.
🧠 Ideal for intraday traders using Smart Money Concepts (SMC) or Price Action on lower timeframes (1m–15m).
Combine with BOS/CHoCH and Order Blocks for full SMC strategy.
✅ Clean and lightweight – perfect for quick market structure visualization.
Developed by – customized for VN30F1M & scalping strategies.
Heikin Ashi Smoothed con Gradienti e MA Dinamico
📊 Advanced Heikin-Ashi + 3 Bollinger Bands Indicator
This indicator combines Smoothed Heikin-Ashi candles with three customizable sets of Bollinger Bands, providing a complete visual analysis of trend and market volatility.
MAIN FEATURES:
2 Smoothed Heikin-Ashi Candles:
- Based on two Heikin-Ashi smoothing layers with independent settings
- Advanced color styling options:
🎨 Gradient colors
🔲 Hollow candles (only borders and wicks)
🔥 Delta coloring based on wick size difference
🔵 Automatic black borders when wicks are hidden (for contrast)
3 Independent Bollinger Bands:
- Named First, Second, and Third Bollinger Bands, each with:
- Customizable period and standard deviation
- Separate color and fill settings
- Individual toggle for showing band and fill
- Layered fills for clear visual separation between bands
Full Customization:
- Toggle for wick visibility, borders, gradient colors, hollow mode
- Works with both classic and smoothed Heikin-Ashi
- Great visual clarity, even with complex settings
"By setting both Smoothing Length 1 and 2 to a value of 1, the indicator effectively replicates the classic Heikin Ashi candles. This configuration disables additional smoothing, allowing the Heikin Ashi to reflect market data more directly, preserving its original form without delay or averaging effects."
_________________________________________________________________________
"The indicator also features advanced gradient coloring for Heikin Ashi candles, providing a visually intuitive way to interpret price action. Instead of fixed bullish or bearish colors, the candle body color can dynamically reflect the relative strength of upper and lower wicks, allowing for more nuanced insights. This gradient can be customized and fine-tuned through a palette of seven user-defined colors, enhancing the visual richness and analytical depth of the chart."
Let me know the next part you'd like to describe!
_________________________________________________________________________
Users have the option to disable the candle wicks for a cleaner visual appearance. When wicks are turned off, the indicator automatically sets the candle borders to black, ensuring clear separation and strong visual contrast between candles. This feature enhances readability, especially when using transparent or gradient-filled bodies, making the chart more visually coherent and easier to read.
_________________________________________________________________________
When gradient coloring is disabled, the indicator offers an optional 'hollow candle' mode. In this mode, only the borders and wicks of the candles are displayed, while the candle bodies remain transparent. This minimalistic style can help traders focus on structural price patterns without the distraction of filled colors, and is especially useful for those who prefer clean, contrast-driven chart visuals.
_________________________________________________________________________
When both wick display and gradient coloring are disabled, and the hollow candle mode is enabled, the indicator switches to a simplified display style. In this configuration, only the candle borders are shown, offering a clean outline-only view. Both bullish and bearish candles share the same customizable border color, which can be set directly from the input settings. This mode is ideal for users seeking maximum simplicity and visual clarity."
_________________________________________________________________________
"When the delta color option is enabled, the candle coloring is determined by the relative difference between the upper and lower wick sizes. This method adds an additional layer of price action analysis, where the candle's gradient reflects wick dominance. A stronger upper wick suggests bullish pressure and is visualized through one end of the gradient spectrum, while a dominant lower wick indicates selling pressure and is represented on the opposite end. This nuanced visualization helps traders quickly gauge market sentiment shifts."
Notably, this feature continues to function even when wick display is turned off, allowing traders to benefit from the underlying sentiment insights while maintaining a cleaner visual layout.
_________________________________________________________________________
**"The indicator also supports a Smoothed Heikin Ashi (HA) mode, which enhances traditional HA by applying additional smoothing using two independently configurable moving averages. This dual-smoothing approach helps filter out market noise, offering a clearer view of trend direction and strength. Each moving average can be set to different configurations, allowing users to fine-tune the smoothing process to their specific needs. The following customizable settings are available:"**
- Smoothing Length 1: Controls the length of the first smoothed HA.
- Smoothing Length 2: Controls the length of the second smoothed HA.
Moving Average Type 1 and Moving Average Type 2 selectable from:
- Heikin Original
- SMA (Simple Moving Average)
- EMA (Exponential Moving Average)
- SMMA (RMA - Running Moving Average)
- WMA (Weighted Moving Average)
- VWMA (Volume Weighted Moving Average)
- HMA (Hull Moving Average)
- DEMA (Double Exponential Moving Average)
- TEMA (Triple Exponential Moving Average)
- KAMA (Kaufman Adaptive Moving Average)
- ALMA (Arnaud Legoux Moving Average)
**"Both moving averages can be set to different lengths and types, allowing traders to experiment with various smoothing combinations to suit their preferred trading strategy. When both smoothing lengths are set to 1 and the MA type is 'Heikin Original,' the indicator behaves like a classic Heikin Ashi chart, offering full backward compatibility for users preferring the standard format."**
Note: If one of the two Heikin Ashi layers is set to "Heikin Original," any changes made to the Moving Average Type for the other layer will not take effect. In this case, the chart will behave as a standard Smoothed Heikin Ashi chart.
_________________________________________________________________________
"The color settings and methods previously available, such as Hollow Candles, Show Wick, C and Delta Gradient, work seamlessly with the Smoothed Heikin Ashi (HA) chart. In fact, they perform even better when applied to the Smoothed HA, offering a more refined visual experience and clearer trend identification.
"These features, when applied to the Smoothed Heikin Ashi, allow traders to benefit from both the clarity of the smoother chart and the enhanced visual cues provided by the color settings. The performance of these settings is significantly improved, offering a more intuitive and reliable charting experience."
Gradient Color:
-----------------------------------------------------------------
Delta Gradient:
-----------------------------------------------------------------
Show Wick OFF - Gradient Color:
--------------------------
Show Wick OFF - DELTA Color:
--------------------------
Show Wick OFF - Normal Color:
--------------------------
Show Wick OFF - Hollow Candles:
_________________________________________________________________________
"Three Bollinger Bands for Enhanced Market Analysis"
"This indicator allows you to use not just a single set of Bollinger Bands, but also two additional sets, each with customizable settings. This provides a more detailed view of price volatility and trend strength. The first Bollinger Band is based on a standard period and standard deviation, while the second and third sets use higher standard deviations for broader price channels, offering insights into extended market movements. Here's how the three sets of Bollinger Bands work:"
1. First Bollinger Band (First Bands, Dev 2):
- This is the traditional Bollinger Band, calculated using a Simple Moving Average (SMA) as the base and a specified standard deviation multiplier.
- Customizable Settings:
- First Length: The period used for calculating the SMA
- First Standard Deviation:** The multiplier for the standard deviation (default is 2.0).
The first Bollinger Band helps identify the range of normal price fluctuations and provides clear support/resistance zones based on the moving average.
2. Second Bollinger Band (Second Bands, Dev 4):
- A second set of Bollinger Bands, calculated using the same base SMA but with a higher standard deviation multiplier (default is 4.0).
- Customizable Settings:
- Second Length: The period for the second set of Bollinger Bands
- Second Deviation: The higher multiplier for the second set of bands (default is 4.0).
The second Bollinger Band gives insight into extreme price movements, highlighting periods of high volatility and potential breakout zones.
3) Third Bollinger Band (Third Bands, Dev 6):
- A third set of Bollinger Bands can be added with customizable settings for a broader analysis
of the market's volatility.
- Customizable Settings:
- Third Length: The period for calculating the third set of Bollinger Bands.
- Third Standard Deviation: The multiplier for the third set of bands (default is 6.0).
The third Bollinger Band acts as an even wider channel for understanding extreme market conditions or prolonged trending periods. Traders can use this band to identify long-term support/resistance levels or extended price ranges.
----------------------------------------------------
"The indicator offers complete control over the length and deviation of each set of bands, allowing traders to customize their analysis for different market conditions. The three Bollinger Bands can provide more detailed insights into market volatility, allowing for better risk management and trade decision-making."
----------------------------------------------------
"Each Bollinger Band and its corresponding fill can be individually enabled or disabled. This means you can choose to focus on any single set of bands (First, Second, or Third) or use multiple bands simultaneously, based on your trading strategy and the market conditions. Similarly, you can activate or deactivate the fills for the bands to further customize the chart's visual display."
----------------------------------------------------
"Additionally, each set of Bollinger Bands can be individually toggled for visibility, making it possible to display just one, two, or all three bands depending on the level of detail you wish to analyze. The fills between the bands can also be toggled on/off independently."
Profitable Hours EUR/USD
Profitable Hours: It identifies the most profitable hours, based on significant price movements and high volatility (higher than the highest price movement and volatility over the last 24 periods).
Hour Display in EET: The active hour is displayed in Eastern European Time (EET), which is adjusted based on the GMT offset you provide.
This version of the script should help you visualize profitable hours for trading EUR/USD based on price movement and volatility, as well as time zone adjustments.
Log-Normal Z-ScoreLog-Normal Z-Score
This Pine Script indicator calculates a modified Z-Score based on log-normal returns, aiming to identify statistically significant price deviations.
Indicator Parameters:
Model Length: The number of bars used to calculate the mean and standard deviation of log returns.
Lookback Length: The number of bars used to compute the lookback return and volatility. This is the main timeframe over which the Z-Score is calculated.
Volatility SMA Length: The smoothing length for the volatility, applying a simple moving average to the calculated volatility.
cc AJ Algo 1 - 0,11,41,3,17,29 This Indicator finds specific candle values based on the UTC+2 Time Zone.
Uptrend Filter: Price > 50 & 200 MA + Upward SlopeThis indicator is designed to help traders instantly identify strong uptrend conditions based on two simple yet powerful criteria:
Price is above both the 50-day and 200-day moving averages
Both moving averages are sloping upward (positive momentum)
When both conditions are met, the indicator plots a green “UP” label below the candle, signaling a valid uptrend setup. This filter is ideal for asset selection in strategy-building, portfolio rotation, or trend-following systems.
🧠 Why it works:
The 50-day MA reflects medium-term momentum.
The 200-day MA represents the long-term trend.
When both are aligned and sloping upward, it confirms strong market structure and trend health.
🧰 Best used for:
Token screening (e.g., filtering altcoins)
Momentum-based entries
Trend confirmation
Risk filtering in strategy backtesting
cc AJ Algo 2 - 3,59,17,11,47,29 This Indicator finds Specific "Time Based" values from the UTC+2 Time Zone.
Fractal Lines (Configurable with Labels)Draws fractal lines with fractal range of 100 and shows last 5 fractals
Pavio do Candle (%)Oscilador que mostra a porcentagem do pavio em relação ao comprimento total do candle.
Average Daily Price Movement (14 Days)Computes the daily high-low range
Averages it over 14 candles
Displays a label on the most recent candle with the average range in text
CryptoQuebec Suite// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// Crypto Quebec & StefB.
//@version=6
indicator("CryptoQuebec Suite", overlay = true, max_labels_count = 500, max_lines_count = 500, max_boxes_count = 500, max_bars_back = 500)
//strategy("UT BOT Amélioré pour le Day Trading Crypto", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Version 2.0 order block ajustable colors
// Version 2.1 draw swing High/low
// Version 2.2 Changed the wording of "Area of interest" for "Premium Zone" and "Discount Zone"
// Version 2.3 Added the price to the auto fib levels.
// Version 2.4 Correction. Added 3 digits after the dot of the auto fib. This was lost when the price has been added.
// Version 2.4.01 Added few fib levels. (0, -0.272, -0.414, -0.618).
// Version 2.4.02 Added few fib levels. (1, 1.272, 1.414, 1.618).
// Version 2.4.03 Made a small change in the label of 240L, 240H, DL and DH. Change 240 for 4h and H/L for Lo/Hi
// Version 2.4.04 Added digits after the dot for more price precision into the Fib levels.
// Version 2.4.05 Added Entry long/short indicator base on EMA. Also added the trailing stop line.
// Version 2.4.06 Added Trail Stop enable/disable option. Moved the Buy/Sell label farther from the candles.
// Version 2.4.07 Added Trend info table with active trading session
// Version 2.4.08 Small adjustment in the trend table and FIB lines more visible.
// Version 2.4.09 Changed the indicator name for CryptoQuebe Suite.
//---------------------------------------------------------------------------------------------------------------------
//CONSTANTS & STRINGS & INPUTS
//---------------------------------------------------------------------------------------------------------------------
BULLISH = +1
BEARISH = -1
showHighLowSwingsTooltip = 'Highlight most recent strong and weak high/low points on the chart'
bullC = input.color(defval = #14D990, title = "Bull Color", group = "Smart Money Concepts", inline = "7")
bearC = input.color(defval = #F24968, title = "Bear Color", group = "Smart Money Concepts", inline = "7")
showInt = input.bool(defval = true, title = "Show Internals", group = "Smart Money Concepts")
intSens = input.int(3, "Internals Sensitivity", options = , group = "Smart Money Concepts", inline = "20")
intStru = input.string(defval = "All", title = "Internal Structure", options = , inline = "30", group = "Smart Money Concepts")
showExt = input.bool(defval = true, title = "Show Externals" ,group = "Smart Money Concepts")
extSens = input.int(25, "Externals Sensitivity", options = ,group = "Smart Money Concepts", inline = "21")
extStru = input.string(defval = "All", title = "External Structure", options = , inline = "31", group = "Smart Money Concepts")
showOB = input.bool(defval = true, title = "Show Order Blocks" ,group = "Swing Blocks")
//----------------------------------------------
//showHighLowSwingsInput = input(true, 'Show Strong/Weak High/Low', group = "Smart Money Concepts", tooltip = showHighLowSwingsTooltip)
BullOBColor = input.color(color.new(#3179f5, 80), 'Internal Bullish OB',group = "Swing Blocks")
BearOBColor = input.color(color.new(#f77c80, 80), 'Internal Bearish OB',group = "Swing Blocks")
//---------------------------------------------------------------------------
showLast = input.int(defval = 10, title = "Swing Order Blocks", minval = 0, group = "Swing Blocks")
showHHLH = input.bool(defval = true, title = "Show HH/LH", group = "Swing Blocks")
showHLLL = input.bool(defval = true, title = "Show LH/LL", group = "Swing Blocks")
showAOE = input.bool(defval = true, title = "Show Premium/Discount", group = "Swing Blocks")
//showAOE = input.bool(defval = true, title = "Show Area of Interest", group = "Swing Blocks")
show1D = input.bool(defval = true, title = "Show Previous Day High", group = "High/Low")
show1DLab = input.bool(defval = true, title = "Show 1 Day Labels", group = "High/Low")
show4H = input.bool(defval = true, title = "Show 4 Hour High", group = "High/Low")
show4hLab = input.bool(defval = true, title = "Show 4 Hour Labels", group = "High/Low")
showFVG = input.bool(defval = true, title = "Show Fair Value Gaps", group = "FVG")
contract = input.bool(defval = false, title = "Contract Violated FVG", group = "FVG")
closeOnly = input.bool(defval = false, title = "Show Closest Up/Down FVG Only", group = "FVG")
fvgcol = input.color(defval = #F2B807, title = "FVG Color", group = "FVG")
fvgtra = input.int(defval = 80, minval = 0, maxval = 100, title = "FVG Transparency", group = "FVG")
showFibs = input.bool(defval = true, title = "Show Auto Fibs", group = "Auto Fibs")
// extSensFibs = input.int(25, "Fibs Sensitivity", options = , group = "Auto Fibs", inline = "22")
show0_618 = input.bool(defval = true, title = "", inline = "1", group = "Auto Fibs")
show0_414 = input.bool(defval = true, title = "", inline = "2", group = "Auto Fibs")
show0_272 = input.bool(defval = true, title = "", inline = "3", group = "Auto Fibs")
show0 = input.bool(defval = true, title = "", inline = "4", group = "Auto Fibs")
show236 = input.bool(defval = true, title = "", inline = "5", group = "Auto Fibs")
show382 = input.bool(defval = true, title = "", inline = "6", group = "Auto Fibs")
show5 = input.bool(defval = true, title = "", inline = "7", group = "Auto Fibs")
show618 = input.bool(defval = true, title = "", inline = "8", group = "Auto Fibs")
show65 = input.bool(defval = true, title = "", inline = "9", group = "Auto Fibs")
show786 = input.bool(defval = true, title = "", inline = "10", group = "Auto Fibs")
show1 = input.bool(defval = true, title = "", inline = "11", group = "Auto Fibs")
show1_272 = input.bool(defval = true, title = "", inline = "12", group = "Auto Fibs")
show1_414 = input.bool(defval = true, title = "", inline = "13", group = "Auto Fibs")
show1_618 = input.bool(defval = true, title = "", inline = "14", group = "Auto Fibs")
fib1 = input.float(defval = -0.618, title = "", minval = -0.618, step = 0.01, inline = "1", group = "Auto Fibs")
fib2 = input.float(defval = -0.414, title = "", minval = -0.618, step = 0.01, inline = "2", group = "Auto Fibs")
fib3 = input.float(defval = -0.272, title = "", minval = -0.618, step = 0.01, inline = "3", group = "Auto Fibs")
fib4 = input.float(defval = 0, title = "", minval = 0, step = 0.01, inline = "4", group = "Auto Fibs")
fib5 = input.float(defval = .236, title = "", minval = 0, step = 0.01, inline = "5", group = "Auto Fibs")
fib6 = input.float(defval = .382, title = "", minval = 0, step = 0.01, inline = "6", group = "Auto Fibs")
fib7 = input.float(defval = .5, title = "", minval = 0, step = 0.01, inline = "7", group = "Auto Fibs")
fib8 = input.float(defval = .618, title = "", minval = 0, step = 0.01, inline = "8", group = "Auto Fibs")
fib9 = input.float(defval = .65, title = "", minval = 0, step = 0.01, inline = "9", group = "Auto Fibs")
fib10 = input.float(defval = .786, title = "", minval = 0, step = 0.01, inline = "10", group = "Auto Fibs")
fib11 = input.float(defval = 1, title = "", minval = 0, step = 0.01, inline = "11", group = "Auto Fibs")
fib12 = input.float(defval = 1.272, title = "", minval = 0, step = 0.01, inline = "12", group = "Auto Fibs")
fib13 = input.float(defval = 1.414, title = "", minval = 0, step = 0.01, inline = "13", group = "Auto Fibs")
fib14 = input.float(defval = 1.618, title = "", minval = 0, step = 0.01, inline = "14", group = "Auto Fibs")
fib1col = input.color(title = "", defval = color.orange, inline = "1", group = "Auto Fibs")
fib2col = input.color(title = "", defval = color.orange, inline = "2", group = "Auto Fibs")
fib3col = input.color(title = "", defval = color.orange, inline = "3", group = "Auto Fibs")
fib4col = input.color(title = "", defval = color.gray, inline = "4", group = "Auto Fibs")
fib5col = input.color(title = "", defval = color.white, inline = "5", group = "Auto Fibs")
fib6col = input.color(title = "", defval = color.white, inline = "6", group = "Auto Fibs")
fib7col = input.color(title = "", defval = color.red, inline = "7", group = "Auto Fibs")
fib8col = input.color(title = "", defval = color.green, inline = "8", group = "Auto Fibs")
fib9col = input.color(title = "", defval = color.green, inline = "9", group = "Auto Fibs")
fib10col = input.color(title = "", defval = color.white, inline = "10", group = "Auto Fibs")
fib11col = input.color(title = "", defval = color.gray, inline = "11", group = "Auto Fibs")
fib12col = input.color(title = "", defval = color.orange, inline = "12", group = "Auto Fibs")
fib13col = input.color(title = "", defval = color.orange, inline = "13", group = "Auto Fibs")
fib14col = input.color(title = "", defval = color.orange, inline = "14", group = "Auto Fibs")
//---------------------------------------------------------------------------------------------------------------------
//DATA STRUCTURES & VARIABLES
//---------------------------------------------------------------------------------------------------------------------
// @type UDT representing last swing extremes (top & bottom)
// @field top last top swing price
// @field bottom last bottom swing price
// @field barTime last swing bar time
// @field barIndex last swing bar index
// @field lastTopTime last top swing time
// @field lastBottomTime last bottom swing time
type trailingExtremes
float top
float bottom
int barTime
int barIndex
int lastTopTime
int lastBottomTime
// @type UDT representing trend bias
// @field bias BULLISH or BEARISH
type trend
int bias
var bigData = map.new()
// @variable swing trend bias
var trend swingTrend = trend.new(0)
// @variable last trailing swing high and low
var trailingExtremes trailing = trailingExtremes.new()
// @variable color for swing bullish structures
var swingBullishColor = color.green //styleInput == MONOCHROME ? MONO_BULLISH : swingBullColorInput
// @variable color for swing bearish structures
var swingBearishColor = color.red //styleInput == MONOCHROME ? MONO_BEARISH : swingBearColorInput
if bigData.size() == 0
bigData.put("moving", 0)
bigData.put("upaxis", 0.0)
bigData.put("upaxis2", 0)
bigData.put("dnaxis", 0.0)
bigData.put("dnaxis2", 0)
bigData.put("upside", 1)
bigData.put("downside", 1)
= request.security(syminfo.tickerid, "1D", [high , low , high, low, time , time])
var highArr = array.new_float(), var lowArr = array.new_float()
var timeArr = array.new_int (), var volArr = array.new_float()
var closeArr = array.new_float(), var openArr = array.new_float()
highArr.unshift(high), lowArr.unshift(low)
timeArr.unshift(time), volArr.unshift(volume)
closeArr.unshift(close), openArr.unshift(open)
type rollingTF
float highTF = 0
float lowTF = 1e8
int highTFt = 0
int lowTFt = 0
float volTF = 0
map rTFdraw
map rTFlabel
// Convert time period in text
f_convert_tf_to_text(tf) =>
tf == "240" ? "H4" : tf == "1D" ? "D" : tf == "60" ? "1h" : tf == "15" ? "15m" : tf
// Create the labels fo each level
offset = 10 // Ajustez cette valeur selon le décalage souhaité
// Ajust the label position in case of overide
f_adjust_label_position(x, offset) =>
x + offset
// @function tfDraw
// @param tfDiff Specifies the timeframe difference for the high/low calculations.
// @param showRollingLab Indicates whether to display rolling labels for timeframes.
// @param tf Specifies the timeframe as a string.
// @param showLevels Determines if the high/low levels for the timeframe should be shown.
// @returns A tuple with the total volume (TFhrdata.volTF) and the rolling volume array (volRolling).
method tfDraw(int tfDiff, bool showRollingLab, string tf, bool showLevels) =>
TFhrdata = rollingTF.new(), var volRolling = array.new()
if highArr.size() > tfDiff
for i = 0 to tfDiff
if showLevels and barstate.islast
getHigh = highArr.get(i), getLow = lowArr.get(i),
getTime = timeArr.get(i)
TFhrdata.highTF := math.max(TFhrdata.highTF, getHigh)
TFhrdata.lowTF := math.min(TFhrdata.lowTF , getLow )
if TFhrdata.highTF == getHigh
TFhrdata.highTFt := timeArr.get(i)
if TFhrdata.lowTF == getLow
TFhrdata.lowTFt := timeArr.get(i)
TFhrdata.volTF += volArr.get(i)
volRolling.push(TFhrdata.volTF)
var lineDraw = rollingTF.new(rTFdraw = map.new(), rTFlabel = map.new())
if showLevels
switch lineDraw.rTFdraw.size() == 0
true => lineDraw.rTFdraw.put("High", line.new(TFhrdata.highTFt, TFhrdata.highTF, time, TFhrdata.highTF,
xloc = xloc.bar_time, color = color.aqua)),
lineDraw.rTFdraw.put("Low" , line.new(TFhrdata.lowTFt , TFhrdata.lowTF , time, TFhrdata.lowTF ,
xloc = xloc.bar_time, color = color.aqua))
=> lineDraw.rTFdraw.get("High").set_xy1(TFhrdata.highTFt, TFhrdata.highTF),
lineDraw.rTFdraw.get("High").set_xy2(time, TFhrdata.highTF),
lineDraw.rTFdraw.get("Low").set_xy1(TFhrdata.lowTFt, TFhrdata.lowTF),
lineDraw.rTFdraw.get("Low").set_xy2(time, TFhrdata.lowTF)
if showRollingLab
switch lineDraw.rTFlabel.size() == 0
true => lineDraw.rTFlabel.put("High", label.new(f_adjust_label_position(bar_index, offset), TFhrdata.highTF, xloc = xloc.bar_time, textcolor = color.aqua, text = f_convert_tf_to_text(tf) + " Hi", style = label.style_label_left, size = size.normal, color = #00000000)),
lineDraw.rTFlabel.put("Low", label.new(f_adjust_label_position(bar_index, offset), TFhrdata.lowTF, xloc = xloc.bar_time, textcolor = color.aqua, text = f_convert_tf_to_text(tf) + " Lo", style = label.style_label_left, size = size.normal, color = #00000000))
=> lineDraw.rTFlabel.get("High") .set_xy(time, TFhrdata.highTF),
lineDraw.rTFlabel.get("Low") .set_xy(time, TFhrdata.lowTF)
// @function tfDrawLower
// @param showRollingLab Indicates whether to display rolling labels for lower timeframes.
// @param tf Specifies the lower timeframe as a string.
// @param showLevels Determines if the high/low levels for the lower timeframe should be shown.
// @returns (volume and volume array)
tfDrawLower(bool showRollingLab, simple string tf, bool showLevels) =>
simple int end = switch tf
"240" => 240
"1D" => 1440
= request.security_lower_tf(syminfo.tickerid, "1", )
var oArr = array.new_float()
var hArr = array.new_float()
var lArr = array.new_float()
var cArr = array.new_float()
var vArr = array.new_float()
var tArr = array.new_int()
TFhrdata = rollingTF.new(), var volRolling = array.new()
if h.size() > 0
for i = 0 to h.size() - 1
oArr.push(o.get(i))
hArr.push(h.get(i))
lArr.push(l.get(i))
cArr.push(c.get(i))
vArr.push(v.get(i))
tArr.push(t.get(i))
if hArr.size() > end
oArr.shift()
hArr.shift()
lArr.shift()
cArr.shift()
vArr.shift()
tArr.shift()
for i = 0 to hArr.size() - 1
if showLevels
getHigh = hArr.get(i), getLow = lArr.get(i),
getTime = tArr.get(i)
TFhrdata.highTF := math.max(TFhrdata.highTF, getHigh)
TFhrdata.lowTF := math.min(TFhrdata.lowTF , getLow)
if TFhrdata.highTF == getHigh
TFhrdata.highTFt := tArr.get(i)
if TFhrdata.lowTF == getLow
TFhrdata.lowTFt := tArr.get(i)
TFhrdata.volTF += vArr.get(i)
volRolling.push(TFhrdata.volTF)
var lineDraw = rollingTF.new(rTFdraw = map.new(), rTFlabel = map.new())
if showLevels
switch lineDraw.rTFdraw.size() == 0
true => lineDraw.rTFdraw.put("High", line.new(TFhrdata.highTFt, TFhrdata.highTF, time, TFhrdata.highTF,
xloc = xloc.bar_time, color = color.aqua)),
lineDraw.rTFdraw.put("Low" , line.new(TFhrdata.lowTFt , TFhrdata.lowTF , time, TFhrdata.lowTF ,
xloc = xloc.bar_time, color = color.aqua))
=> lineDraw.rTFdraw.get("High").set_xy1(TFhrdata.highTFt, TFhrdata.highTF),
lineDraw.rTFdraw.get("High").set_xy2(time, TFhrdata.highTF),
lineDraw.rTFdraw.get("Low").set_xy1(TFhrdata.lowTFt, TFhrdata.lowTF),
lineDraw.rTFdraw.get("Low").set_xy2(time, TFhrdata.lowTF)
if showRollingLab
switch lineDraw.rTFlabel.size() == 0
true => lineDraw.rTFlabel.put("High", label.new(f_adjust_label_position(bar_index, 0), TFhrdata.highTF, xloc = xloc.bar_time, textcolor = color.aqua, text = f_convert_tf_to_text(tf) + " Hi", style = label.style_label_left, size = size.normal, color = #00000000)),
lineDraw.rTFlabel.put("Low" , label.new(f_adjust_label_position(bar_index, 0), TFhrdata.lowTF, xloc = xloc.bar_time, textcolor = color.aqua, text = f_convert_tf_to_text(tf) + " Lo", style = label.style_label_left, size = size.normal, color = #00000000))
=> lineDraw.rTFlabel.get("High") .set_xy(time, TFhrdata.highTF),
lineDraw.rTFlabel.get("Low") .set_xy(time, TFhrdata.lowTF)
var r4hrbars = math.floor(timeframe.in_seconds("240") / timeframe.in_seconds(timeframe.period))
var rDbars = math.floor(timeframe.in_seconds("1D") / timeframe.in_seconds(timeframe.period))
= switch
timeframe.in_seconds() <= 60 => r4hrbars.tfDraw(show4hLab, "240", show4H)
=> tfDrawLower(show4hLab, "240", show4H)
= switch
timeframe.in_seconds() <= 60 => rDbars.tfDraw(show1DLab, "1D", show1D)
=> tfDrawLower(show1DLab, "1D", show1D)
// @function calculatePivots
// @param length Specifies the lookback length for high/low pivot calculations.
// @returns A tuple with top and bottom swing values.
calculatePivots(length)=>
var int intraCalc = 0
if bar_index > length + 1
up = highArr.slice(0, length).max()
dn = lowArr .slice(0, length).min()
cHi = highArr.get(length)
cLo = lowArr .get(length)
intraCalc := switch
cHi > up => 0
cLo < dn => 1
=> intraCalc
topSwing = switch
intraCalc == 0 and intraCalc != 0 => cHi
=> 0
botSwing = switch
intraCalc == 1 and intraCalc != 1 => cLo
=> 0
= calculatePivots(extSens)
= calculatePivots(intSens)
var label upLabel = array.new_label(1)
var label dnLabel = array.new_label(1)
var box highBlock = array.new_box()
var box lowBlock = array.new_box()
drawChar(x, y, str, col, down) =>
style = switch down
true => label.style_label_down
=> label.style_label_up
line.new (int(x), y, bar_index, y, color = col, style = line.style_dashed)
label.new(math.round(math.avg(x, bar_index)), y, str, color = #00000000, textcolor = col, style = style, size = size.small)
// @function drawStructureExt
// @returns Counter indicating the structure direction: 1 for bullish, -1 for bearish, 0 for neutral.
drawStructureExt() =>
var int counter = 0
if bigUpper != 0
bigData.put("upside", 1)
x1 = bar_index - extSens
txt = switch bigUpper > bigData.get("upaxis")
true => 'HH'
=> 'LH'
if showHHLH
upLabel.set(0, label.new(x1, bigUpper, txt,
color = color.new(color.white, 100),
textcolor = bearC,
style = label.style_label_down,
size = size.small
))
if showOB
highBlock.push(box.new(x1, bigUpper, last_bar_index + 5, bigUpper * .998, border_color = BearOBColor, bgcolor = BearOBColor))
bigData.put("upaxis" , bigUpper)
bigData.put("upaxis2", x1)
counter := 1
if bigLower != 0
bigData.put("downside", 1)
x1 = bar_index - extSens
txt = switch bigLower < bigData.get("dnaxis")
true => "LL"
=> "HL"
if showHLLL == true
dnLabel.set(0, label.new(x1, bigLower, txt, color = #ffffff00,
textcolor = bullC,
style = label.style_label_up,
size = size.small
))
if showOB
lowBlock.push(box.new(x1, bigLower, last_bar_index + 5, bigLower * 1.002, border_color = BullOBColor, bgcolor = BullOBColor))
//border_color = color.new(color.blue, 60),//75),
//bgcolor = color.new(color.blue, 70)//95)
//))
bigData.put("dnaxis" , bigLower)
bigData.put("dnaxis2", x1)
counter := -1
if showExt
if ta.crossover(close, bigData.get("upaxis"))
if bigData.get("upside") != 0
str = switch bigData.get("moving") < 0
true => extStru != "BoS" ? 'CHoCH' : ""
=> extStru != 'CHoCH' ? 'BoS' : ""
if extStru == "All" or str.contains(extStru, str)
drawChar(bigData.get("upaxis2"), bigData.get("upaxis"), str, bullC, true)
bigData.put("upside", 0)
bigData.put("moving", 1)
if ta.crossunder(close, bigData.get("dnaxis"))
if bigData.get("downside") != 0
str = switch bigData.get("moving") > 0
true => extStru != "BoS" ? 'CHoCH' : ""
=> extStru != 'CHoCH' ? 'BoS' : ""
if extStru == "All" or str.contains(extStru, str)
drawChar(bigData.get("dnaxis2"), bigData.get("dnaxis"), str, bearC, false)
bigData.put("downside", 0)
bigData.put("moving", -1)
counter
counter = drawStructureExt()
// @function updateBox
// @param id Array of boxes to update based on the bar index.
// @returns void
method updateBox(array id) =>
if id.size() > 0
for i = 0 to id.size() - 1
id.get(i).set_right(last_bar_index + 5)
method cleanseLevel(array id, bool isHighBlock) =>
if id.size() > 0
for i = id.size() - 1 to 0
condition = switch isHighBlock
true => close >= id.get(i).get_top()
=> close <= id.get(i).get_bottom()
if condition
id.remove(i).delete()
if id.size() > showLast and showLast != 0
for i = id.size() - showLast to 0
id.remove(i).delete()
highBlock.cleanseLevel(true)
lowBlock .cleanseLevel(false)
if barstate.islast
highBlock.updateBox()
lowBlock .updateBox()
// @function updateMain
// @param id Line object for updating based on price structure pivots.
// @returns void
// @description Updates the main line indicator to match the latest high/low price levels.
method updateMain(line id) =>
hi = 0.0
lo = 1e8
if showFibs
= calculatePivots(25)
var int counterFibs = 0
if bigUpperFibs != 0
counterFibs := 1
if bigLowerFibs != 0
counterFibs := -1
if counterFibs == 1
hi := 0.0
id.set_xy1(int(bigData.get("upaxis2")), bigData.get("upaxis"))
for i = 0 to bar_index - int(bigData.get("dnaxis2"))
getLow = lowArr.get(i)
lo := math.min(getLow, lo)
if lo == getLow
id.set_xy2(bar_index - i, lo)
else if counterFibs == -1
lo := 1e8
id.set_xy1(int(bigData.get("dnaxis2")), bigData.get("dnaxis"))
for i = 0 to bar_index - bigData.get("upaxis2")
getHigh = highArr.get(i)
hi := math.max(highArr.get(i), hi)
if hi == getHigh
id.set_xy2(bar_index - i, hi)
if id.get_x2() < id.get_x1()
x2 = id.get_x2(), x1 = id.get_x1()
y2 = id.get_y2(), y1 = id.get_y1(),
id.set_xy2(x1, y1),
id.set_xy1(x2, y2)
switch id.get_y2() < id.get_y1()
true => id.set_color(#F24968)
=> id.set_color(#14D990)
0
var main = line.new(dnLabel.first().get_x(), dnLabel.first().get_y(), upLabel.first().get_x(), upLabel.first().get_y(),
style = line.style_dashed,
width = 2
)
main.updateMain()
//-----------------------------------FIB----------------------------------------------------------
// @function quickLine
// @param getX2 The x-coordinate for the endpoint of the line.
// @param y The y-coordinate for the line’s position.
// @param color The color of the line to be drawn.
// @returns void
// @description Draws a horizontal line on the chart with specific attributes.
quickLine(getX2, y, color) =>
line.new(getX2, y, bar_index + 5, y, color = color.new(color, 50))
// @function quickLabel
// @param y The y-coordinate for the label’s position.
// @param txt Text content of the label.
// @param color The text color of the label.
// @returns void
// @description Places a label with given text and color at a specified y-coordinate.
quickLabel(y, txt, color) =>
label.new(bar_index + 5, y, text = str.tostring(txt), color = #00000000, style = label.style_label_left, textcolor = color)
// @function drawFibs
// @returns void
// @description Draws Fibonacci retracement levels based on recent price action.
drawFibs() =>
if barstate.islast
var fibLine = array.new(14)
var fibLab = array.new(14)
if fibLine.size() > 0
for i = 0 to fibLine.size() - 1
fibLine .get(i).delete()
fibLab .get(i).delete()
if showFibs
getY2 = main.get_y2(), sub = main.get_y1() - getY2,
getX1 = main.get_x1(), getX2 = main.get_x2()
for i = 0 to fibLine.size() - 1
mod = i % fibLine.size() - 1
= switch mod
0 =>
1 =>
2 =>
3 =>
4 =>
5 =>
6 =>
7 =>
8 =>
9 =>
10 =>
11 =>
12 =>
13 =>
fibLine.set(i, quickLine (getX2, y, col))
// Combine text level and price
priceLabel = str.tostring(y, "#.#####")
combinedText = txt + " (" + priceLabel + ")" // Prix entre parenthèses
fibLab.set(i, quickLabel(y, combinedText, col))
drawFibs()
// @function drawStructureInternals
// @returns void
// @description Draws internal structures for smaller price swings based on user-defined settings.
drawStructureInternals() =>
if showInt
var keyValues = map.new()
if keyValues.size() == 0
keyValues.put("movingSmall", 0)
if smallUpper != 0
keyValues.put("upsideSmall", 1)
keyValues.put("upaxisSmall", smallUpper)
keyValues.put("upaxis2Small", bar_index - intSens)
if smallLower != 0
keyValues.put("downsideSmall", 1)
keyValues.put("dnaxisSmall", smallLower)
keyValues.put("dnaxis2Small", bar_index - intSens)
if ta.crossover(close, keyValues.get("upaxisSmall"))
if keyValues.get("upsideSmall") != 0
str = switch
keyValues.get("movingSmall") < 0 => intStru != "BoS" ? 'I-CHoCH' : ""
=> intStru != "CHoCH" ? 'I-BoS' : ""
if intStru == "All" or str.contains(str, intStru)
drawChar(keyValues.get("upaxis2Small"), keyValues.get("upaxisSmall"), str, bullC, true)
keyValues.put("upsideSmall", 0)
keyValues.put("movingSmall", 1)
if ta.crossunder(close, keyValues.get("dnaxisSmall"))
if keyValues.get("downsideSmall") != 0
str = switch
keyValues.get("movingSmall") > 0 => intStru != "BoS" ? 'I-CHoCH' : ""
=> intStru != "CHoCH" ? 'I-BoS' : ""
if intStru == "All" or str.contains(str, intStru)
drawChar(keyValues.get("dnaxis2Small"), keyValues.get("dnaxisSmall"), str, bearC, false)
keyValues.put("downsideSmall", 0)
keyValues.put("movingSmall", -1)
drawStructureInternals()
// @function drawAOE
// @returns void
// @description Draws the Premium and Discount Zones on the chart based on recent highs and lows.
drawAOE() =>
atr = ta.atr(14)
if showAOE
if closeArr.size() > 50
aoi = closeArr.slice(0, 50)
aoi2 = openArr .slice(0, 50)
maxaoiH = math.max(aoi.max(), aoi2.max())
minaoiL = math.min(aoi.min(), aoi2.min())
var aoeLevels = map.new()
if aoeLevels.size() == 0
aoeLevels.put("High",
box.new(bar_index , maxaoiH * 1.01, bar_index + 5, maxaoiH,
border_color = #00000000,
bgcolor = color.new(#F24968, 90),
text = "Premium Zone", //"Area of Interest" ,
text_size = size.normal,//.small,
text_color = color.new(#F24968, 33)
))
aoeLevels.put("Low",
box.new(bar_index , minaoiL, bar_index + 5, minaoiL * .99,
border_color = #00000000,
bgcolor = color.new(#14D990, 90),
text = "Discount Zone", //"Area of Interest" ,
text_size = size.normal,//size.small,
text_color = color.new(#14D990, 33)
))
getHighBox = aoeLevels.get("High")
if close <= getHighBox.get_top() * 1.01
getHighBox.set_lefttop (bar_index , maxaoiH + atr)
getHighBox.set_rightbottom (bar_index + 5, maxaoiH)
getHighBox.set_text ("Premium Zone") //"Area of Interest")
else
getHighBox.set_lefttop (bar_index + 5, maxaoiH + atr)
getHighBox.set_rightbottom (bar_index + 5, maxaoiH + atr)
getHighBox.set_text ("")
getLowBox = aoeLevels.get("Low")
if close >= getLowBox.get_bottom() * .99
getLowBox.set_lefttop (bar_index , minaoiL)
getLowBox.set_rightbottom (bar_index + 5, minaoiL - atr)
getLowBox.set_text ("Discount Zone") //"Area of Interest")
else
getLowBox.set_lefttop (bar_index + 5, minaoiL)
getLowBox.set_rightbottom (bar_index + 5, - atr)
getLowBox.set_text ("")
drawAOE()
var table tab2 = table.new(position.top_right, 13, 13, bgcolor = #20222C, border_color = #363843, frame_color = #363843, border_width = 1, frame_width = 1)
nyHour = hour (timenow, "America/New_York")
nyMinute = minute(timenow, "America/New_York")
// @function fvg
// @param direction Determines the direction for fair value gap (FVG) detection: positive for up, negative for down.
// @returns An array of FVG boxes in the specified direction.
// @description Identifies fair value gaps (FVGs) and stores them in an array of boxes for visual representation.
fvg(direction) =>
var fvgMat = matrix.new(5), var fvgDrawings = array.new()
fvgMat.add_col(0, array.from(math.sign(close - open), close, high, low, time))
if fvgMat.columns() > 3
fvgMat.remove_col(fvgMat.columns() - 1)
if fvgMat.row(0).sum() == direction
getDir = math.sign(direction)
= switch getDir
-1 =>
=>
col = switch closeOnly
true => #00000000
=> color.new(fvgcol, fvgtra)
fvgDrawings.push(
box.new(int(fvgMat.get(4, 1)),y, last_bar_time, y1, xloc = xloc.bar_time,
border_color = col, bgcolor = col)
)
fvgDrawings
if showFVG
fvgDn = fvg(-3)
fvgUp = fvg(3)
if fvgDn.size() > 0
for i = fvgDn.size() - 1 to 0
getfvg = fvgDn.get(i)
if high >= getfvg.get_top()
getfvg.delete()
fvgDn.remove(i)
else if contract
if high > getfvg.get_bottom()
getfvg.set_bottom(high)
if fvgUp.size() > 0
for i = fvgUp.size() - 1 to 0
getfvg = fvgUp.get(i)
if low <= getfvg.get_bottom()
getfvg.delete()
fvgUp.remove(i)
else if contract
if low < getfvg.get_top()
getfvg.set_top(low)
if closeOnly and barstate.islast
minDist = matrix.new(1, 2, 20e20)
if fvgDn.size() > 0
for i = fvgDn.size() - 1 to 0
getBottom = fvgDn.get(i).get_bottom()
minDist.set(0, 1, math.min(minDist.get(0, 1), math.abs(close - getBottom)))
if math.abs(close - getBottom) == minDist.get(0, 1)
minDist.set(0, 0, i)
fvgDn.get(i).set_right(fvgDn.get(i).get_left())
fvgDn.get(int(minDist.get(0, 0))).set_bgcolor(color.new(fvgcol, fvgtra))
fvgDn.get(int(minDist.get(0, 0))).set_border_color(color.new(fvgcol, fvgtra))
fvgDn.get(int(minDist.get(0, 0))).set_right(last_bar_time)
minDist.set(0, 0, 0)
minDist.set(0, 1, 20e20)
if fvgUp.size() > 0
for i = fvgUp.size() - 1 to 0
getTop = fvgUp.get(i).get_top()
minDist.set(0, 1, math.min(minDist.get(0, 1), math.abs(close - getTop)))
if math.abs(close - getTop) == minDist.get(0, 1)
minDist.set(0, 0, i)
fvgUp.get(i).set_right(fvgUp.get(i).get_left())
fvgUp.get(int(minDist.get(0, 0))).set_bgcolor(color.new(fvgcol, fvgtra))
fvgUp.get(int(minDist.get(0, 0))).set_border_color(color.new(fvgcol, fvgtra))
fvgUp.get(int(minDist.get(0, 0))).set_right(last_bar_time)
// @function calculateTimeDifference
// @param timestamp1 The starting timestamp for time difference calculation.
// @param timestamp2 The ending timestamp for time difference calculation.
// @returns A tuple containing hours and minutes as integers.
// @description Calculates the time difference between two timestamps, outputting hours and minutes.
//calculateTimeDifference(timestamp1, timestamp2) =>
// timeDifference = timestamp2 - timestamp1
// hours = math.floor(timeDifference / 3600000)
// minutes = math.floor((timeDifference % 3600000) / 60000)
//
//dayAdjustment = (hour(timenow, "America/New_York") < 2) ? dayofmonth(timenow) + 1 : dayofmonth(timenow)
//dayAdjustment2 = nyHour >= 20 or nyHour < 2 ? dayofmonth(timenow) + 1 : dayofmonth(timenow)
// @function timeIsInRange
// @param startHour The start hour of the time range.
// @param startMinute The start minute of the time range.
// @param endHour The end hour of the time range.
// @param endMinute The end minute of the time range.
// @returns Boolean indicating if the current time is within the specified range.
// @description Checks if the current time falls within a specified range based on New York timezone.
//timeIsInRange(startHour, startMinute, endHour, endMinute) =>
// (nyHour > startHour or (nyHour == startHour and nyMinute >= startMinute)) and (nyHour < endHour or (nyHour == endHour and nyMinute <= endMinute))
// = switch
// timeIsInRange(9, 30, 16, 0) =>
// timeIsInRange(20, 0, 2 , 0) =>
// timeIsInRange(3, 0, 11, 30) =>
// =>
// = calculateTimeDifference(timenow, timetilchange)
//timetilchange2 = switch
// timeIsInRange(9, 30, 16, 0) => timestamp("America/New_York", year(timenow), month(timenow), dayofmonth(timenow), 20, 0, 0)
// timeIsInRange(20, 0, 2 , 0) => timestamp("America/New_York", year(timenow), month(timenow), dayofmonth(timenow), 3, 0, 0)
// timeIsInRange(3, 0, 11, 30) => timestamp("America/New_York", year(timenow), month(timenow), dayofmonth(timenow), 9, 30, 0)
// => na
//if na(timetilchange2)
// timetilchange2 := switch
// nyHour < 9 or (nyHour == 9 and nyMinute < 30) => timestamp("America/New_York", year(timenow), month(timenow), dayofmonth(timenow), 9, 30, 0)
// nyHour < 20 or (nyHour >= 16 and nyHour < 20) => timestamp("America/New_York", year(timenow), month(timenow), dayofmonth(timenow), 20, 0, 0)
// nyHour < 3 or (nyHour >= 2 and nyHour < 3) => timestamp("America/New_York", year(timenow), month(timenow), dayofmonth(timenow), 3, 0, 0)
// => na
// = calculateTimeDifference(timenow, timetilchange2)
//method getActivity(array id, float id2) =>
// if id.size() > 0
// volPerc1 = id.percentile_nearest_rank(10)
// volPerc2 = id.percentile_nearest_rank(33)
// volPerc3 = id.percentile_nearest_rank(50)
// volPerc4 = id.percentile_nearest_rank(66)
// volPerc5 = id.percentile_nearest_rank(90)
// log.warning(str.tostring(volPerc1) + " " + str.tostring(volPerc2) + " " + str.tostring(volPerc3) + " " + str.tostring(volPerc4) + " " + str.tostring(volPerc5))
// activity = switch
// id2 <= volPerc1 => "Very Low"
// id2 <= volPerc2 => "Low"
// id2 <= volPerc3 => "Average"
// id2 <= volPerc4 => "High"
// => "Very High"
// activity
//if barstate.islast
// hr4Act = vol4hrArr.getActivity(vol4hr)
// D1Act = vol1DArr .getActivity(vol1D)
// str = str.tostring(timetilchange)
// ch = str.substring(str, str.pos(str, ".") + 1, str.length(str))
// nu = str.tonumber(ch) * 6
// nu2 = str.substring(str.tostring(nu), 0, 2)
// table.cell(tab2, 0, 2, text = "Session:" , text_color = color.white, text_halign = text.align_left)
// table.cell(tab2, 0, 3, text = "Session Close:" , text_color = color.white, text_halign = text.align_left)
// table.cell(tab2, 0, 4, text = "Next Session:" , text_color = color.white, text_halign = text.align_left)
// table.cell(tab2, 0, 5, text = "Next Session Open:" , text_color = color.white, text_halign = text.align_left)
// table.cell(tab2, 0, 6, text = "4-Hr Volume:" , text_color = color.white, text_halign = text.align_left)
// table.cell(tab2, 0, 7, text = "24-Hr Volume:" , text_color = color.white, text_halign = text.align_left)
// table.cell(tab2, 1, 2, text = stringCol , text_color = color.white)
// table.cell(tab2, 1, 3, text = stringCol != "Dead Zone" ? str.tostring(hours)+ "h" + str.tostring(minutes) + "m": "Dead Zone", text_color = color.white)
// table.cell(tab2, 1, 4, text =stringCol2, text_color = color.white)
// table.cell(tab2, 1, 5, text = str.tostring(hours2) + "h:" + str.tostring(minutes2) + "m", text_color = color.white)
// table.cell(tab2, 1, 6, text = hr4Act, text_color = color.white)
// table.cell(tab2, 1, 7, text = D1Act, text_color = color.white)
nyHour2 = hour (time, "America/New_York")
nyMinute2 = minute(time, "America/New_York")
// @function timeIsInRange2
// @param startHour The starting hour for checking the time range.
// @param startMinute The starting minute within the hour.
// @param endHour The ending hour for checking the time range.
// @param endMinute The ending minute within the hour.
// @returns Boolean indicating if the current time is within the specified range.
// @description Checks if the current chart time falls within a specified time range.
timeIsInRange2(startHour, startMinute, endHour, endMinute) =>
if endHour >= startHour
(nyHour2 > startHour or (nyHour2 == startHour and nyMinute2 >= startMinute)) and
(nyHour2 < endHour or (nyHour2 == endHour and nyMinute2 <= endMinute))
else
(nyHour2 > startHour or (nyHour2 == startHour and nyMinute2 >= startMinute)) or
(nyHour2 < endHour or (nyHour2 == endHour and nyMinute2 <= endMinute))
nyCol = input.color(defval = #f24968, title = "NY Color")
asCol = input.color(defval = #14D990, title = "Asia Color")
loCol = input.color(defval = #F2B807, title = "London Color")
tra = input.int(defval = 98, minval = 0, maxval = 100, title = "Transparency")
bgcolor(timeIsInRange2(9, 30, 16, 0) ? color.new(nyCol, tra) : na)
bgcolor(timeIsInRange2(20, 0, 2 , 0) ? color.new(asCol, tra) : na)
bgcolor(timeIsInRange2(3, 0, 11, 30) ? color.new(loCol, tra) : na)
//---------------------------------------Entry/Exit-------------------------------------------------------
// "Entry/Exit signal"
Entry_exit_ena = input.bool(defval = true, title = "Entry/Exit Signal" ,group = "Entry/exit Signal")
a = input.float(1.5, title="Key Value. 'This changes the sensitivity'", group = "Entry/exit Signal")
c = input.int(7, title="ATR Period", group = "Entry/exit Signal")
ma_length = input.int(50, minval=1, title="Période de la Moyenne Mobile", group = "Entry/exit Signal")
Trail_Stop_ENA = input.bool(defval = true, title = "Trail Stop" ,group = "Entry/exit Signal")
Trail_stop_col = input.color(title = "Trailing stop color", defval = color.yellow, group = "Entry/exit Signal")
//if Entry_exit_ena
// Paramètres de la Moyenne Mobile (Filtre de Tendance)
// Calculs de base
xATR = ta.atr(c)
nLoss = a * xATR
src = close
// Calcul de l'UT BOT Trailing Stop
var float xATRTrailingStop = 0.0
xATRTrailingStop := if src > nz(xATRTrailingStop ) and src > nz(xATRTrailingStop )
math.max(nz(xATRTrailingStop ), src - nLoss)
else if src < nz(xATRTrailingStop ) and src < nz(xATRTrailingStop )
math.min(nz(xATRTrailingStop ), src + nLoss)
else if src > nz(xATRTrailingStop )
src - nLoss
else
src + nLoss
// Calcul de la Moyenne Mobile
ma = ta.ema(close, ma_length)
// Condition de tendance
is_uptrend = close > ma
is_downtrend = close < ma
// Signaux d'achat et de vente selon le trend
buy = ta.crossover(src, xATRTrailingStop) and is_uptrend
sell = ta.crossunder(src, xATRTrailingStop) and is_downtrend
// Tracé de l'UT BOT Trailing Stop
plot(Trail_Stop_ENA ? xATRTrailingStop : na, color=buy ? color.green : sell ? color.red : Trail_stop_col, linewidth=2, title="Trailing Stop Style")
// Indication des signaux sur le graphique
if buy and Entry_exit_ena
label.new(bar_index, low, text='Buy', style=label.style_label_up, yloc=yloc.belowbar ,color=color.green, textcolor=color.white, size=size.small)
if sell and Entry_exit_ena
label.new(bar_index, high, text='Sell', style=label.style_label_down, yloc=yloc.abovebar, color=color.red, textcolor=color.white, size=size.small)
alertcondition(buy, "Buy/Long", "Buy Long")
alertcondition(sell, "Sell/Short", "Sell/Short")
// ----------------------------------------Trend table-----------------------------------------------
// Paramètres utilisateur
afficher_tableau = input.bool(true, "Afficher le tableau", group="Trend Table")
periode_ema = input.int(200, minval=1, title="Période EMA pour les tendances", group="Trend Table")
periode_ema_btc = input.int(200, minval=1, title="Période EMA pour la tendance BTC", group="Trend Table")
// Configuration des périodes de tendance avec un menu déroulant lisible
periode1 = input.string("15m", "Période de tendance 1", options= , group="Trend Table")
periode2 = input.string("1h", "Période de tendance 2", options= , group="Trend Table")
periode3 = input.string("4h", "Période de tendance 3", options= , group="Trend Table")
periode4 = input.string("Day", "Période de tendance 4", options= , group="Trend Table")
// Période de tendance pour le BTC
btc_periode_tendance = input.string("4h", "Période de tendance BTC", options= , group="Trend Table")
// Couleurs pour les tendances
color_haussier = color.green
color_baissier = color.red
// Couleurs de fond alternées pour les lignes (définies globalement)
bg_color_odd = color.new(color.gray, 90) // Gris très clair pour les lignes impaires
bg_color_even = color.new(color.gray, 70) // Gris clair pour les lignes paires
// Fonction de mapping des périodes lisibles en valeurs temporelles standard
f_mapper_periode(timeframe_lisible) =>
switch timeframe_lisible
"5m" => "5"
"15m" => "15"
"1h" => "60"
"4h" => "240"
"8h" => "480"
"12h" => "720"
"Day" => "D"
=> timeframe_lisible // Cas par défaut si aucune correspondance n'est trouvée
// Mapper les périodes sélectionnées
periode1_mapped = f_mapper_periode(periode1)
periode2_mapped = f_mapper_periode(periode2)
periode3_mapped = f_mapper_periode(periode3)
periode4_mapped = f_mapper_periode(periode4)
btc_periode_tendance_mapped = f_mapper_periode(btc_periode_tendance)
// Fonction pour déterminer la session actuelle en utilisant l'heure du graphique (UTC-5)
f_session_actuelle() =>
heure = hour(time)
minute_ = minute(time)
heure_mod = heure * 60 + minute_
sessions_actives = ""
// Définir les plages horaires des sessions en UTC-5
// Session Asie (19:00 - 04:00)
if (heure_mod >= (19 * 60) or heure_mod < (4 * 60))
sessions_actives := sessions_actives + "Asie, "
// Session Londres (03:00 - 12:00)
if (heure_mod >= (3 * 60) and heure_mod < (12 * 60))
sessions_actives := sessions_actives + "Londres, "
// Session New York (08:00 - 17:00)
if (heure_mod >= (8 * 60) and heure_mod < (17 * 60))
sessions_actives := sessions_actives + "NY, "
// Nettoyer la chaîne de caractères pour enlever la virgule finale
if (str.endswith(sessions_actives, ", "))
sessions_actives := str.substring(sessions_actives, 0, str.length(sessions_actives) - 2)
// Si aucune session n'est active
sessions_actives := sessions_actives == "" ? "Hors session" : sessions_actives
sessions_actives
session_actuelle = f_session_actuelle()
// Fonction pour calculer la tendance basée sur l'EMA sans lookahead
f_tendance(symbole, timeframe_tendance, periode_ema) =>
= request.security(symbole, timeframe_tendance, , barmerge.gaps_off, barmerge.lookahead_off)
tendance = cours > ema_valeur ? "Haussier" : "Baissier"
tendance
// Calcul de la tendance du BTC
tendance_btc = f_tendance("BINANCE:BTCUSDT", btc_periode_tendance_mapped, periode_ema_btc)
// Calcul des tendances pour les périodes spécifiées
tendance_periode1 = f_tendance(syminfo.tickerid, periode1_mapped, periode_ema)
tendance_periode2 = f_tendance(syminfo.tickerid, periode2_mapped, periode_ema)
tendance_periode3 = f_tendance(syminfo.tickerid, periode3_mapped, periode_ema)
tendance_periode4 = f_tendance(syminfo.tickerid, periode4_mapped, periode_ema)
// Fonction pour obtenir le nom du ticker actuel
f_ticker_actuel() =>
syminfo.ticker
// Obtenir le ticker actuel
ticker_actuel = f_ticker_actuel()
// Affichage du tableau
if afficher_tableau
// Création du tableau
var table mon_tableau = table.new(position=position.top_right, columns=2, rows=7, bgcolor=color.new(color.black, 0), frame_color=color.new(color.gray, 0), frame_width=1)
if barstate.isfirst
// Première colonne (libellés)
table.cell(table_id=mon_tableau, row=0, column=0, text="Session actuelle:", text_color=color.white, bgcolor=bg_color_even)
table.cell(table_id=mon_tableau, row=1, column=0, text="Tendance:", text_color=color.white, bgcolor=bg_color_odd, text_halign=text.align_right)
table.cell(table_id=mon_tableau, row=6, column=0, text="BTC (" + btc_periode_tendance + "):", text_color=color.white, text_halign=text.align_right, bgcolor=bg_color_even)
table.cell(table_id=mon_tableau, row=2, column=0, text= ticker_actuel + " (" + periode1 + "):", text_color=color.white, bgcolor=bg_color_odd)
table.cell(table_id=mon_tableau, row=3, column=0, text="(" + periode2 + "):", text_color=color.white, text_halign=text.align_right, bgcolor=bg_color_even)
table.cell(table_id=mon_tableau, row=4, column=0, text="(" + periode3 + "):", text_color=color.white, text_halign=text.align_right, bgcolor=bg_color_odd)
table.cell(table_id=mon_tableau, row=5, column=0, text="(" + periode4 + "):", text_color=color.white, text_halign=text.align_right, bgcolor=bg_color_even)
// Définir les couleurs de fond pour les cellules de tendance
trend_btc_color = tendance_btc == "Haussier" ? color.green : color.red
trend_periode1_color = tendance_periode1 == "Haussier" ? color.green : color.red
trend_periode2_color = tendance_periode2 == "Haussier" ? color.green : color.red
trend_periode3_color = tendance_periode3 == "Haussier" ? color.green : color.red
trend_periode4_color = tendance_periode4 == "Haussier" ? color.green : color.red
// Mise à jour des valeurs avec les couleurs appropriées
table.cell(table_id=mon_tableau, row=0, column=1, text=session_actuelle, text_color=color.yellow, bgcolor=bg_color_even)
table.cell(table_id=mon_tableau, row=1, column=1, text="", bgcolor=bg_color_odd)
table.cell(table_id=mon_tableau, row=6, column=1, text=tendance_btc, text_color=color.white, bgcolor=trend_btc_color)
table.cell(table_id=mon_tableau, row=2, column=1, text=tendance_periode1, text_color=color.white, bgcolor=trend_periode1_color)
table.cell(table_id=mon_tableau, row=3, column=1, text=tendance_periode2, text_color=color.white, bgcolor=trend_periode2_color)
table.cell(table_id=mon_tableau, row=4, column=1, text=tendance_periode3, text_color=color.white, bgcolor=trend_periode3_color)
table.cell(table_id=mon_tableau, row=5, column=1, text=tendance_periode4, text_color=color.white, bgcolor=trend_periode4_color)
// Optionnel : Ajouter une étiquette de débogage pour vérifier la session actuelle
// label.new(bar_index, high, text="Session: " + session_actuelle, style=label.style_label_down, color=color.blue, textcolor=color.white, size=size.small, yloc=yloc.abovebar)
HTF 4-Candle ViewerFractal Model for TTrades and Kane. This indicator allows you to see the previous 3 candles on a HTF aswell as the current one forming.
📈 Market Regime Detection – 🚀Breakout/down w/ ADX & EMA Filter 📈 Market Regime Detection – 🚀Breakout/down w/ ADX & EMA Filter
By: alphainvestor123
This indicator helps you visually detect whether the market is in a trending or mean-reverting regime by combining:
🔍 Core Logic:
Breakouts: Price exceeds recent highs (or lows), suggesting trending behavior.
EMA Filter: Confirms bullish or bearish bias based on price vs. EMA.
VHF (Vertical Horizontal Filter): Measures the trend strength.
VHF value is multiplied by 1000 in the event you wish to display it onto your CRYPTOCAP:BTC or Crypto chart, it will be visible on your chart, no need to scroll down to see.
VHF ≥ 3333 = Trending Regime
VHF ≤ 3333 = Mean-Reverting / Rangebound
🧪 Key Features:
🔵 Plot of recent high/low breakout levels.
🟢 Background highlights breakout signals (trending market).
🔴 Optional background for breakdown signals (non-trending market).
📉 Optional VHF and EMA plots for further confirmation.
🎛️ Adjustable inputs to control signal sensitivity and chart visuals.
⚙️ Inputs:
Lookback Periods for breakout/breakdown
EMA Length and Line Thickness
Toggle VHF/EMA/Signal Display
Custom Colors for bullish/bearish trends
🧠 Ideal Use Cases:
Determining market regime before choosing a strategy
Filtering for momentum/trend continuation setups
Avoiding false signals in mean-reverting conditions
*Best used on 1D chart as seen on the sample display, I find this most useful for detecting long term trend breakouts/breakdowns and mean reverting regimes.
*to clarify:
breakouts/trend regimes can only be marked if:
1. Candle has the highest high out of the last 40 bars (default indicator setting, can be customized by user)
2. EMA on the desired asset is bullish
3. ADX is >= a value of 3,333
Visa versa logic for breakdowns/mean reverting regime detection.
nik private indicatorlol eqx go brrr, this indicator helps mark out equal highs and lows, while alerting you, allowing for you to trade without watching the charts all session.
EMA Technical Analysis with Reversal ZonesKey Features:
1. EMA Analysis:
• Plots multiple EMAs: 5, 9, 13, 21, 50.
• Highlights bullish/bearish crossovers:
• EMA 5/13 crossover
• EMA 9/21 crossover
• Crossovers are marked with colored circles on the chart.
2. VWAP (Volume-Weighted Average Price):
• Custom color changes based on price relation:
• Green if above
• Red if below
3. MACD:
• Customizable MACD settings.
• Evaluates both signal line crossover and MACD > 0 condition.
• Displayed in the table for quick trend strength checks.
4. PSAR (Parabolic SAR):
• Plotted as dots with color change based on price relation.
5. RSI & Bollinger Bands:
• RSI helps gauge momentum.
• Bollinger Bands mark overbought/oversold extremes.
• Close proximity to upper/lower bands is highlighted with custom logic.
6. ADX (Trend Strength):
• Assesses whether the market is trending strongly.
• Indicates bullish or bearish strength with arrows or dots in the table.
7. SPX/VIX Market Sentiment Integration:
• Uses SPX (S&P 500) and VIX data for additional context.
• Custom coloring for fear/greed scenarios.
8. Dynamic Status Table:
• Located at a user-defined screen position.
• Displays real-time conditions for all indicators.
• Uses colored dots/arrows for quick scanning.
9. Reversal Zones:
• Uses Bollinger Bands + RSI to define:
• Oversold (Red Background)
• Overbought (Green Background) zones
10. Confirmation Zones:
• Combines EMA and MACD crossovers for:
• Bullish confirmation (Green Background)
• Bearish confirmation (Red Background)
11. Alerts:
• Built-in alerts for:
• EMA crossovers
• Deep overbought/oversold
• Confirmation signals
M2SL/DXY vs CryptoJust a test.With this indicator, we will be able to predict the trends of economic cycles and cash flow within the market.
Umair SuperchartThis indicator combines traditional pivot point analysis with volume surge detection to provide comprehensive trading signals. Here are its key features:
Main Components:
1. Daily Pivot Points (PP, R1-R3, S1-S3)
- Automatically calculates and displays pivot levels
- Color-coded lines (Red for Resistance, Blue for Pivot, Green for Support)
- Movable information box showing all levels
- Works across all timeframes
2. Volume Surge Detection
- Monitors volume increases above 20-period average
- Shows small triangles for immediate volume surges
• Green triangle below bar for bullish volume
• Red triangle above bar for bearish volume
3. Strong Buy/Sell Signals
- Tracks sustained volume surges (default 10 minutes)
- Displays blinking "STRONG BUY!" or "STRONG SELL!" messages
- Provides alerts for sustained momentum
Customizable Features:
- Adjustable volume surge threshold
- Customizable sustained period duration
- Movable pivot level display box
- Adjustable line widths and colors
- Flexible position settings
Alerts:
- Price breaks above R1/below S1
- Immediate volume surges
- Sustained bullish/bearish volume movements
Perfect for:
- Day traders monitoring volume-price relationship
- Swing traders using pivot points for support/resistance
- Technical analysts requiring multiple confirmation signals
Price-Based Strategybasic strategy to help struggling traders improve. Wait for 1 min candle to close above or below line then enter the trade
Pullback 61% + EMA + Pivot Auto + FiltrosBuscador de entrada en base a retrocesos, con filtrador de EMA al 50
Mongoose Capital: FlowWave + Conviction Strip🟩 Indicator Name
Mongoose Capital: FlowWave + Conviction Strip
📜 Short Description
Smoothed Money Flow Oscillator with conviction scoring columns to assess flow strength.
🧠 Description (Long Form)
The Mongoose Capital: FlowWave + Conviction Strip is a refined visualization of money flow dynamics designed to identify shifts in volume pressure and trend strength.
This dual-panel indicator includes:
• FlowWave Line — A smoothed momentum curve built from normalized money flow data, filtered through dual EMAs. Green (positive) and purple (negative) segments help traders quickly assess bias shifts.
• Conviction Score Columns — A histogram below the zero line shows strength of flow deltas (momentum of volume pressure). Green/red bars appear when strength exceeds a critical threshold, while gray bars indicate low conviction.
• Background Zone Coloring — Optional dark red/green gradient to enhance visibility of positive/negative phases.
✅ Designed for traders who value clarity and minimal noise
✅ Pairs well with macro trend filters or breakout strategies
✅ Built and published by Mongoose Capital
🔧 Default Settings
Money Flow Length: 14
Signal Cooldown: 5 bars
Source: HLC3
EMA Wave Filter: 3
Strength Threshold: 20
🧪 Suggested Use
Confirm entries/exits in trend continuation setups
Identify divergences between price and money flow
Filter low-conviction trades using the histogram's gray zone
Spot early accumulation or distribution through wave crossovers
📢 Author
Published by: TheRealMongoose
Powered by: Mongoose Capital
Feel free to tag us in your setups.
EMA (25, 50, 100)Three EMA (25, 50, 100) with three color (red, orange and yellow) with tre different line widht.