Indikatoren und Strategien
COTE 1composite scan of bist stocks
You can set the condition in the screening code as you wish according to the data defined in the code.
Lambo: Custom MACD Buy/Sell StrategyMy script is generating sell and buy signals based on MACD slope changes.
But it is not only using that, it is using a custom strategy that generates a safe signal.
And it shows the TP area and SL area as well.
I believe this one will help many traders.
This script is for the XAU/USD 5min chart.
You may use this script on other charts and timeframes.
But script code is best suitable for XAU/USD 5min.
Any questions, ping me.
Thanks
Anchored Darvas Box## ANCHORED DARVAS BOX
---
### OVERVIEW
**Anchored Darvas Box** lets you drop a single timestamp on your chart and build a Darvas-style consolidation zone forward from that exact candle. The indicator freezes the first user-defined number of bars to establish the range, verifies that price respects that range for another user-defined number of bars, then waits for the first decisive breakout. The resulting rectangle captures every tick of the accumulation phase and the exact moment of expansion—no manual drawing, complete timestamp precision.
---
### HISTORICAL BACKGROUND
Nicolas Darvas’s 1950s box theory tracked institutional accumulation by hand-drawing rectangles around tight price ranges. A trade was triggered only when price escaped the rectangle.
The anchored version preserves Darvas’s logic but pins the entire sequence to a user-chosen candle: perfect for analysing a market open, an earnings release, FOMC minute, or any other catalytic bar.
---
### ALGORITHM DETAIL
1. **ANCHOR BAR**
*You provide a timestamp via the settings panel.* The script waits until the chart reaches that bar and records its index as **startBar**.
2. **RANGE DEFINITION — BARS 1-7**
• `rangeHigh` = highest high of bars 1-7 plus optional tolerance.
• `rangeLow` = lowest low of bars 1-7 minus optional tolerance.
3. **RANGE VALIDATION — BARS 8-14**
• Price must stay inside ` `.
• Any violation aborts the test; no box is created.
4. **ARMED STATE**
• If bars 8-14 hold the range, two live guide-lines appear:
– **Green** at `rangeHigh`
– **Red** at `rangeLow`
• The script is now “armed,” waiting indefinitely for the first true breakout.
5. **BREAKOUT & BOX CREATION**
• **Up breakout** =`high > rangeHigh` → rectangle drawn in **green**.
• **Down breakout**=`low < rangeLow` → rectangle drawn in **red**.
• Box extends from **startBar** to the breakout bar and never updates again.
• Optional labels print the dollar and percentage height of the box at its left edge.
6. **OPTIONAL COOLDOWN**
• After the box is painted the script can stay silent for a user-defined number of bars, letting you study the fallout without another range immediately arming on top of it.
---
### INPUT PARAMETERS
• **ANCHOR TIME** – Precise yyyy-mm-dd HH:MM:SS that seeds the sequence.
• **BARS TO DEFINE RANGE** – Default 7; affects both definition and validation windows.
• **OPTIONAL TOLERANCE** – Absolute price buffer to ignore micro-wicks.
• **COOLDOWN BARS AFTER BREAKOUT** – Pause length before the indicator is allowed to re-anchor (set to zero to disable).
• **SHOW BOX DISTANCE LABELS** – Toggle to print Δ\$ and Δ% on every completed box.
---
### USER WORKFLOW
1. Add the indicator, open settings, and set **ANCHOR TIME** to the candle you care about (e.g., “2025-04-23 09:30:00” for NYSE open).
2. Watch live as the script:
– Paints the seven-bar range.
– Draws validation lines.
– Locks in the box on breakout.
3. Use the box boundaries as structural stops, targets, or context for further trades.
---
### PRACTICAL APPLICATIONS
• **OPENING RANGE BREAKOUTS** – Anchor at the first second of the session; capture the initial 7-bar range and trade the first clean break.
• **EVENT STUDIES** – Anchor at a news candle to measure immediate post-event volatility.
• **VOLUME PROFILE FUSION** – Combine the anchored box with VPVR to see if the breakout occurs at a high-volume node or a low-liquidity pocket.
• **RISK DISCIPLINE** – Stop-loss can sit just inside the opposite edge of the anchored range, enforcing objective risk.
---
### ADVANCED CUSTOMISATION IDEAS
• **MULTIPLE ANCHORS** – Clone the indicator and anchor several boxes (e.g., London open, New York open).
• **DYNAMIC WINDOW** – Switch the 7-bar fixed length to a volatility-scaled length (ATR percentile).
• **STRATEGY WRAPPER** – Turn the indicator into a `strategy{}` script and back-test anchored boxes on decades of data.
---
### FINAL THOUGHTS
Anchored Darvas Boxes give you Darvas’s timeless range-break methodology anchored to any candle of interest—perfect for dissecting openings, economic releases, or your own bespoke “important” bars with laboratory precision.
AlphaTrend++AlphaTrend++
An advanced, fully customizable fork of Kivanc Ozbilgic’s AlphaTrend. This version enhances signal accuracy and chart clarity with:
• Original AlphaTrend signal logic including signal frequency filtering (barssince-based)
• Optional raw (unfiltered) signal mode for more frequent entries
• Dynamic stop loss tick labels based on AlphaTrend levels and user-defined tick size
• Optional time window filter for intraday signal control
• Clean dual-layer trend cloud with color-coded momentum direction
Ideal for discretionary or system traders looking to combine visual structure with robust signal logic.
MAD Trend Detector ~ C H I P AMAD Trend Detector ~ C H I P A is a custom trend detection tool designed to identify meaningful price deviations using Median Absolute Deviation (MAD) logic layered over a smoothed price baseline.
It uses:
A user-selectable source (Close, High, Low, etc.)
A configurable EMA or SMA as the core smoothing layer
Median Absolute Deviation (MAD) to measure typical price dispersion
A user-adjustable MAD multiplier to fine-tune trend sensitivity
Trend bands that expand dynamically based on local volatility
This setup highlights breakout conditions when price detaches meaningfully from its typical behavior — helping traders detect trend acceleration, volatility breakouts, and directional shifts with minimal lag and reduced noise.
Candle coloring responds directly to trend status, with electric blue and red visuals for clear on-chart recognition.
ONE RING SlimJust 3 nested envelopes tied together with a factor to size them together. You can have them based on various MAs and the envelopes based on % or on a volatility setup I came up with. You can highlight crosses of outside bands and/or midpoints. Mid lines can be colored based on slope. You can shade in various ways. You can highlight freak volume bars, and ranges also. Have basic options for highlight of session and lunch. Have fun.
higher timeframe candle rangecreates a range around the selected timeframe in minutes (other than D/W/M)
use wherever deemed strong
EMA Trend Pro: Dynamic Clouds & ColorsEMA Trend Pro is your ultimate trend companion, built for traders who want clarity, precision, and confidence in their entries.
This script fuses dynamic EMA cloud zones with breakout and pullback signals — giving you real-time insights into market structure and momentum. Whether you're trading crypto, forex, stocks, or futures, EMA Trend Pro adapts to your style.
🔧 Key Features:
✅ EMA Stack Clouds with Folding Sensitivity (9/21/48/200)
✅ Bullish / Bearish trend labels with real-time dashboard
✅ Volume strength analysis (High, Normal, Low)
✅ Breakout signal alerts (momentum-based)
✅ Pullback signal alerts (trend resumption)
✅ Fully customizable: EMA lengths, signal visibility, cloud opacity
✅ Works across all assets and timeframes
🛠️ Designed for scalping, swing trading, and intraday setups.
🔔 Built-in alerts make automation seamless — no guesswork.
💡 Usage Tips:
Use clouds and trend labels to identify structure and bias
Trade breakouts when EMAs align and volume confirms
Look for pullbacks into the EMA zone and enter on resumption
📅 Market Hours Filter: Keeps signals relevant during core trading hours (9:30 AM–4 PM ET).
👤 Developed by @glapougbaegarmondeh
🧠 Version 1.0 | 📆 Released: April 24, 2025
The LBF modelThe LBF Model is a structural pattern detector that highlights potential reversal zones using a specific sequence of pivot points. It identifies both bearish (LL → LH → LL → HH → LH) and bullish (HH → HL → HH → LL → HL) formations, marking moments where price shows signs of exhaustion and directional shift.
Built purely on price action, the LBF Model avoids indicators and focuses on clean structure. It draws patterns directly on the chart, with customizable sensitivity and colors. Whether used on its own or with other tools, it helps traders spot key turning points with clarity and precision.
Auto Trend Channel + Buy/Sell AlertsThis indicator automatically detects trend channels using a linear regression line, and dynamically plots upper and lower channel boundaries based on standard deviation. It helps traders identify potential Buy and Sell zones with clear visual signals and customizable alerts.
💡 How It Works:
🧠 Regression-Based Channel: Calculates the central trend line using ta.linreg() over a user-defined length.
📏 Dynamic Boundaries: Upper and lower channel lines are offset by a multiplier of the standard deviation for precision volatility tracking.
✅ Buy Signals: Triggered when price crosses above the lower boundary — potential bounce entry.
❌ Sell Signals: Triggered when price crosses below the upper boundary — potential reversal exit.
🔔 Alerts Enabled: Get real-time alerts when price touches the channel lines.
VWAP Bands with Price LineThis indicator plots the VWAP (Volume Weighted Average Price) line along with standard deviation bands (±1σ, ±2σ, ±3σ). It includes two modes:
-Timeframe-based VWAP reset
-Dynamic reset whenever the price touches ±1σ band
It also plots the actual price line over time to compare with the VWAP bands.
Standard Deviation Bands
Bands are calculated like Bollinger Bands but centered on VWAP:
+1σ / -1σ = VWAP ± 1 * std deviation
+2σ / -2σ = VWAP ± 2 * std deviation
+3σ / -3σ = VWAP ± 3 * std deviation
These act as dynamic support/resistance zones.
Dynamic Reset (Touch of ±1σ Band)
If selected:
-VWAP and its bands reset every time price touches either +1σ or -1σ.
-This makes the bands more reactive and useful for identifying short-term mean reversions or breakouts.
How to Read It
VWAP Line (gray): Acts like a gravity center — price tends to revert to it.
±1σ Band (blue): Normal trading range.
±2σ Band (green): Overbought/oversold territory — potential reversals.
±3σ Band (red): Extreme move — often unsustainable without strong trend/volume.
Trading Ideas:
Signal Interpretation
-Price touches ±2σ or ±3σ Consider mean reversion if volume is low
-Price breaks ±1σ and stays Possible trend confirmation
there with volume.
-Switch to dynamic reset Helps in scalping or range trading
mode.
-Price hovers near VWAP No strong trend, avoid breakout trades
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)
BTC Aggregated Spot Volume ProfileThis script creates a volume profile indicator using aggregated BTC spot volume across major crypto exchanges. It visualizes where trading activity is concentrated in a given price range, highlights the Point of Control (POC), and defines the Value Area, helping traders identify key support and resistance zones.
1. Exchange Aggregation: Pulls BTC spot volume from 9 major exchanges:
Binance, Coinbase, Kraken, Bitfinex, Bitstamp, KuCoin, Gate.io, OKX, Huobi.
2. Customizable Inputs:
Number of Bars: Historical bars to analyze (default: 150).
Row Size: Number of price bins (volume profile rows).
Value Area Volume %: Percentage of total volume to include in the Value Area (default: 70%).
Styling options for volume bars and the POC line.
Ideal for traders who want to:
See where the most BTC spot trading volume occurred in a given range.
Identify high-interest price zones.
Use volume-at-price analysis for smarter entries/exits.
Signals2TradeSignals2Trade is a powerful indicator that combines a daily one-trade strategy with smart money liquidity zones. It automatically detects the first breakout of the day, sets entry, stop-loss, and take-profit based on your desired risk-reward ratio, and visually marks entry and exit points. Additionally, it identifies key supply and demand areas using pivot levels and highlights them as dynamic smart money blocks on the chart. Ideal for day traders, SMC traders, and anyone looking for structured setups without spending hours on analysis.
Auto Darvas Boxes## AUTO DARVAS BOXES
---
### OVERVIEW
**Auto Darvas Boxes** is a fully-automated, event-driven implementation of Nicolas Darvas’s 1950s box methodology.
The script tracks consolidation zones in real time, verifies that price truly “respects” those zones for a fixed validation window, then waits for the first decisive range violation to mark a directional breakout.
Every box is plotted end-to-end—from the first candle of the sideways range to the exact candle that ruptures it—giving you an on-chart, visually precise record of accumulation or distribution and the expansion that follows.
---
### HISTORICAL BACKGROUND
* Nicolas Darvas was a professional ballroom dancer who traded U.S. equities by telegram while touring the world.
* Without live news or Level II, he relied exclusively on **price** to infer institutional intent.
* His core insight: true market-moving entities leave footprints in the form of tight ranges; once their buying (or selling) is complete, price erupts out of the “box.”
* Darvas’s original procedure was manual—he kept notebooks, drew rectangles around highs and lows, and entered only when price punched out of the roof of a valid box.
* This indicator distills that logic into a rolling, self-resetting state machine so you never miss a box or breakout on any timeframe.
---
### ALGORITHM DETAIL (FOUR-STATE MACHINE)
**STATE 0 – RANGE DEFINITION**
• Examine the last *N* candles (default 7).
• Record `rangeHigh = highest(high, N) + tolerance`.
• Record `rangeLow = lowest(low, N) – tolerance`.
• Remember the index of the earliest bar in this window (`startBar`).
• Immediately transition to STATE 1.
**STATE 1 – RANGE VALIDATION**
• Observe the next *N* candles (again default 7).
• If **any** candle prints `high > rangeHigh` or `low < rangeLow`, the validation fails and the engine resets to STATE 0 **beginning at the violating candle**—no halfway boxes, no overlap.
• If all *N* candles remain inside the range, the box becomes **armed** and we transition to STATE 2.
**STATE 2 – ARMED (LIVE VISUAL FEEDBACK)**
• Draw a **green horizontal line** at `rangeHigh`.
• Draw a **red horizontal line** at `rangeLow`.
• Lines are extended in real time so the user can see the “live” Darvas ceiling and floor.
• Engine waits indefinitely for a breakout candle:
– **Up-Breakout** if `high > rangeHigh`.
– **Down-Breakout** if `low < rangeLow`.
**STATE 3 – BREAKOUT & COOLDOWN**
• Upon breakout the script:
1. Deletes the live range lines.
2. Draws a **filled rectangle (box)** from `startBar` to the breakout bar.
◦ **Green fill** when price exits above the ceiling.
◦ **Red fill** when price exits below the floor.
3. Optionally prints two labels at the left edge of the box:
◦ Dollar distance = `rangeHigh − rangeLow`.
◦ Percentage distance = `(rangeHigh − rangeLow) / rangeLow × 100 %`.
• After painting, the script waits a **user-defined cooldown** (default = 7 bars) before reverting to STATE 0. The cooldown guarantees separation between consecutive tests and prevents overlapping rectangles.
---
### INPUT PARAMETERS (ALL ADJUSTABLE FROM THE SETTINGS PANEL)
* **BARS TO DEFINE RANGE** – Number of candles used for both the definition and validation windows. Classic Darvas logic uses 7 but feel free to raise it on higher timeframes or volatile instruments.
* **OPTIONAL TOLERANCE** – Absolute price buffer added above the ceiling and below the floor. Use a small tolerance to ignore single-tick spikes or data-feed noise.
* **COOLDOWN BARS AFTER BREAKOUT** – How long the engine pauses before hunting for the next consolidation. Setting this equal to the range length produces non-overlapping, evenly spaced boxes.
* **SHOW BOX DISTANCE LABELS** – Toggle on/off. When on, each completed box displays its vertical size in both dollars and percentage, anchored at the box’s left edge.
---
### REAL-TIME VISUALISATION
* During the **armed** phase you see two extended, colour-coded guide-lines showing the exact high/low that must hold.
* When the breakout finally occurs, those lines vanish and the rectangle instantly appears, coloured to match the breakout direction.
* This immediate visual feedback turns any chart into a live Darvas tape—no manual drawing, no lag.
---
### PRACTICAL USE-CASES & BEST-PRACTICE WORKFLOWS
* **INTRADAY MOMENTUM** – Drop the script on 1- to 15-minute charts to catch tight coils before they explode. The coloured box marks the precise origin of the expansion; stops can sit just inside the opposite side of the box.
* **SWING & POSITION TRADING** – On 4-hour or daily charts, boxes often correspond to accumulation bases or volatility squeezes. Waiting for the box-validated breakout filters many false signals.
* **MEAN-REVERSION OR “FADE” STRATEGIES** – If a breakout immediately fails and price re-enters the box, you may have trapped momentum traders; fading that failure can be lucrative.
* **RISK MANAGEMENT** – Box extremes provide objective, structure-based stop levels rather than arbitrary ATR multiples.
* **BACK-TEST RESEARCH** – Because each box is plotted from first range candle to breakout candle, you can programmatically measure hold time, range height, and post-breakout expectancy for any asset.
---
### CUSTOMISATION IDEAS FOR POWER USERS
* **VOLATILITY-ADAPTIVE WINDOW** – Replace the fixed 7-bar length with a dynamic value tied to ATR percentile so the consolidation window stretches or compresses with volatility.
* **MULTI-TIMEFRAME LOGIC** – Only arm a 5-minute box if the 1-hour trend is aligned.
* **STRATEGY WRAPPER** – Convert the indicator to a full `strategy{}` script, automate entries on breakouts, and benchmark performance across assets.
* **ALERTS** – Create TradingView alerts on both up-breakout and down-breakout conditions; route them to webhook for broker automation.
---
### FINAL THOUGHTS
**Auto Darvas Boxes** packages one of the market’s oldest yet still potent price-action frameworks into a modern, self-resetting indicator. Whether you trade equities, futures, crypto, or forex, the script highlights genuine contraction-expansion sequences—Darvas’s original “boxes”—with zero manual effort, letting you focus solely on execution and risk.
EMA Ribbon Cross Multi-TF MonitorThis is not your typical moving average, this give you a great buy and sell alert alongside showing you what price is doing at the 1m and 2m charts with a monitor that updates with price.
The EMA is configurable though I recommend the 2 and 8 ema's as the best ones to catch price moving higher or lower to get an early entry.
You can configure the script to add in different times and it will work on those time frames also, like 15min and 30min so you can see the longer trend of the market.
Rally Sweep Volume RSVChecks for 3-6 consecutive candle rally, sweep of the low/high of the rally, and closes with more volume then prior candle.
NIKHIL ROY INDICATOR + Reversal Trap Entry/@version=5
indicator("NIKHIL ROY INDICATOR + Reversal Trap Entry", overlay=true)
// === SETTINGS ===
res_tf = "15"
lookback = 50
// === PREVIOUS 15min CANDLE ===
prevHigh = request.security(syminfo.tickerid, res_tf, high )
prevLow = request.security(syminfo.tickerid, res_tf, low )
prevOpen = request.security(syminfo.tickerid, res_tf, open )
prevClose = request.security(syminfo.tickerid, res_tf, close )
// Draw previous 15m candle (body and wick)
plot(prevHigh, "Prev High", color=color.gray, linewidth=1)
plot(prevLow, "Prev Low", color=color.gray, linewidth=1)
bgcolor((timeframe.isintraday and timeframe.period == "15") ? na : color.new(color.gray, 90))
// === SUPPORT & RESISTANCE ===
var float support = na
var float resistance = na
pivotLow = ta.pivotlow(low, 5, 5)
pivotHigh = ta.pivothigh(high, 5, 5)
if not na(pivotLow)
support := pivotLow
if not na(pivotHigh)
resistance := pivotHigh
plot(support, "Support", color=color.green, linewidth=2, style=plot.style_linebr)
plot(resistance, "Resistance", color=color.red, linewidth=2, style=plot.style_linebr)
// === SWING BREAK DETECTION ===
swingHighBreak = high > resistance and high <= resistance
swingLowBreak = low < support and low >= support
// === BREAKOUT FAILURE ===
breakoutFailure = swingHighBreak and close < resistance
breakdownFailure = swingLowBreak and close > support
// === RETEST AFTER WEAKNESS ===
retestSell = close < resistance and high > resistance and close < open
retestBuy = close > support and low < support and close > open
// === SIGNALS ===
// SELL on resistance retest + weakness
sellSignal = retestSell
// SELL if breakout fails
trapSell = breakoutFailure
// BUY on support retest + strength
buySignal = retestBuy
// BUY if breakdown fails
trapBuy = breakdownFailure
// === PLOT SIGNALS ===
plotshape(sellSignal, title="Sell Weakness", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.large, text="SELL")
plotshape(trapSell, title="Trap Sell", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.large, text="TRAP SELL")
plotshape(buySignal, title="Buy Strength", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.large, text="BUY")
plotshape(trapBuy, title="Trap Buy", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.large, text="TRAP BUY")
NEO Super 1The main changes include:
Added parameters from the second indicator
Expanded the MA function to support types from both indicators
Integrated moving average calculations
Added new signal logic using conditions:
MA Fast/Slow crossover 2 bars ago
Checking the close of the previous candle
Definition of the Hull Ribbon zone
Added new arrows and alerts
Kept all original visuals and alerts
All controls from both indicators are available in the script settings. You can enable/disable individual components via parameters.
[Stop!Loss] ADR Signal ADR Signal - a technical indicator located in a separate window, which displays by default the 80%-level , as well as the 100%-level of the average daily range (ADR) for the last 10 days and compares it with the current intraday range. The indicator helps not only with the use of a mathematical-statistical method to identify a potential reversal at the moment during intraday trading, but can also serves as an effective assistant in risk management.
👉 Basic mechanics of the indicator
Firstly, this indicator tracks the performance of the standard ATR indicator on the daily chart, in other words, ADR (Average Daily Range).
Important ❗️The ATR (Average True Range) indicator was created by J. Welles Wilder Jr. He first introduced ATR in his book "New Concepts in Technical Trading Systems", published in 1978. Wilder developed this indicator to measure market volatility to help traders estimate the range of price movements. This indicator is built into TradingView, more details can be found by link: www.tradingview.com
Like ATR , ADR calculates the average true range for a specified period. In this case, the distance in points from the maximum of each day to its minimum is calculated, after which the arithmetic mean is calculated - this is ADR .
👉 Visualization
ADR Signal is located in a separate window on the chart and has 3 levels:
1) "ADR level" (green line) - the same parameter, the calculations of which are briefly described above. There is 100%-level of ATR on the daily chart (ADR).
2) "Current level" (red line) - this is the current price passage within the day, calculated in points. At the start of a new day, this parameter is reset. Therefore, in the indicator window, this line has sharp drops at the start of a new trading day: "A new trading day - the instrument's power reserve is renewed again".
3) "Signal level" (blue line) - this is an individually customized value that demonstrates a certain part of the ADR parameter.
👉 Inputs
1) - is responsible for the ATR indicator period, the value of which will always be calculated on the daily chart. The default value is "10", that is, ATR is calculated for the last 10 days (not including the current one).
2) - signal level (in %). The default value is "0.8", that is, 80%-level of the ADR parameter (set earlier) is calculated.
👉 Style
1) - by default, this level is colored "blue".
2) - by default, this level is colored "red".
3) - by default, this level is colored "green".
👉 How to use this indicator
Important❗️ The two methods of the use of the ADR Signal indicator described below will be most effective when trading intraday (which is highlighted quite well below), so it is more logical to use the indicator information on time periods H1 and below.
1) Identifying potential reversals during intraday trading:
The ADR Signal indicator can be used as a potential individual reversal strategy.
Important ❗️It should be noted that using it in it without additional confirming analysis tools will be a rather aggressive trading approach. Therefore, it is best to support the entry point in particular with other methods.
In this case, the crossing of the red line (the number of points passed within the current day, that is, from the minimum of the current day to its maximum) and the blue line (color of the Signal level based on the default settings), indicates that the trading instrument has passed 80% (based on the default settings for the "Signal level") of its average distance from the maximum to the minimum over the past 10 days (based on the default settings for the "ADR Length"). Such a situation in the context of the mathematical-statistical approach indicates a probable reversal, since the "power reserve" of this instrument is mostly exhausted, so one can expect with a higher probability, at least, a price stop and possibly a reversal. In case of crossing of the red line and the green one (ADR level), it says again that based on the mathematical-statistical approach, this trading instrument has completely exhausted its intraday "power reserve". In this situation, a stop or reversal of the price will be even more likely.
Of course, using the "Signal level" parameter, one can filter out even more reliable situations for potential price reversals within a day, namely, by specifying, for example, 1.5 in the field of this parameter. Under such conditions, in the case of crossing the red and blue lines (based on the default style settings), to say that the trading instrument has passed 150% of its average distance over the last 10 days (based on the default style settings "ADR length"). In this case, the probability of a stop or reversal of the price increases even more.
2) Use in risk management:
In terms of risk management, this indicator is more applicable to open trades. For example, if one had an open Buy-position (especially if it is an intraday trade) and the price has raised significantly during the day, then the crossing of the red line with the blue line , and especially the red line with the green line , may indicate that the price will most likely stop growing, since the "power reserve" is almost or completely exhausted for this instrument within the current day. In this case, one can, at a minimum, move the trade to breakeven or even partially fix the profit.
We will continue to discuss the methods of using this indicator and strategies based on it here. And we are always waiting for your reactions and feedback on this topic 💬.
Thank you for your support 🚀
True Strength Index (TSI)This is my version of TSI which is identical to trading oracle's TSI.
The default settings are:
Short Period Length: 6
Long Period Length: 13
Signal Line Length: 9
A more general and common recommended setting:
Short Period Length: 13
Long Period Length: 25
Signal Line Length: 7
Default settings are intended for day trading - which I use to watch for divergences in price vs. TSI.
VOBNazzyATRGeared for Nasdaq micros.
Can be adjusted for other pairs.
Took the Volume Order block script and turned it into a strategy with fixed and ATR based stop loss and take profit. Adjust if you need. Fun for scalping 1 min chart.
Ive used it to some benefit. Other days its been to my detriment. Markets never the same. Use at your own discretion!
Have fun!