Candle Pattern Detector SMC with Alerts @AshokTrendJust Follow Hammer, Inverted Hammer, Hanging Man, Engulfing, volume adn smc consideration,
Trading the candlestick patterns (Hammer, Inverted Hammer, Hanging Man, Bullish/Bearish Engulfing) with volume confirmation adds an important layer of validation, helping to filter false signals and improve trade success. Here’s how to integrate volume into your strategy:
***
### How to Trade Candlestick Patterns with Volume Confirmation
#### 1. Understand Volume Role
- Volume shows the strength behind price moves:
- Higher volume on a pattern (compared to recent average) indicates strong participation, increasing the pattern’s reliability.
- Low volume may mean weak conviction and higher risk of failure.
#### 2. Volume Confirmation Rules
- Define a volume threshold, for example:
- Current candle’s volume > average volume of last 10 or 20 candles (or a fixed multiplier, e.g., 1.2× average).
- For bullish patterns (Hammer, Inverted Hammer, Bullish Engulfing): confirm with rising volume on pattern candle or next candle.
- For bearish patterns (Hanging Man, Bearish Engulfing): confirm with higher volume on pattern candle indicating strong selling.
#### 3. Entry Signals with Volume
- **Bullish Entry:**
- Signal candle (Hammer, Bullish Engulfing, etc.) appears near support or order block.
- Volume on the signal candle or immediate next candle is higher than average.
- Enter long on confirmation candle or close of signal candle.
- **Bearish Entry:**
- Signal candle (Hanging Man, Bearish Engulfing, etc.) appears near resistance or supply zone.
- Volume on the signal candle or immediate next candle exceeds average.
- Enter short on confirmation candle or close of signal candle.
#### 4. Stop Loss & Targets
- Place stop loss just below (for longs) or above (for shorts) the low/high wick of the signal candle or the order block zone.
- Set take profit based on nearby support/resistance, risk-reward ratio, or a fixed number of candle closes.
#### 5. Avoid Trading Without Volume Confirmation
- Reject candles if volume is below threshold to reduce false signals.
### Summary
Trading candlestick patterns combined with volume confirmation ensures only well-supported setups are taken, improving win rates and reducing noisy or fake signals. Volume adds a critical dimension to the SMC candle patterns for binary or any form of trading.
Would you like me to generate a full Pine Script that integrates volume confirmation with the patterns you requested?
Candlestick analysis
% Change & Range (With SMA)- Calculates the % range and change for each candle
- uses SMA over "n" bars to show the average % range and the average % change for green days and red days
- optional standard deviation line (k bands)
DAMMU Buy vs Sell Liquidity + DifferenceIndicator Name:
Buy vs Sell Liquidity + Difference
Purpose:
This indicator helps traders analyze market liquidity by comparing the cumulative buy and sell volumes within a specified timeframe. It shows which side (buyers or sellers) is dominating and the magnitude of the imbalance.
Key Features:
Aggregation Timeframe:
Users can select the timeframe (1, 2, 3, 5, 15, 30 minutes) for which volume is analyzed.
Buy & Sell Volume Calculation:
Buy Volume: Total volume of candles where close > open.
Sell Volume: Total volume of candles where close < open.
Daily Reset:
Totals reset at the start of each new day, ensuring intra-day liquidity analysis.
Difference Calculation:
Shows the absolute difference between buy and sell volumes.
Also calculates the difference as a percentage of total volume.
Percentages:
Displays buy %, sell %, and diff % to 4 decimal places, giving precise insights.
Table Display:
A two-row table in the top-right corner of the chart:
Row 1: Absolute totals for BUY, SELL, and DIFF (full numbers with commas).
Row 2: Percentages for BUY, SELL, and DIFF (4 decimals).
Uses color coding: Green for BUY, Red for SELL, Dynamic for DIFF (based on dominance).
How to Use:
High Buy Volume: Indicates strong buying pressure; bullish sentiment.
High Sell Volume: Indicates strong selling pressure; bearish sentiment.
Large DIFF %: Signals dominant market side; useful for short-term scalping or spotting liquidity imbalance.
Comparing BUY vs SELL %: Helps identify when the market may reverse or continue the trend.
If you want, I can also make a 1-paragraph “trader-friendly” explanation that you could directly include in your Pine Script as a comment or in a strategy guide.
Dynamic Sessions - Asia, London, New YorkThis indicator lets you set trading sessions (custom sessions) and print them out as dynamic polyboxes instead of traditional rectangles which lets you identify strong moves and trends easier.
NIFTY Consolidation → Breakout FinderThis indicator defines 5 day consolidation period and breakout label. This works best on a daily chart. Please back test before use.
MTF State of Delivery by @traderprimezOverview
This indicator provides a comprehensive, multi-timeframe view of institutional orderflow, a core concept from Inner Circle Trader (ICT) methodologies.
It is designed to objectively identify the market's "State of Delivery"—whether price is currently in a bullish or bearish orderflow—on both your current chart (Lower Timeframe) and a relevant Higher Timeframe.
By visualizing these key directional shifts, the indicator helps traders align with the dominant market bias, identify high-probability setups, and avoid trading against the underlying institutional intent.
Core Concept: The Orderflow Switch
The entire logic is built upon a specific two-candle price action pattern called a "Switch," which signals a potential turning point in the market.
Bullish Switch: A bullish candle followed immediately by a bearish candle. This duo creates a short-term resistance level. Orderflow is confirmed Bullish when a later bullish candle closes above this level.
Bearish Switch: A bearish candle followed immediately by a bullish candle. This duo creates a short-term support level. Orderflow is confirmed Bearish when a later bearish candle closes below this level.
Features & How to Read the Chart
This indicator plots several visual elements to provide a complete picture of the market's state:
Status Table: Located at the top of the chart, this table provides an at-a-glance summary of the current State of Delivery for both the Higher Timeframe (HTF) and Lower Timeframe (LTF). The status cells dynamically change color to reflect the current bias (Blue for Bullish, Red for Bearish).
Confirmed Orderflow Lines:
Thick Solid Lines: These represent the confirmed orderflow on the Higher Timeframe. A thick blue line indicates the HTF is in a bullish state, while a thick red line indicates a bearish state.
Thin Solid Lines: These represent the confirmed orderflow on your current chart (LTF). A thin blue line confirms a local bullish shift, and a thin red line confirms a local bearish shift.
Pending Switch Levels (Dotted Lines):
These forward-extending dotted lines mark the most recent switch levels that have not yet been broken. They represent the "lines in the sand"—the exact price levels that need to be breached to confirm the next shift in orderflow on both the LTF and HTF.
Multi-Timeframe Analysis
The indicator's power comes from its ability to sync LTF price action with the HTF narrative. It automatically determines the relevant HTF based on your current chart, using the following logical pairings:
1m or 3m chart 15 Minute
5m chart 1 Hour
15m chart 4 Hour
1h chart 1 Day
4h chart 1 Week
1d chart 1 Month
Note: The HTF feature will be inactive on unmapped timeframes.
How to Use in Your Trading
This tool is designed to be a confluence factor in your trading system, not a standalone signal generator.
High-Probability Setups: The strongest signals occur when the LTF confirms an orderflow shift that is in the same direction as the established HTF bias. For example, look for long entries after a thin blue LTF line appears while the dominant HTF line is also blue.
Confirmation: Use the break of a pending (dotted) line as a final confirmation for an entry you have already identified through your own analysis (e.g., at a Fair Value Gap or Order Block).
Risk Management: An opposing orderflow shift can serve as an early warning to manage a trade or take profits. For instance, if you are long and a bearish (red) LTF orderflow is confirmed, it may signal that the short-term momentum is shifting against you.
Settings
The indicator is fully customizable, allowing you to:
Toggle the visibility of the Status Table, HTF/LTF confirmed lines, and HTF/LTF pending lines.
Customize the colors and line widths for all elements to match your chart theme.
Disclaimer: This tool is for educational and analytical purposes only. It is not financial advice. All trading involves substantial risk, and past performance is not indicative of future results. Please perform your own due diligence and risk management.
指定周期 EMA (20, 40, 60, 80)This indicator allows you to display EMA (20, 40, 60, 80) from a higher timeframe directly on your current chart.
It helps you identify trend direction, confluence zones, and dynamic support/resistance based on multi-timeframe EMAs.
Features:
Choose any higher timeframe (e.g. 60 = 1H, 240 = 4H, D = 1D)
Plots 4 EMAs: 20, 40, 60, and 80
Works seamlessly across all timeframes
Ideal for trend confirmation and multi-timeframe analysis
💡 Tip:
Try viewing the 1H EMAs on a 15min chart or 4H EMAs on a 1H chart — this helps identify where price interacts with higher timeframe structure.
10MA Crosses Above 20MA//@version=5
indicator("10MA Crosses Above 20MA", overlay=true)
ma10 = ta.sma(close, 10)
ma20 = ta.sma(close, 20)
plot(ma10, color=color.orange, title="10MA")
plot(ma20, color=color.blue, title="20MA")
crossUp = ta.crossover(ma10, ma20)
alertcondition(crossUp, title="10MA Crosses Above 20MA", message="10MA升穿20MA,可能是買入訊號!")
Multi Doji Detector v1 [JopAlgo]Multi Doji Detector v1 — fast pattern pings with real filters
What it does (one line):
Marks reversal/indecision candles (Doji family) and impulse candles (Engulfing, Hammer/Inverted Hammer), with optional ATR and volume filters so you don’t chase every wiggle.
Why it’s useful:
Candles tell you when the auction pauses or flips. This tool spots those moments, but only matters at a level. Use it to time entries at Volume Profile edges and AVWAP—not as a standalone signal.
What you’ll see on the chart
Doji family
Standard Doji (▲ blue above bar)
Dragonfly Doji (● green below bar)
Gravestone Doji (● red above bar)
Long-Legged Doji (▲ orange above bar)
Engulfing
Bullish Engulfing (⬆ teal below bar)
Bearish Engulfing (⬇ purple above bar)
Hammer set
Hammer (⬆ lime below bar)
Inverted Hammer (⬆ fuchsia below bar)
Shapes = heads-up. Your trade still needs location, flow, and a risk plan.
How to use it (the simple playbook)
Location first
Work at Volume Profile v3.2 levels (VAH/VAL/POC/LVNs) or Anchored VWAP.
No level, no trade.
Flow check (optional but strong)
Use CVDv1: take signals only when Alignment = OK and Absorption ≠ red against your idea.
Pattern = timing
At support (VAL/AVWAP): Bullish Engulfing or Hammer, or a Dragonfly/Standard Doji that gets follow-through up.
At resistance (VAH/AVWAP): Bearish Engulfing, Inverted Hammer, or Gravestone/Standard Doji with follow-through down.
Confirm the bar
Let the signal close. If the next bar rejects the idea, stand down.
Timeframe guidance
1–5m (scalps): Many marks. Keep ATR/volume filters ON. Only take signals at VA edges / Session AVWAP.
15m–1H (intraday): Cleanest. Best combo of signal quality and frequency.
2H–4H (swing): Fewer, stronger signals. Ideal for AVWAP/Composite VP reclaims.
1D+ (position): Use as a heads-up at weekly levels; wait for intraday confirmation to enter.
Entries, exits, risk (quick rules)
Entry:
Long: Bullish Engulfing / Hammer / bullish Doji at support, next bar holds above signal’s high or prints follow-through.
Short: Bearish Engulfing / Inverted Hammer / bearish Doji at resistance, next bar holds below signal’s low or follows through.
Stop:
Longs: below signal low or structure under the level.
Shorts: above signal high or structure over the level.
Targets:
Aim for POC/HVNs or obvious swings. Don’t use the symbol alone as a target.
Pass:
Signals mid-range (no level), or against CVDv1 (Absorption), or when ATR is tiny (fake pokes).
Settings that actually matter
Doji mode
Use Percentage-Based: compares body to full candle range (default 5%).
Off = fixed definition (body < 10% of range).
Tip: If you get too many dojis, lower the %; if too few, raise it slightly.
Engulfing filters
ATR Length (default 14) + Min Size (ATR): require real body expansion.
Volume confirmation: ON = demand above-average volume; reduces noise.
Hammer filters
Wick-to-Body Ratio: default 2.5×; increase for stricter hammers.
ATR Filter: minimum candle size; blocks tiny “toy” candles.
Volume confirmation: ON = better reliability.
Alerts
Toggle Doji Alerts on if you want all doji pings; engulfing/hammer alerts are always available.
Pattern cheatsheet (what they mean at a level)
Standard Doji: indecision → wait for directional close next bar.
Dragonfly (at support): buyers rejected lows → look for long on follow-through.
Gravestone (at resistance): sellers rejected highs → look for short on follow-through.
Long-Legged Doji: big fight → only trade it at a level and with the next bar confirming.
Bullish Engulfing: fresh control shift to buyers; best after a drive into support.
Bearish Engulfing: fresh control shift to sellers; best after a pop into resistance.
Hammer: capitulation then rescue; strongest when the low sweeps a level and closes back above.
Inverted Hammer: rejection from above; needs downside follow-through to matter.
Best combos (kept simple)
Volume Profile v3.2 : Signals at VAH/VAL/LVNs. Use POC/HVNs for targets.
Anchored VWAP : Reclaims/rejections get much better with a matching candle signal.
CVDv1 : Take signals with flow (ALIGN OK, no Absorption). If Absorption flashes red against your signal, skip it.
Common mistakes this prevents
Taking a “pretty” candle in the middle of nowhere.
Shorting every Gravestone in a real uptrend (ATR expanding, CVD strong).
Ignoring size: Engulfing/Hammer without ATR/volume often fail.
Entering before close: half of false signals vanish by the close.
Practical defaults to start
Doji: Percentage-based ON, 5%
Engulfing: Min size 1.0 ATR, Volume confirm ON
Hammer: Wick/Body 2.5×, ATR filter 0.5, Volume confirm ON
Timeframes: 15m–1H for most assets; 2H–4H for swing
Quick disclaimer
Educational tool, not financial advice. Patterns are timers, not trades by themselves. Always pair with location, flow, and risk.
Live Position SizerThis position calculator locks onto the live price in real time and calculates your lot and quantity size for you. Best for scalping if you don't want to open a limit order. You input all the necessary data (Account size, risk, SL placement, LONG/SHORT position, etc...) It also has a nifty feature of allowing you the ability to see TP brackets (+1R, +2R, +3R).
The best way I have used it is seeing where my potential SL will go before I consider opening a position and inputting that. Then when I'm ready to open a position, I already have it calculated for me.
DTM 444 BANDS 🚀DTM 444 BANDS 🚀:
The DTM 444 BANDS 🚀 is a powerful, multi-purpose trading indicator combining Supertrend, Dynamic Band Levels, Breakout Signals, and Volume Confirmation to help traders identify high-probability trade setups across different timeframes.
🔧 Key Features
✅ Multi-Timeframe Support
Analyze price action across any timeframe using the Timeframe input.
All band calculations (High, Low, Midline, and Supertrend) are pulled from a higher timeframe for clearer context.
✅ Dynamic Bands Based on Supertrend
High Band: Rolling highest of Supertrend over hiLen period.
Low Band: Rolling lowest of Supertrend over loLen period.
Midline: Midpoint of the above.
Acts like dynamic support/resistance, ideal for trend-following and breakout strategies.
✅ Dual Signal System
Breakout Signals (Buy and Sell): Triggered when price breaks the bands with volume confirmation.
Supertrend Crossover Signals (Buy1 and Sell1): Classic momentum entries with a confirmation twist.
Exit Signals: Optional take-profit/neutral indicators when price reverses.
✅ Volume Confirmation Filter (Optional)
Only triggers signals if the volume exceeds its 20-period SMA.
Helps filter out false breakouts and weak trends in low-liquidity periods.
✅ Visual Enhancements
Color-coded candles based on band positioning (e.g., red = weak, green = strong, etc.)
On-chart labels for each signal for quick reference.
Real-time Signal Dashboard using Pine Script tables showing:
Current signal
Volume filter status
Live volume vs volume SMA
🧪 Practical Use Cases
Trend Traders: Use the Supertrend cross and band breakouts to ride trends early.
Breakout Traders: Catch high-probability moves outside established ranges.
Swing Traders: Time entries and exits using color-coded bars and exit labels.
Volume-Sensitive Traders: Focus on trades with strong volume backing.
📊 Backtest Snapshot
Based on the example chart for Reliance Industries (RELIANCE.NS) on the weekly timeframe:
Several profitable buy and breakout signals during uptrends.
Timely exits and breakdown alerts before reversals.
Volume filter keeps trades clean and avoids noise.
⚙️ Customizable Parameters
High Length and Low Length (default: 19)
Supertrend Multiplier and ATR Length
Volume Filter: Toggle ON/OFF
Volume SMA Length: Default 20
Custom Timeframe: Choose any higher timeframe for multi-timeframe analysis
📢 Alerts Ready
Fully integrated with TradingView alerts:
Breakout & Breakdown
Supertrend crossovers
All alerts respect the volume filter setting
🏁 Final Thoughts
DTM 444 BANDS 🚀 is a versatile and adaptive trading system that blends trend analysis, volatility bands, and volume validation. Whether you're a trend trader, breakout hunter, or swing trader — this tool gives you a structured edge with clear visual cues and real-time alerts.
Impulse Range Compression & Expansion (IRCE)📌 Impulse Range Compression & Expansion (IRCE) – Visualizing Price Traps Before Breakouts
📖 Overview
The IRCE Indicator is a precision breakout detection tool designed to identify consolidation traps and price coil zones before expansion moves occur. Unlike traditional volatility indicators that rely solely on statistical thresholds (e.g., Bollinger Bands or ATR), IRCE focuses on behavioral price compression, detecting tight-range candle clusters and validating breakouts through body expansion and/or volume surges.
This makes it ideal for traders looking to:
• Catch breakouts from range traps
• Avoid choppy and premature signals
• Spot early-stage momentum moves based on clean price behavior
⸻
⚙️ How It Works
1. Impulse Range Compression Detection
• Measures the high-low range of each candle
• Compares it to a user-defined average range (default 7 bars)
• Flags candles where the range is significantly smaller (e.g., <60% of average)
• Groups these into tight clusters, indicating compression zones or potential “trap ranges”
2. Cluster Box Construction
• When a valid cluster (e.g., 3 or more tight candles) is detected, the indicator:
• Marks the high and low of the cluster
• Draws a shaded box over this “trap zone”
• This helps visually track where price has coiled before a breakout
3. Breakout Confirmation Logic
A breakout from the trap zone is only validated when:
• Price closes above the cluster high (bullish) or below the cluster low (bearish)
• One or both of the following confirm strength:
• Body Expansion: Current candle body is 120%+ of recent average
• Volume Expansion: Volume exceeds recent volume average
4. Optional Trend Filter
• An optional EMA filter (default: 50 EMA) ensures breakout signals align with trend direction
• Helps filter out countertrend noise in ranging markets
5. Signal Cooldown
• Prevents repeated signals by enforcing a cooldown period (e.g., 10 bars) between entries
⸻
🖥️ Visual Elements
• 📦 Yellow compression boxes represent tight price traps
• 🟢 Buy labels appear when price breaks above the trap with confirmation
• 🔴 Sell labels appear when price breaks below with confirmation
• All visuals are non-repainting and updated in real-time
🧠 How to Use
1. Wait for a yellow trap box to appear
2. Watch for a confirmed breakout from the trap zone
3. Take the trade in the direction of the breakout:
• Only if it satisfies body or volume confirmation
• And if trend alignment is enabled, it must match EMA direction
4. Place stops just outside the opposite end of the trap zone
5. Use risk/reward ratios or structure levels for exits
This logic works great on:
• Lower timeframes (scalping breakouts)
• Higher timeframes (detecting price coiling before major moves)
• Any market: Stocks, Crypto, FX, Commodities
⸻
🔒 Technical Notes
• ✅ No repainting
• ✅ No future-looking logic
• ✅ Suitable for both discretionary and systematic traders
• ✅ Built in Pine Script v6
Doji Buy Signal (3-min, Body ≤ 6%)Doji Buy Signal (3-min, Body ≤ 6%) will give a Buy Signal when Doji Candle is formed
Doji Buy Signal (3-min, Body ≤ 6%)Doji Buy Signal (3-min, Body ≤ 6%) will give a buy signal when dojo candle is formed
3 Red Heikin Ashi with Higher Lows3 Red Heikin Ashi with Higher Lows. Will Give a Buy Signal when 3 Red Heikin Ashi with Higher Lows is formed
EMA 4/8/15The 4/8/15 are the main Moving Averages you need. . When it is inside the 4/8, it is moving slowly. If it detaches or launches above the 8, you have an increase in volume and price
Estrategia MACD//@version=6
indicator("Trading Sessions", overlay = true, max_boxes_count = 500, max_lines_count = 500, max_labels_count = 500)
bool showSessionNames = input.bool(true, "Show session names")
bool showSessionOC = input.bool(true, "Draw session open and close lines")
bool showSessionTickRange = input.bool(true, "Show tick range for each session")
bool showSessionAverage = input.bool(true, "Show average price per session")
const string TZ_TOOLTIP_TEXT = "The session's time zone, specified in either GMT notation (e.g., 'GMT-5') or as an IANA time zone database name (e.g., 'America/New_York')."
+ " We recommend the latter since it includes other time-related changes, such as daylight savings."
const string FIRST_SESSION_GROUP = "First Session"
showFirst = input.bool(true, "Show session", group = FIRST_SESSION_GROUP, display = display.none)
firstSessionName = input.string("Tokyo", "Displayed name", group = FIRST_SESSION_GROUP, display = display.none)
firstSessionTime = input.session("0900-1500", "Session time", group = FIRST_SESSION_GROUP, display = display.none)
firstSessionTZ = input.string("Asia/Tokyo", "Session timezone", group = FIRST_SESSION_GROUP, display = display.none, tooltip = TZ_TOOLTIP_TEXT)
firstSessionColor = input.color(color.new(#2962FF, 85), "Session color", group = FIRST_SESSION_GROUP)
const string SECOND_SESSION_GROUP = "Second session"
showSecond = input.bool(true, "Show session", group = SECOND_SESSION_GROUP, display = display.none)
secondSessionName = input.string("London", "Displayed name", group = SECOND_SESSION_GROUP, display = display.none)
secondSessionTime = input.session("0830-1630", "Session time", group = SECOND_SESSION_GROUP, display = display.none)
secondSessionTZ = input.string("Europe/London", "Session timezone", group = SECOND_SESSION_GROUP, display = display.none, tooltip = TZ_TOOLTIP_TEXT)
secondSessionColor = input.color(color.new(#FF9800, 85), "Session color", group = SECOND_SESSION_GROUP)
const string THIRD_SESSION_GROUP = "Third session"
showThird = input.bool(true, "Show session", group = THIRD_SESSION_GROUP, display = display.none)
thirdSessionName = input.string("New York", "Displayed name", group = THIRD_SESSION_GROUP, display = display.none)
thirdSessionTime = input.session("0930-1600", "Session time", group = THIRD_SESSION_GROUP, display = display.none)
thirdSessionTZ = input.string("America/New_York", "Session timezone", group = THIRD_SESSION_GROUP, display = display.none, tooltip = TZ_TOOLTIP_TEXT)
thirdSessionColor = input.color(color.new(#089981, 85), "Session color", group = THIRD_SESSION_GROUP)
type SessionDisplay
box sessionBox
label sessionLabel
line openLine
line avgLine
line closeLine
float sumClose
int numOfBars
type SessionInfo
color color
string name
string session
string timezone
SessionDisplay active = na
method setName(SessionDisplay this, string name) =>
sessionLabel = this.sessionLabel
sessionBox = this.sessionBox
boxText = array.new()
if showSessionTickRange
boxText.push("Range: " + str.tostring((sessionBox.get_top() - sessionBox.get_bottom()) / syminfo.mintick, format.mintick))
if showSessionAverage
boxText.push("Avg: " + str.tostring(this.sumClose / this.numOfBars, format.mintick))
if showSessionNames
boxText.push(name)
sessionLabel.set_y(sessionBox.get_bottom())
sessionLabel.set_text(array.join(boxText, " "))
method createSessionDisplay(SessionInfo this) =>
boxColor = this.color
opaqueColor = color.new(boxColor, 0)
dis = SessionDisplay.new(
sessionBox = box.new(bar_index, high, bar_index, low, bgcolor = boxColor, border_color = na),
sessionLabel = label.new(bar_index, low, "", style = label.style_label_upper_left, textalign = text.align_left, textcolor = opaqueColor, color = color(na)),
openLine = showSessionOC ? line.new(bar_index, open, bar_index, open, color = opaqueColor, style = line.style_dashed, width = 1) : na,
closeLine = showSessionOC ? line.new(bar_index, close, bar_index, close, color = opaqueColor, style = line.style_dashed, width = 1) : na,
avgLine = showSessionAverage ? line.new(bar_index, close, bar_index, close, style = line.style_dotted, width = 2, color = opaqueColor) : na,
sumClose = close,
numOfBars = 1
)
linefill.new(dis.openLine, dis.closeLine, boxColor)
dis.setName(this.name)
this.active := dis
method updateSessionDisplay(SessionInfo this) =>
sessionDisp = this.active
sessionBox = sessionDisp.sessionBox
openLine = sessionDisp.openLine
closeLine = sessionDisp.closeLine
avgLine = sessionDisp.avgLine
sessionDisp.sumClose += close
sessionDisp.numOfBars += 1
sessionBox.set_top(math.max(sessionBox.get_top(), high))
sessionBox.set_bottom(math.min(sessionBox.get_bottom(), low))
sessionBox.set_right(bar_index)
sessionDisp.setName(this.name)
if showSessionOC
openLine.set_x2(bar_index)
closeLine.set_x2(bar_index)
closeLine.set_y1(close)
closeLine.set_y2(close)
if showSessionAverage
avgLine.set_x2(bar_index)
avg = sessionDisp.sumClose / sessionDisp.numOfBars
avgLine.set_y1(avg)
avgLine.set_y2(avg)
sessionDisp
method update(SessionInfo this) =>
bool isChange = timeframe.change("1D")
if (not na(time("", this.session, this.timezone))) // inSession
if na(this.active) or isChange
this.createSessionDisplay()
else
this.updateSessionDisplay()
else if not na(this.active)
this.active := na
getSessionInfos()=>
array sessionInfos = array.new()
if showFirst
sessionInfos.push(SessionInfo.new(firstSessionColor, firstSessionName, firstSessionTime, firstSessionTZ))
if showSecond
sessionInfos.push(SessionInfo.new(secondSessionColor, secondSessionName, secondSessionTime, secondSessionTZ))
if showThird
sessionInfos.push(SessionInfo.new(thirdSessionColor, thirdSessionName, thirdSessionTime, thirdSessionTZ))
sessionInfos
var array sessionInfos = getSessionInfos()
if timeframe.isdwm
runtime.error("This indicator can only be used on intraday timeframes.")
for info in sessionInfos
info.update()
RUDWAN OSMAN MUHUMED redsco trader
this indicator will help you to use ema 9 and ema 20 together with one indicator.