Candle Range Detector by TradeTech AnalysisCandle Range Detector by TradeTech Analysis
This advanced indicator identifies and visualizes price compression zones based on inside bar formations, then tracks how price behaves around those zones — offering valuable insights into liquidity sweeps, range expansions, and trap/mitigation behavior.
The script builds upon the foundational concept of range-based price action, commonly used by institutional traders, and adds automation, mitigation tracking, and sweep detection to map how price reacts around these critical ranges.
🔍 How It Works:
• Range Formation: A new range is detected when the current candle forms entirely within the high and low of the previous candle (i.e., an inside bar). This behavior often indicates price compression and potential breakout zones.
• Range Extension: Once a range is confirmed, the script projects upper and lower boundaries (using either a percentage-based multiplier or Fibonacci log extension), providing context for expected breakout zones.
• Mitigation Tracking: The script continuously monitors whether price breaks above or below the projected extensions, marking that range as mitigated — useful for confirming whether liquidity was absorbed.
• Sweep Detection: If price re-visits a mitigated zone and shows signs of a liquidity sweep (via wick + close behavior), the indicator triggers visual sweep labels and optional alerts.
🧠 Optional Visual Enhancements:
• Highlight range-forming candles with light blue background (toggle on/off)
• Midpoint dotted line for symmetry analysis
• Labels for “Range High” and “Range Low” for visual clarity
• Dynamic box drawing that adapts upon mitigation or continuation
⚙️ Customizable Features:
• Choose between Normal and Fibonacci-based detection modes
• Toggle visibility of range boxes, extension lines, and sweep markers
• Configure sweep alerts, mitigation window size, and visual transparency
⸻
🧪 Use Cases
• Identify consolidation zones before major price moves
• Confirm liquidity sweeps for entry/exit traps
• Visualize and test mitigation behavior of past zones
• Combine with Order Flow or Volume Profile tools to enhance context
⸻
⚠️ This is a fully original implementation that goes beyond classical inside-bar scanners by incorporating mitigation, extension projection, and liquidity sweeps — making it a powerful tool for intraday, swing, and even Smart Money-based trading setups.
Indicators and strategies
Пробиття фракталів з медіаною та адаптивним фільтромWe are going to describe the indicator in English. The indicator is based on the concept of fractal breakouts with volume confirmation using median and adaptive filtering.
### Indicator Description:
**Indicator Name:** Fractal Breakout with Volume Median and Adaptive Filter
**Overview:**
This indicator identifies breakout signals based on fractals (price reversals) and confirms them with volume analysis. The breakout signals (both buy and sell) are generated when the price breaks a fractal level (high for buy, low for sell) and the current volume exceeds the median volume of previous breakouts by a certain adaptive multiplier. The adaptive multiplier adjusts for different timeframes to provide more relevant signals.
**Key Features:**
1. **Fractal Detection:**
- Fractals are detected using a user-defined period (default is 2).
- A top fractal (bearish reversal pattern) is formed when there is a central bar with the highest high among `len` bars on both sides.
- A bottom fractal (bullish reversal pattern) is formed when there is a central bar with the lowest low among `len` bars on both sides.
2. **Breakout Logic:**
- A buy breakout occurs when the price closes above the last top fractal level.
- A sell breakout occurs when the price closes below the last bottom fractal level.
- The breakout must happen on the current bar (i.e., the breakout is new: the previous bar was not above the top fractal for buy, or below the bottom fractal for sell).
3. **Volume Confirmation:**
- The indicator maintains two arrays (one for buy breakouts and one for sell breakouts) that store the volumes of previous breakout bars.
- For a breakout to be confirmed, the current volume must exceed the median volume of the respective array (buy or sell) multiplied by an adaptive multiplier.
- The adaptive multiplier is calculated based on the current timeframe. It is designed to be lower on higher timeframes.
4. **Adaptive Multiplier:**
- The base multiplier is set by the user (default 1.2).
- The actual multiplier is adjusted by the formula: `baseMultiplier * (1.0 - min(timeframe_in_hours, 1.0) * 0.5)`. This reduces the multiplier on timeframes of 1 hour and above.
5. **Signal Alternation:**
- The indicator alternates between buy and sell signals. After a buy signal, only a sell signal can occur, and vice versa.
6. **Visualization:**
- Fractals are marked with triangles (red downward for top, green upward for bottom).
- Breakout signals are marked with labels (green "BUY" below the bar, red "SELL" above the bar).
7. **Alerts:**
- Alert conditions are set for both buy and sell breakouts.
**Input Parameters:**
- `Period Fractal (len)`: The number of bars used to detect fractals (default: 2).
- `Number of Breakouts for Median (volLookback)`: The number of previous breakouts to consider for median volume calculation (default: 10).
- `Base Volume Multiplier (baseMultiplier)`: The base volume multiplier (default: 1.2). This is adjusted for higher timeframes.
**How It Works:**
1. **On each bar:**
- Check for the formation of new top or bottom fractals.
- Update the last top and bottom fractal levels if new fractals are found.
2. **Breakout Conditions:**
- For a buy breakout:
- The previous bar was not above the last top fractal level (i.e., no breakout in progress).
- The current bar closes above the last top fractal level.
- The current volume is greater than the median volume of previous buy breakouts multiplied by the adaptive multiplier (or if there are no previous buy breakouts, the volume condition is skipped).
- Similarly for sell breakout.
3. **Update Arrays:**
- When a breakout occurs, the current volume is added to the respective array (buyVolumes for buy, sellVolumes for sell) and the array is trimmed to the specified lookback period.
4. **Signal Generation:**
- A buy signal is plotted as a green "BUY" label below the bar.
- A sell signal is plotted as a red "SELL" label above the bar.
5. **Alerts:**
- Alerts are triggered when a breakout signal occurs.
**Additional Notes:**
- The median is calculated as the middle value of the sorted array (or the average of the two middle values for even-sized arrays).
- The adaptive multiplier ensures that on higher timeframes (like 1 hour and above) the volume requirement is less strict because volume patterns differ.
**Potential Use:**
Traders can use this indicator to identify potential trend continuations or reversals with volume confirmation. The adaptive volume filter makes it suitable for multiple timeframes.
Breakout & Pullback | Auto S&D + Telegram AlertsBreakout & Pullback | Auto S&D + Telegram Alerts Achraf
Trendlines with Breaks + Hull Suite + SuperTrend
الدخول بعد اختراق او كسر الترند المطابق للسحابه والخروج مع تغيير لون الخط المتدرج
Entering after breaking or breaking the trend corresponding to the cloud and exit with changing the colour of the graduated line
London Session High/Low Zones — Mended CollectiveThis indicator shows the high and low of the London session (3AM–8AM EST), with session shading and labels. Alerts notify you when price breaks above or below the range. Designed for intraday traders using session-based levels.
Daily ATR TrackerDaily ATR Tracker
The Daily ATR Tracker is a simple yet powerful tool designed to help traders monitor the daily price movement relative to the average daily range (ATR). This indicator provides an objective view of how much price has moved compared to its recent daily volatility.
🔎 Key Features:
Customizable ATR period (default 14 days)
Live calculation of the current day's price range
ATR value displayed in pips for clear reference
Percentage of ATR covered by the current day's range
Color-coded table for quick visual interpretation:
🟢 Green: less than 60% of ATR covered
🟠 Orange: 60% to 100% of ATR covered
🔴 Red: more than 100% of ATR covered
Alert condition when daily range exceeds 100% of the ATR average
Movable table position to fit your chart layout
🎯 Why use Daily ATR Tracker?
✅ Identify exhaustion zones: When price has already covered a large portion of its typical daily range, the odds of further strong movement may diminish, helping you to manage entries, exits, and risk.
✅ Objective daily bias: Get a quantitative sense of how "stretched" the market is in real time.
✅ Works with any timeframe: While designed for daily ranges, you can monitor intraday movements with this context in mind.
⚠️ Usage Note:
This tool does not provide buy or sell signals by itself. It is designed to complement your existing strategies by offering additional context regarding daily range exhaustion.
Timeframe Resistance Evaluation And Detection - CoffeeKillerTREAD - Timeframe Resistance Evaluation And Detection Guide
🔔 Important Technical Limitation 🔔
**This indicator does NOT fetch true higher timeframe data.** Instead, it simulates higher timeframe levels by aggregating data from your current chart timeframe. This means:
- Results will vary depending on what chart timeframe you're viewing
- Levels may not match actual higher timeframe candle highs/lows
- You might miss important wicks or gaps that occurred between chart timeframe bars
- **Always verify levels against actual higher timeframe charts before trading**
Welcome traders! This guide will walk you through the TREAD (Timeframe Resistance Evaluation And Detection) indicator, a multi-timeframe analysis tool developed by CoffeeKiller that identifies support and resistance confluence across different time periods.(I am 50+ year old trader and always thought I was bad a teaching and explaining so you get a AI guide. I personally use this on the 5 minute chart with the default settings, but to each there own and if you can improve the trend detection methods please DM me. I would like to see the code. Thanks)
Core Components
1. Dual Timeframe Level Tracking
- Short Timeframe Levels: Tracks opening price extremes within shorter periods
- Long Timeframe Levels: Tracks actual high/low extremes within longer periods
- Dynamic Reset Mechanism: Levels reset at the start of each new timeframe period
- Momentum Detection: Identifies when levels change mid-period, indicating active price movement
2. Visual Zone System
- High Zones: Areas between long timeframe highs and short timeframe highs
- Low Zones: Areas between long timeframe lows and short timeframe lows
- Fill Coloring: Dynamic colors based on whether levels are static or actively changing
- Momentum Highlighting: Special colors when levels break during active periods
3. Customizable Display Options
- Multiple Plot Styles: Line, circles, or cross markers
- Flexible Timeframe Selection: Wide range of short and long timeframe combinations
- Color Customization: Separate colors for each level type and momentum state
- Toggle Controls: Show/hide different elements based on trading preference
Main Features
Timeframe Settings
- Short Timeframe Options: 15m, 30m, 1h, 2h, 4h
- Long Timeframe Options: 1h, 2h, 4h, 8h, 12h, 1D, 1W
- Recommended Combinations:
- Scalping: 15m/1h or 30m/2h
- Day Trading: 30m/4h or 1h/4h
- Swing Trading: 4h/1D or 1D/1W
Display Configuration
- Level Visibility: Toggle short/long timeframe levels independently
- Fill Zone Control: Enable/disable colored zones between levels
- Momentum Fills: Special highlighting for actively changing levels
- Line Customization: Width, style, and color options for all elements
Color System
- Short TF High: Default red for resistance levels
- Short TF Low: Default green for support levels
- Long TF High: Transparent red for broader resistance context
- Long TF Low: Transparent green for broader support context
- Momentum Colors: Brighter colors when levels are actively changing
Technical Implementation Details
How Level Tracking Works
The indicator uses a custom tracking function that:
1. Detects Timeframe Periods: Uses `time()` function to identify when new periods begin
2. Tracks Extremes: Monitors highest/lowest values within each period
3. Resets on New Periods: Clears tracking when timeframe periods change
4. Updates Mid-Period: Continues tracking if new extremes are reached
The Timeframe Limitation Explained
`pinescript
// What the indicator does:
short_tf_start = ta.change(time(short_timeframe)) != 0 // Detects 30m period start
= track_highest(open, short_tf_start) // BUT uses chart TF opens!
// What true multi-timeframe would be:
// short_tf_high = request.security(syminfo.tickerid, short_timeframe, high)
`
This means:
- On a 5m chart with 30m/4h settings: Tracks 5m bar opens during 30m and 4h windows
- On a 1m chart with same settings: Tracks 1m bar opens during 30m and 4h windows
- Results will be different between chart timeframes
- May miss important price action that occurred between your chart's bars
Visual Elements
1. Level Lines
- Short TF High: Upper resistance line from shorter timeframe analysis
- Short TF Low: Lower support line from shorter timeframe analysis
- Long TF High: Broader resistance context from longer timeframe
- Long TF Low: Broader support context from longer timeframe
2. Zone Fills
- High Zone: Area between long TF high and short TF high (potential resistance cluster)
- Low Zone: Area between long TF low and short TF low (potential support cluster)
- Regular Fill: Standard transparency when levels are static
- Momentum Fill: Enhanced visibility when levels are actively changing
3. Dynamic Coloring
- Static Periods: Normal colors when levels haven't changed recently
- Active Periods: Momentum colors when levels are being tested/broken
- Confluence Zones: Different intensities based on timeframe alignment
Trading Applications
1. Support/Resistance Trading
- Entry Points: Trade bounces from zone boundaries
- Confluence Areas: Focus on areas where short and long TF levels cluster
- Zone Breaks: Enter on confirmed breaks through entire zones
- Multiple Timeframe Confirmation: Stronger signals when both timeframes align
2. Range Trading
- Zone Boundaries: Use fill zones as range extremes
- Mean Reversion: Trade back toward opposite zone when price reaches extremes
- Breakout Preparation: Watch for momentum color changes indicating potential breakouts
- Risk Management: Place stops outside the opposite zone
3. Trend Following
- Direction Bias: Trade in direction of zone breaks
- Pullback Entries: Enter on pullbacks to broken zones (now support/resistance)
- Momentum Confirmation: Use momentum coloring to confirm trend strength
- Multiple Timeframe Alignment: Strongest trends when both timeframes agree
4. Scalping Applications
- Quick Bounces: Trade rapid moves between zone boundaries
- Momentum Signals: Enter when momentum colors appear
- Short-Term Targets: Use opposite zone as profit target
- Tight Stops: Place stops just outside current zone
Optimization Guide
1. Timeframe Selection
For Different Trading Styles:
- Scalping: 15m/1h - Quick levels, frequent updates
- Day Trading: 30m/4h - Balanced view, good for intraday moves
- Swing Trading: 4h/1D - Longer-term perspective, fewer false signals
- Position Trading: 1D/1W - Major structural levels
2. Chart Timeframe Considerations
**Important**: Your chart timeframe affects results
- Lower Chart TF: More granular level tracking, but may be noisy
- Higher Chart TF: Smoother levels, but may miss important price action
- Recommended: Use chart timeframe 2-4x smaller than short indicator timeframe
3. Display Settings
- Busy Charts: Disable fills, show only key levels
- Clean Analysis: Enable all fills and momentum coloring
- Multi-Monitor Setup: Use different color schemes for easy identification
- Mobile Trading: Increase line width for visibility
Best Practices
1. Level Verification
- Always Cross-Check: Verify levels against actual higher timeframe charts
- Multiple Timeframes: Check 2-3 different chart timeframes for consistency
- Price Action Confirmation: Wait for candlestick confirmation at levels
- Volume Analysis: Combine with volume for stronger confirmation
2. Risk Management
- Stop Placement: Use zones rather than exact prices for stops
- Position Sizing: Reduce size when zones are narrow (higher risk)
- Multiple Targets: Scale out at different zone boundaries
- False Break Protection: Allow for minor zone penetrations
3. Signal Quality Assessment
- Momentum Colors: Higher probability when momentum coloring appears
- Zone Width: Wider zones often provide stronger support/resistance
- Historical Testing: Backtest on your preferred timeframe combinations
- Market Conditions: Adjust sensitivity based on volatility
Advanced Features
1. Momentum Detection System
The indicator tracks when levels change mid-period:
`pinescript
short_high_changed = short_high != short_high and not short_tf_start
`
This identifies:
- Active level testing
- Potential breakout situations
- Increased market volatility
- Trend acceleration points
2. Dynamic Color System
Complex conditional logic determines fill colors:
- Static Zones: Regular transparency for stable levels
- Active Zones: Enhanced colors for changing levels
- Mixed States: Different combinations based on user preferences
- Custom Overrides: User can prioritize certain color schemes
3. Zone Interaction Analysis
- Convergence: When short and long TF levels approach each other
- Divergence: When timeframes show conflicting levels
- Alignment: When both timeframes agree on direction
- Transition: When one timeframe changes while other remains static
Common Issues and Solutions
1. Inconsistent Levels
Problem: Levels look different on various chart timeframes
Solution: Always verify against actual higher timeframe charts
2. Missing Price Action
Problem: Important wicks or gaps not reflected in levels
Solution: Use chart timeframe closer to indicator's short timeframe setting
3. Too Many Signals
Problem: Excessive level changes and momentum alerts
Solution: Increase timeframe settings or reduce chart timeframe granularity
4. Lagging Signals
Problem: Levels seem to update too slowly
Solution: Decrease chart timeframe or use more sensitive timeframe combinations
Recommended Setups
Conservative Approach
- Timeframes: 4h/1D
- Chart: 1h
- Display: Show fills only, no momentum coloring
- Use: Swing trading, position management
Aggressive Approach
- Timeframes: 15m/1h
- Chart: 5m
- Display: All features enabled, momentum highlighting
- Use: Scalping, quick reversal trades
Balanced Approach
- Timeframes: 30m/4h
- Chart: 15m
- Display: Selective fills, momentum on key levels
- Use: Day trading, multi-session analysis
Final Notes
**Remember**: This indicator provides a synthetic view of multi-timeframe levels, not true higher timeframe data. While useful for identifying potential confluence areas, always verify important levels by checking actual higher timeframe charts.
**Best Results When**:
- Combined with actual multi-timeframe analysis
- Used for confluence confirmation rather than primary signals
- Applied with proper risk management
- Verified against price action and volume
**DISCLAIMER**: This indicator and its signals are intended solely for educational and informational purposes. The timeframe limitation means results may not reflect true higher timeframe levels. Always conduct your own analysis and verify levels independently before making trading decisions. Trading involves significant risk of loss.
Sarjana Crypto TrendMaster + EMA 20/50/100/200It combines moving averages, a custom SuperTrend, and Heikin Ashi smoothing to help you spot trend direction and filter clean buy/sell signals.
This tool doesn’t predict — it reacts smartly to trend changes.
It's ideal for traders who want clear, filtered signals backed by trend logic and EMAs.
TQ HA Break and Retest - Lines Only Cleanmarks out the first green candle with open and low price the exact same for key level. also marks out the first red candle with open and high price the exact same for key level. this is done using heikin ashi candles
🕯️ Candlestick Pattern Identifier by Sanal✅ Features:
Identifies common single, double, and triple candlestick patterns
Displays pattern names directly above/below candles
Color-coded for bullish/bearish clarity
Customizable settings to toggle patterns
📌 Candlestick Patterns Included:
🔹 Bullish:
Hammer
Inverted Hammer
Bullish Engulfing
Piercing Line
Morning Star
Three White Soldiers
🔹 Bearish:
Shooting Star
Hanging Man
Bearish Engulfing
Dark Cloud Cover
Evening Star
Three Black Crows
Adaptive Multi-MA OptimizerAdaptive Multi-MA Optimizer
This indicator provides a powerful, customizable solution for traders seeking dynamically optimized moving averages with precision and control. It integrates multiple custom-built moving average types, applies real-time volatility-based optimization, and includes an optional composite smoothing engine.
🧠 Key Features
Dynamic Optimization:
Automatically selects the optimal lookback length based on market volatility stability using a custom standard deviation differential model.
Multiple Custom MA Types:
Includes fully custom implementations of:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted MA)
DEMA (Double EMA)
TEMA (Triple EMA)
Hull MA
ALMA (Arnaud Legoux MA)
Composite MA Option:
A unique "Composite" mode blends all supported MAs into a single average, then applies optional smoothing for enhanced signal clarity.
Dynamic Smoothing:
The composite mode supports volatility-adjusted smoothing (based on optimized lookback), making it adaptable to different market regimes.
Fully Custom Logic:
No built-in MA functions are used — every moving average is hand-coded for transparency and educational value.
⚙️ How It Works
Optimization:
The script evaluates a range of lengths (minLen to maxLen) using the standard deviation of price returns. It selects the length with the most stable recent volatility profile.
Calculation:
The selected MA type is calculated using that optimized length. If "Composite" is chosen, all MA types are averaged and smoothed dynamically.
Visualization:
The adaptive MA is plotted on the chart, changing color based on its position relative to price.
📌 Use Cases
Trend-following strategies that adapt to different market conditions.
Traders wanting a high-fidelity composite of multiple MAs.
Analysts interested in visualizing market smoothness without lag-heavy signals.
Coders looking to learn how to build custom indicators from scratch.
🧪 Inputs
MA Type: Choose from 8 MA types or a blended Composite.
Lookback Range: Control min/max and step size for optimization.
Source: Choose any price series (e.g., close, hl2).
⚠️ Disclaimer
This indicator is for educational and informational purposes only and does not constitute financial advice, trading advice, or investment recommendations. Use of this script is at your own risk. Past performance does not guarantee future results. Always perform your own analysis and consult with a qualified financial advisor before making trading decisions.
GK Accounting - Gold Trading Signalhi this is new indicator for trading anytime frame any market its work really good
Moving Average Crossover Fast Moving Average (default: 9-period ) — reacts quickly to price changes.
Slow Moving Average (default: 21-period ) — smooths out long-term trends.
How It Works:
A Buy Signal is generated when the fast MA crosses above the slow MA, indicating potential upward momentum.
A Sell Signal is triggered when the fast MA crosses below the slow MA, signaling possible bearish momentum.
Features:
Customizable fast and slow MA periods.
Clear BUY/SELL labels directly on the chart.
Works on any timeframe or asset (stocks, crypto, forex, etc.).
Great for trend-following and swing trading strategies.
MMS Buy StrategyMonthly and Weekly filters check proximity to upper Bollinger Band or positive lower BB momentum.
Daily section:
Confirms a challenge to the lower Bollinger Band.
Then looks for either:
Bullish Engulfing,
Bullish Piercing candle closing above 50%,
Morning Star reversal pattern.
Daily momentum enforced via RSI > 40.
EMA 50 condition captures support/fake breakdown or close proximity (within 1%).
Stochastic ensures a positive crossover from a likely oversold zone.
Dual MACD Overlay + Signal Cross AlertMacd indicator with 2 different settings that visually alert you when the signal lines cross.
ICT Everything @coldbrewrosh// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// ©coldbrewrosh
//@version=5
indicator("ICT Everything @coldbrewrosh", overlay=true, max_lines_count=500, max_labels_count=5, max_boxes_count=500)
// General Settings Inputs
TZI = input.string (defval="UTC -5", title="Timezone Selection", options= , tooltip="Select the Timezone. ( Shifts Chart Elements )", group="Global Settings")
Timezone = TZI == "UTC -10" ? "GMT-10:00" : TZI == "UTC -7" ? "GMT-07:00" : TZI == "UTC -6" ? "GMT-06:00" : TZI == "UTC -5" ? "GMT-05:00" : TZI == "UTC -4" ? "GMT-04:00" : TZI == "UTC -3" ? "GMT-03:00" : TZI == "UTC +0" ? "GMT+00:00" : TZI == "UTC +1" ? "GMT+01:00" : TZI == "UTC +2" ? "GMT+02:00" : TZI == "UTC +3" ? "GMT+03:00" : TZI == "UTC +3:30" ? "GMT+03:30" : TZI == "UTC +4" ? "GMT+04:00" : TZI == "UTC +5" ? "GMT+05:00" : TZI == "UTC +5:30" ? "GMT+05:30" : TZI == "UTC +6" ? "GMT+06:00" : TZI == "UTC +7" ? "GMT+07:00" : TZI == "UTC +8" ? "GMT+08:00" : TZI == "UTC +9" ? "GMT+09:00" : TZI == "UTC +9:30" ? "GMT+09:30" : TZI == "UTC +10" ? "GMT+10:00" : TZI == "UTC +10:30" ? "GMT+10:30" : TZI == "UTC +11" ? "GMT+11:00" : TZI == "UTC +13" ? "GMT+13:00" : "GMT+13:45"
inputMaxInterval = input.int (31, title="Hide Indicator Above Specified Minutes", tooltip="Above 30Min, Chart Will Become Messy & Unreadable", group="Global Settings")
// Session options
ShowTSO = input.bool (true, title="Show Today's Session Only", group="Session Options", tooltip="Hide Historical Sessions")
ShowTWO = input.bool (true, title="Show Current Week's Sessions Only", group="Session Options", tooltip="Show All Sessions from the current week")
SL4W = input.bool (true, title="Show Last 4 Week Sessions", group="Session Options", tooltip="Show All Sessions from Last Four Weeks Should Disable Current Week Session to Work")
ShowSFill = input.bool (false, title="Show Session Highlighting", group="Session Options", tooltip="Highlights Session from Top of the Chart to Bottom")
//----------------------------------------------
// Historical Lines
ShowMOPL = input.bool (title="Midnight Historical Price Lines", defval=false, group="Historical Lines", tooltip="Shows Historical Midnight Price Lines")
MOLHist = input.bool (title="Midnight Historical Vertical Lines", defval=true, group="Historical Lines", tooltip="Shows Historical Midnight Vertical Lines")
ShowPrev = input.bool (false, title="Misc. Historical Price Lines", group="Historical Lines", tooltip="Makes Chart Cluttered, Use For Backtesting Only")
//----------------------------------------------
// Session Bool
ShowLondon = input.bool (true, "", inline="LONDON", group="Sessions", tooltip="01:00 to 05:00")
ShowNY = input.bool (true, "", inline="NY", group="Sessions", tooltip="07:00 to 10:00")
ShowLC = input.bool (true, "", inline="LC", group="Sessions", tooltip="10:00 to 12:00")
ShowPM = input.bool (true, "",inline="PM", group="Sessions", tooltip="13:00 to 16:00")
ShowAsian = input.bool (false, "",inline="ASIA2", group="Sessions", tooltip="20:00 to 00:00")
ShowFreeSesh = input.bool (false, "",inline="FREE", group="Sessions", tooltip="Custom Session")
// Session Strings
txt2 = input.string ("LONDON", title="", inline="LONDON", group="Sessions")
txt3 = input.string ("NEW YORK", title="", inline="NY", group="Sessions")
txt4 = input.string ("LDN CLOSE", title="", inline="LC", group="Sessions")
txt5 = input.string ("AFTERNOON", title="", inline="PM", group="Sessions")
txt6 = input.string ("ASIA", title="", inline="ASIA2", group="Sessions")
txt9 = input.string ("FREE SESH", title="", inline="FREE", group="Sessions")
// CBDR = input.session ('1600-2000:1234567', "", inline="CBDR", group="Sessions")
// ASIA = input.session ('2000-0000:1234567', "", inline="ASIA", group="Sessions")
// Session Times
LDNsesh = input.session ('0200-0500:1234567', "", inline="LONDON", group="Sessions")
NYsesh = input.session ('0700-1000:1234567', "", inline="NY", group="Sessions")
LCsesh = input.session ('1000-1200:1234567', "", inline="LC", group="Sessions")
PMsesh = input.session ('1300-1600:1234567', "", inline="PM", group="Sessions")
ASIA2sesh = input.session ('2000-2359:1234567', "", inline="ASIA2", group="Sessions")
FreeSesh = input.session ('0000-0000:1234567', "", inline="FREE", group="Sessions")
// Session Color
LSFC = input.color (color.new(#787b86, 90), "", inline="LONDON", group="Sessions")
NYSFC = input.color (color.new(#787b86, 90), "",inline="NY", group="Sessions")
LCSFC = input.color (color.new(#787b86, 90), "",inline="LC", group="Sessions")
PMSFC = input.color (color.new(#787b86, 90), "",inline="PM", group="Sessions")
ASFC = input.color (color.new(#787b86, 90), "",inline="ASIA2", group="Sessions")
FSFC = input.color (color.new(#787b86, 90), "",inline="FREE", group="Sessions")
//----------------------------------------------
// Vertical Line Bool
ShowMOP = input.bool (title="", defval=true, inline="MOP", group="Vertical Lines", tooltip="00:00 AM")
txt12 = input.string ("MIDNIGHT", title="", inline="MOP", group="Vertical Lines")
ShowLOP = input.bool (title="", defval=false, inline="LOP", group="Vertical Lines", tooltip="03:00 AM")
txt14 = input.string ("LONDON", title="", inline="LOP", group="Vertical Lines")
ShowNYOP = input.bool (title="", defval=true, inline="NYOP", group="Vertical Lines", tooltip="08:30 AM")
txt15 = input.string ("NEW YORK", title="", inline="NYOP", group="Vertical Lines")
ShowEOP = input.bool (title="", defval=false, inline="EOP", group="Vertical Lines", tooltip="09:30 AM")
txt16 = input.string ("EQUITIES", title="", inline="EOP", group="Vertical Lines")
// Vertical Line Color
MOPColor = input.color (color.new(#787b86, 0), "", inline="MOP", group="Vertical Lines")
LOPColor = input.color (color.rgb(0,128,128,60), "", inline="LOP", group="Vertical Lines")
NYOPColor = input.color (color.rgb(0,128,128,60), "", inline="NYOP", group="Vertical Lines")
EOPColor = input.color (color.rgb(0,128,128,60), "", inline="EOP", group="Vertical Lines")
// Vertical LineStyle
Midnight_Open_LS = input.string ("Dotted", "", options= , inline="MOP", group="Vertical Lines")
london_Open_LS = input.string ("Solid", "", options= , inline="LOP", group="Vertical Lines")
NY_Open_LS = input.string ("Solid", "", options= , inline="NYOP", group="Vertical Lines")
Equities_Open_LS = input.string ("Solid", "", options= , inline="EOP", group="Vertical Lines")
// Vertical LineWidth
Midnight_Open_LW = input.string ("1px", "", options= , inline="MOP", group="Vertical Lines")
London_Open_LW = input.string ("1px", "", options= , inline="LOP", group="Vertical Lines")
NY_Open_LW = input.string ("1px", "", options= , inline="NYOP", group="Vertical Lines")
Equities_Open_LW = input.string ("1px", "", options= , inline="EOP", group="Vertical Lines")
//----------------------------------------------
// Opening Price Bool
ShowMOPP = input.bool (title="", defval=true, inline="MOPP", group="Opening Price Lines", tooltip="00:00 AM")
txt13 = input.string ("MIDNIGHT", title="", inline="MOPP", group="Opening Price Lines")
ShowNYOPP = input.bool (title="", defval=false, inline="NYOPP", group="Opening Price Lines", tooltip="08:30 AM")
txt17 = input.string ("NEW YORK", title="", inline="NYOPP", group="Opening Price Lines")
ShowEOPP = input.bool (title="", defval=false, inline="EOPP", group="Opening Price Lines", tooltip="09:30 AM")
txt18 = input.string ("EQUITIES", title="", inline="EOPP", group="Opening Price Lines")
ShowAFTPP = input.bool (title="", defval=false, inline="AFTOPP", group="Opening Price Lines", tooltip="01:30 PM")
txt1330 = input.string ("AFTERNOON", title="", inline="AFTOPP", group="Opening Price Lines")
// Opening Price Color
MOPColP = input.color (color.new(#787b86, 0), "", inline="MOPP", group="Opening Price Lines")
NYOPColP = input.color (color.new(#787b86, 0), "", inline="NYOPP", group="Opening Price Lines")
EOPColP = input.color (color.new(#787b86, 0), "", inline="EOPP", group="Opening Price Lines")
AFTOPColP = input.color (color.new(#787b86, 0), "", inline="AFTOPP", group="Opening Price Lines")
// Opening Price LineStyle
MOPLS = input.string ("Dotted", "", options= , inline="MOPP", group="Opening Price Lines")
NYOPLS = input.string ("Dotted", "", options= , inline="NYOPP", group="Opening Price Lines")
EOPLS = input.string ("Dotted", "", options= , inline="EOPP", group="Opening Price Lines")
AFTOPLS = input.string ("Dotted", "", options= , inline="AFTOPP", group="Opening Price Lines")
// Opening Price LineWidth
i_MOPLW = input.string ("1px", "", options= , inline="MOPP", group="Opening Price Lines")
i_NYOPLW = input.string ("1px", "", options= , inline="NYOPP", group="Opening Price Lines")
i_EOPLW = input.string ("1px", "", options= , inline="EOPP", group="Opening Price Lines")
i_AFTOPLW = input.string ("1px", "", options= , inline="AFTOPP", group="Opening Price Lines")
//----------------------------------------------
// W&M Bool
ShowWeekOpen = input.bool (defval=false, title="", tooltip="Draw Weekly Open Price Line", group="HTF Opening Price Lines", inline="WO")
showMonthOpen = input.bool (defval=false, title="", tooltip="Draw Monthly Open Price Line", group="HTF Opening Price Lines", inline="MO")
// W&M String
txt19 = input.string ("WEEKLY", title="", inline="WO", group="HTF Opening Price Lines")
txt20 = input.string ("MONTHLY", title="", inline="MO", group="HTF Opening Price Lines")
// W&M Color
i_WeekOpenCol = input.color (title="", defval=color.new(#787b86, 0), group="HTF Opening Price Lines", inline="WO")
i_MonthOpenCol = input.color (title="", tooltip="", defval=color.new(#787b86, 0), group="HTF Opening Price Lines", inline="MO")
// W&M LineStyle
WOLS = input.string ("Dotted", "", options= , inline="WO", group="HTF Opening Price Lines")
MOLS = input.string ("Dotted", "", options= , inline="MO", group="HTF Opening Price Lines")
// W&M LineWidth
i_WOPLW = input.string ("1px", "", options= , inline="WO", group="HTF Opening Price Lines")
i_MONPLW = input.string ("1px", "", options= , inline="MO", group="HTF Opening Price Lines")
//----------------------------------------------
// CBDR, ASIA & FLOUT
ShowCBDR = input.bool (true, "", inline='CBDR', group="CBDR, ASIA & FLOUT")
ShowASIA = input.bool (true, "", inline='ASIA', group="CBDR, ASIA & FLOUT")
ShowFLOUT = input.bool (false, "", inline='FLOUT', group="CBDR, ASIA & FLOUT")
// Strings
txt0 = input.string ("CBDR", title="", inline="CBDR", group="CBDR, ASIA & FLOUT", tooltip="16:00 to 20:00 SD Increments of 1")
txt1 = input.string ("ASIA", title="", inline="ASIA", group="CBDR, ASIA & FLOUT", tooltip="20:00 to 00:00 SD Increments of 1")
txt7 = input.string ("FLOUT", title="", inline="FLOUT", group="CBDR, ASIA & FLOUT", tooltip="16:00 to 00:00 SD Increments of 0.5")
// Color
CBDRBoxCol = input.color (color.new(#787b86, 0),"", inline='CBDR', group="CBDR, ASIA & FLOUT")
ASIABoxCol = input.color (color.new(#787b86, 0), "", inline='ASIA', group="CBDR, ASIA & FLOUT")
FLOUTBoxCol = input.color (color.new(#787b86, 0),"", inline='FLOUT', group="CBDR, ASIA & FLOUT")
// Extras
box_text_cbdr = input.bool (true, "Show Text", inline="CBDR", group="CBDR, ASIA & FLOUT")
box_text_cbdr_col = input.color (color.new(color.gray, 80), "", inline="CBDR", group="CBDR, ASIA & FLOUT")
bool_cbdr_dev = input.bool (true, "SD", inline="CBDR", group="CBDR, ASIA & FLOUT")
box_text_asia = input.bool (true, "Show Text", inline="ASIA", group="CBDR, ASIA & FLOUT")
box_text_asia_col = input.color (color.new(color.gray, 80), "", inline="ASIA", group="CBDR, ASIA & FLOUT")
bool_asia_dev = input.bool (true, "SD", inline="ASIA", group="CBDR, ASIA & FLOUT")
box_text_flout = input.bool (true, "Show Text", inline="FLOUT", group="CBDR, ASIA & FLOUT")
box_text_flout_col = input.color (color.new(color.gray, 80), "", inline="FLOUT", group="CBDR, ASIA & FLOUT")
bool_flout_dev = input.bool (true, "SD", inline="FLOUT", group="CBDR, ASIA & FLOUT")
// Table
// SD Lines
ShowDevLN = input.bool (title="", defval=true, inline="DEVLN", group="Standard Deviation", tooltip="Deviation Lines")
DEVLNTXT = input.string ("SD LINES", title="", inline="DEVLN", group="Standard Deviation")
DevLNCol = input.color (color.new(#787b86, 0), "", inline="DEVLN", group="Standard Deviation")
DEVLS = input.string ("Solid", "", options= , inline="DEVLN", group="Standard Deviation")
i_DEVLW = input.string ("1px", "", options= , inline="DEVLN", group="Standard Deviation")
DEVLSS = DEVLS=="Solid" ? line.style_solid : DEVLS == "Dotted" ? line.style_dotted : line.style_dashed
DEVLW = i_DEVLW=="1px" ? 1 : i_DEVLW == "2px" ? 2 : i_DEVLW == "3px" ? 3 : i_DEVLW == "4px" ? 4 : 5
ShowDev = input.bool (false, '', inline="DEV", group="Standard Deviation")
txt8 = input.string ("SD COUNT", title="", inline="DEV", group="Standard Deviation")
SDCountCol = input.color (color.new(#787b86, 0), "", inline="DEV", group="Standard Deviation")
DevInput = input.string ("2 SD", "", options= , inline="DEV", group="Standard Deviation")
DevDirection = input.string ("Both", "", options= , inline="DEV", group="Standard Deviation", tooltip="SD Count, NULL, SD Count, SD Direction")
DevCount = DevInput == "1 SD" ? 1 : DevInput == "2 SD" ? 2 : DevInput == "3 SD" ? 3 : 4
Auto_Select = input.bool (false, "", group="Standard Deviation", inline="AUTOSD", tooltip="Auto SD Selection | Charter Content, Range Table Might Bug Out On Mondays" )
txtSD = input.string ("AUTO SD", "", group="Standard Deviation", inline="AUTOSD")
Tab1txtCol = input.color (color.new(#808080, 0), "", inline='AUTOSD', group="Standard Deviation")
TabOptionShow = input.string ("Show Table", "", options= , inline="AUTOSD", group="Standard Deviation")
Stats = TabOptionShow == "Show Table" ? true : false
TabOption1 = input.string ("Top Right", "", options= , inline="AUTOSD", group="Standard Deviation")
tabinp1 = TabOption1 == "Top Left" ? position.top_left : TabOption1 == "Top Center" ? position.top_center : TabOption1 == "Top Right" ? position.top_right : TabOption1 == "Middle Left" ? position.middle_left : TabOption1 == "Middle Right" ? position.middle_right : TabOption1 == "Bottom Left" ? position.bottom_left : TabOption1 == "Bottom Center" ? position.bottom_center : position.bottom_right
L_Prof = true
CellBG = color.new(#131722, 100)
//----------------------------------------------
// Day Of Week & Labels
// Label Settings Inputs
ShowLabel = input.bool (true, title="", inline="Glabel", group="Day Of Week & Labels")
txt21 = input.string ("LABEL", title="", inline="Glabel", group="Day Of Week & Labels")
LabelColor = input.color (color.rgb(0,0,0,100), "", inline="Glabel", group="Day Of Week & Labels")
LabelSizeInput = input.string ("Normal", "", options= , inline="Glabel", group="Day Of Week & Labels")
Terminusinp = input.string ("Terminus @ Current Time +1hr", "", options = , inline="Glabel", group="Day Of Week & Labels", tooltip="Select Label Size & Color & Terminus Historical Price Lines needs to be toggled off for using Terminus")
ShowLabelText = input.bool (true, title="", inline="label", group="Day Of Week & Labels")
txt22 = input.string ("LABEL TEXT", title="", inline="label", group="Day Of Week & Labels")
LabelTextColor = input.color (color.new(#787b86, 0), title="", inline="label", group="Day Of Week & Labels")
LabelTextOptioninput = input.string ("Time", "", options= , inline="label", group="Day Of Week & Labels", tooltip="Choose Between Descriptive Text as Label or Time Show/Hide Prices on Labels")
ShowPricesBool = input.string ("Hide Prices", title="", options= , group="Day Of Week & Labels", inline="label")
ShowPrices = ShowPricesBool == "Show Prices" ? true : false
showDOW = input.bool (true, title="", inline="DOW", group="Day Of Week & Labels")
txt24 = input.string ("DAY OF WEEK", title="", inline="DOW", group="Day Of Week & Labels")
i_DOWCol = input.color (color.new(#787b86, 0), title="", inline="DOW", group="Day Of Week & Labels")
DOWTime = input.int (defval = 12, title="", inline="DOW", group="Day Of Week & Labels")
DOWLoc_inpt = input.string ("Bottom", "", options = , inline="DOW", group="Day Of Week & Labels", tooltip="DOW Color, Time Alignment, Vertical Location")
DOWLoc = DOWLoc_inpt == "Bottom" ? location.bottom : location.top
//----------------------------------------------
BIAS_M_Bool = input.bool (false, "", group="BIAS & NOTES PRECONFIG", inline="stats")
txt100 = input.string ("BIAS", title="", inline="stats", group="BIAS & NOTES PRECONFIG")
TableBG2 = color.new(#131722, 100)
Tab2txtCol = input.color (color.new(#787b86, 0), "", inline='stats', group="BIAS & NOTES PRECONFIG")
TabOption2 = input.string ("Bottom Right", "", options= , inline="stats", group="BIAS & NOTES PRECONFIG")
tabinp2 = TabOption2 == "Top Left" ? position.top_left : TabOption2 == "Top Center" ? position.top_center : TabOption2 == "Top Right" ? position.top_right : TabOption2 == "Middle Left" ? position.middle_left : TabOption2 == "Middle Right" ? position.middle_right : TabOption2 == "Bottom Left" ? position.bottom_left : TabOption2 == "Bottom Center" ? position.bottom_center : position.bottom_right
notesbool = false
NOTES_M_Bool = input.bool (true, "", group="BIAS & NOTES PRECONFIG", inline="stats2")
txt101 = input.string ("NOTES", title="", inline="stats2", group="BIAS & NOTES PRECONFIG")
Tab3txtCol = input.color (color.new(#787b86, 0), "", inline='stats2', group="BIAS & NOTES PRECONFIG")
TabOption3 = input.string ("Top Center", "", options= , inline="stats2", group="BIAS & NOTES PRECONFIG")
tabinp3 = TabOption3 == "Top Left" ? position.top_left : TabOption3 == "Top Center" ? position.top_center : TabOption3 == "Top Right" ? position.top_right : TabOption3 == "Middle Left" ? position.middle_left : TabOption3 == "Middle Right" ? position.middle_right : TabOption3 == "Bottom Left" ? position.bottom_left : TabOption3 == "Bottom Center" ? position.bottom_center : position.bottom_right
BIASbool1 = input.bool (true, '', inline="BIAS1", group="BIAS & NOTES")
txt52 = input.string ("DXY ", title="", inline="BIAS1", group="BIAS & NOTES")
BIASOption1 = input.string ("Bullish", options= , title="", inline="BIAS1", group="BIAS & NOTES")
BIASbool2 = input.bool (true, '', inline="BIAS2", group="BIAS & NOTES")
txt53 = input.string ("EURGBP ", title="", inline="BIAS2", group="BIAS & NOTES")
BIASOption2 = input.string ("Bearish", options= , title="", inline="BIAS2", group="BIAS & NOTES")
BIASbool3 = input.bool (true, '', inline="BIAS3", group="BIAS & NOTES")
txt54 = input.string ("AUDNZD ", title="", inline="BIAS3", group="BIAS & NOTES")
BIASOption3 = input.string ("Bullish", options= , title="", inline="BIAS3", group="BIAS & NOTES")
BIASbool4 = input.bool (true, '', inline="BIAS4", group="BIAS & NOTES")
txt55 = input.string ("NASDAQ ", title="", inline="BIAS4", group="BIAS & NOTES")
BIASOption4 = input.string ("Bearish", options= , title="", inline="BIAS4", group="BIAS & NOTES")
notes = input.text_area ("@coldbrewrosh", "Notes", group = "BIAS & NOTES")
//--------------------END OF INPUTS--------------------//
// Pre-Def
DOM = (timeframe.multiplier <= inputMaxInterval) and (timeframe.isintraday)
newDay = ta.change(dayofweek)
newWeek = ta.change(weekofyear)
newMonth = ta.change(time("M"))
transparentcol = color.rgb(255,255,255,100)
LSVLC = color.rgb(255,255,255,100)
NYSVLC = color.rgb(255,255,255,100)
PMSVLC = color.rgb(255,255,255,100)
ASVLC = color.rgb(255,255,255,100)
LSVLS = "dotted"
NYSVLS = "dotted"
PMSVLS = "dotted"
ASVLS = "dotted"
// Functions
isToday = false
if year(timenow) == year(time) and month(timenow) == month(time) and dayofmonth(timenow) == dayofmonth(time)
isToday := true
// Current Week
thisweek = year(timenow) == year(time) and weekofyear(timenow) == weekofyear(time)
LastOneWeek = year(timenow) == year(time) and weekofyear(timenow-604800000) == weekofyear(time)
LastTwoWeek = year(timenow) == year(time) and weekofyear(timenow-1209600000) == weekofyear(time)
LastThreeWeek = year(timenow) == year(time) and weekofyear(timenow-1814400000) == weekofyear(time)
LastFourWeek = year(timenow) == year(time) and weekofyear(timenow-2419200000) == weekofyear(time)
Last4Weeks = false
if thisweek == true or LastOneWeek == true or LastTwoWeek == true or LastThreeWeek == true or LastFourWeek == true
Last4Weeks := true
// Function to draw Vertical Lines
vline(Start, Color, linestyle, LineWidth) =>
line.new(x1=Start, y1=low - ta.tr, x2=Start, y2=high + ta.tr, xloc=xloc.bar_time, extend=extend.both, color=Color, style=linestyle, width=LineWidth)
// Function to convert forex pips into whole numbers
atr = ta.atr(14)
toWhole(number) =>
if syminfo.type == "forex" // This method only works on forex pairs
_return = atr < 1.0 ? (number / syminfo.mintick) / 10 : number
_return := atr >= 1.0 and atr < 100.0 and syminfo.currency == "JPY" ? _return * 100 : _return
else
number
// Function for determining the Start of a Session (taken from the Pinescript manual: tradingview.sweetlogin.com )
SessionBegins(sess) =>
t = time("", sess , Timezone)
DOM and (not barstate.isfirst) and na(t ) and not na(t)
// BarIn Session
BarInSession(sess) =>
time(timeframe.period, sess, Timezone) != 0
// Label Type Logic
var SFistrue = true
if LabelTextOptioninput == "Time"
SFistrue := true
else
SFistrue := false
// Session String to int
SeshStartHour(Session) =>
math.round(str.tonumber(str.substring(Session,0,2)))
SeshStartMins(Session) =>
math.round(str.tonumber(str.substring(Session,2,4)))
SeshEndHour(Session) =>
math.round(str.tonumber(str.substring(Session,5,7)))
SeshEndMins(Session) =>
math.round(str.tonumber(str.substring(Session,7,9)))
// Time periods
CBDR = "1600-2000:1234567"
ASIA = "2000-0000:1234567"
FLOUT = "1600-0000:1234567"
midsesh = "0000-1600:1234567"
cbdrOpenTime = timestamp (Timezone, year, month, dayofmonth, SeshStartHour(CBDR), SeshStartMins(CBDR), 00)
cbdrEndTime = timestamp (Timezone, year, month, dayofmonth, SeshEndHour(CBDR), SeshEndMins(CBDR), 00)
asiaOpenTime = timestamp (Timezone, year, month, dayofmonth, SeshStartHour(ASIA), SeshStartMins(ASIA), 00)
asiaEndTime = timestamp (Timezone, year, month, dayofmonth, SeshEndHour(ASIA), SeshEndMins(ASIA), 00)+86400000
floutOpenTime = timestamp (Timezone, year, month, dayofmonth, SeshStartHour(FLOUT), SeshStartMins(FLOUT), 00)
floutEndTime = timestamp (Timezone, year, month, dayofmonth, SeshEndHour(FLOUT), SeshEndMins(FLOUT), 00)+86400000
CBDRTime = time (timeframe.period, CBDR, Timezone)
ASIATime = time (timeframe.period, ASIA, Timezone)
FLOUTTime = time (timeframe.period, FLOUT, Timezone)
LabelOnlyToday = true
// Time Periods
LondonStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(LDNsesh), SeshStartMins(LDNsesh), 00)
LondonEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(LDNsesh), SeshEndMins(LDNsesh), 00)
NYStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(NYsesh), SeshStartMins(NYsesh), 00)
NYEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(NYsesh), SeshEndMins(NYsesh), 00)
LCStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(LCsesh), SeshStartMins(LCsesh), 00)
LCEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(LCsesh), SeshEndMins(LCsesh), 00)
PMStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(PMsesh), SeshStartMins(PMsesh), 00)
PMEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(PMsesh), SeshEndMins(PMsesh), 00)
AsianStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(ASIA2sesh), SeshStartMins(ASIA2sesh), 00)
AsianEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(ASIA2sesh), SeshEndMins(ASIA2sesh), 00)
FreeStartTime = timestamp(Timezone, year, month, dayofmonth, SeshStartHour(FreeSesh), SeshStartMins(FreeSesh), 00)
FreeEndTime = timestamp(Timezone, year, month, dayofmonth, SeshEndHour(FreeSesh), SeshEndMins(FreeSesh), 00)
MidnightOpenTime = timestamp(Timezone, year, month, dayofmonth, 0, 0, 00)
CLEANUPTIME = timestamp(Timezone, year, month, dayofmonth, 0, 0, 00) - 16200000
LondonOpenTime = timestamp(Timezone, year, month, dayofmonth, 3, 0, 00)
NYOpenTime = timestamp(Timezone, year, month, dayofmonth, 8, 30, 00)
EquitiesOpenTime = timestamp(Timezone, year, month, dayofmonth, 9, 30, 00)
AfternoonOpenTime = timestamp(Timezone, year, month, dayofmonth, 13, 30, 00)
tMidnight = time("1", "0000-0001:1234567", Timezone)
// Cleanup - Remove old drawing objects
Cleanup(days) =>
// Delete old drawing objects
// One day is 86400000 milliseconds
removal_timestamp = (CLEANUPTIME) - (days * 86400000) // Remove every drawing object older than the start of the Today's Midnight
a_allLines = line.all
a_allLabels = label.all
a_allboxes = box.all
// Remove old lines
if array.size(a_allLines) > 0
for i = 0 to array.size(a_allLines) - 1
line_x2 = line.get_x2(array.get(a_allLines, i))
if line_x2 < (removal_timestamp)
line.delete(array.get(a_allLines, i))
// Remove old labels
if array.size(a_allLabels) > 0
for i = 0 to array.size(a_allLabels) - 1
label_x = label.get_x(array.get(a_allLabels, i))
if label_x < removal_timestamp
label.delete(array.get(a_allLabels, i))
// Remove old boxes
if array.size(a_allboxes) > 0
for i = 0 to array.size(a_allboxes) - 1
box_x = box.get_right(array.get(a_allboxes, i))
if box_x < (removal_timestamp - 86400000)
box.delete(array.get(a_allboxes, i))
// End of Cleanup function
// Terminus Function
Terminus(Terminus_Inp)=>
if Terminus_Inp == "Terminus @ Current Time"
_return = timenow
else if Terminus_Inp == "Terminus @ Current Time +15min"
_return = timenow + 900000
else if Terminus_Inp == "Terminus @ Current Time +30min"
_return = timenow + 1800000
else if Terminus_Inp == "Terminus @ Current Time +45min"
_return = timenow + 2700000
else if Terminus_Inp == "Terminus @ Current Time +1hr"
_return = timenow + 3600000
else if Terminus_Inp == "Terminus @ Current Time +2hr"
_return = timenow + 7200000
else
_return = timenow + 10800000
// Linestyle Function
MNOPLS = Midnight_Open_LS=="Solid" ? line.style_solid : Midnight_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
LNOPLS = london_Open_LS=="Solid" ? line.style_solid : london_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
NWYOPLS = NY_Open_LS=="Solid" ? line.style_solid : NY_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
EQOPLS = Equities_Open_LS=="Solid" ? line.style_solid : Equities_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
MOPLSS = MOPLS=="Solid" ? line.style_solid : MOPLS == "Dotted" ? line.style_dotted : line.style_dashed
NYOPLSS = NYOPLS=="Solid" ? line.style_solid : NYOPLS == "Dotted" ? line.style_dotted : line.style_dashed
EOPLSS = EOPLS=="Solid" ? line.style_solid : EOPLS == "Dotted" ? line.style_dotted : line.style_dashed
AFTOPLSS = AFTOPLS=="Solid" ? line.style_solid : AFTOPLS == "Dotted" ? line.style_dotted : line.style_dashed
WeekOpenLS = WOLS=="Solid" ? line.style_solid : WOLS == "Dotted" ? line.style_dotted : line.style_dashed
MonthOpenLS = MOLS=="Solid" ? line.style_solid : MOLS == "Dotted" ? line.style_dotted : line.style_dashed
// Linewidth Function
MOPLW = Midnight_Open_LW=="1px" ? 1 : Midnight_Open_LW == "2px" ? 2 : Midnight_Open_LW == "3px" ? 3 : Midnight_Open_LW == "4px" ? 4 : 5
LOPLW = London_Open_LW=="1px" ? 1 : London_Open_LW == "2px" ? 2 : London_Open_LW == "3px" ? 3 : London_Open_LW == "4px" ? 4 : 5
NYOPLW = NY_Open_LW=="1px" ? 1 : NY_Open_LW == "2px" ? 2 : NY_Open_LW == "3px" ? 3 : NY_Open_LW == "4px" ? 4 : 5
EOPLW = Equities_Open_LW=="1px" ? 1 : Equities_Open_LW == "2px" ? 2 : Equities_Open_LW == "3px" ? 3 : Equities_Open_LW == "4px" ? 4 : 5
MOPPLW = i_MOPLW=="1px" ? 1 : i_MOPLW == "2px" ? 2 : i_MOPLW == "3px" ? 3 : i_MOPLW == "4px" ? 4 : 5
NYOPPLW = i_NYOPLW=="1px" ? 1 : i_NYOPLW == "2px" ? 2 : i_NYOPLW == "3px" ? 3 : i_NYOPLW == "4px" ? 4 : 5
EOPPLW = i_EOPLW=="1px" ? 1 : i_EOPLW == "2px" ? 2 : i_EOPLW == "3px" ? 3 : i_EOPLW == "4px" ? 4 : 5
AFTOPLW = i_AFTOPLW=="1px" ? 1 : i_AFTOPLW == "2px" ? 2 : i_AFTOPLW == "3px" ? 3 : i_AFTOPLW == "4px" ? 4 : 5
WEEKOPPLW = i_WOPLW=="1px" ? 1 : i_WOPLW == "2px" ? 2 : i_WOPLW == "3px" ? 3 : i_WOPLW == "4px" ? 4 : 5
MONTHOPPLW = i_MONPLW=="1px" ? 1 : i_MONPLW == "2px" ? 2 : i_MONPLW == "3px" ? 3 : i_MONPLW == "4px" ? 4 : 5
// Label Size Function
LabelSize =LabelSizeInput=="Auto" ? size.auto : LabelSizeInput=="Tiny" ? size.tiny : LabelSizeInput=="Small" ? size.small : LabelSizeInput=="Normal" ? size.normal : LabelSizeInput=="Large" ? size.large : size.huge
// Creating Variables
var London_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=LSVLC, width=1)
var London_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=LSVLC, width=1)
var LondonFill = linefill.new(London_Start_Vline, London_End_Vline, LSFC)
var NY_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var NY_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var NYFill = linefill.new(NY_Start_Vline, NY_End_Vline, NYSFC)
var LC_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var LC_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYSVLC, width=1)
var LCFill = linefill.new(LC_Start_Vline, LC_End_Vline, LCSFC)
var PM_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=PMSVLC, width=1)
var PM_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=PMSVLC, width=1)
var PMFill = linefill.new(PM_Start_Vline, PM_End_Vline, PMSFC)
var Asian_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var Asian_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var AsianFill = linefill.new(Asian_Start_Vline, Asian_End_Vline, ASFC)
var Free_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var Free_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=ASVLC, width=1)
var FreeFill = linefill.new(Free_Start_Vline, Free_End_Vline, FSFC)
var Midnight_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=MOPColor, width=1)
var London_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=LOPColor, width=1)
var NY_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=NYOPColor, width=1)
var Equities_Open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=EOPColor, width=1)
// When a New Day Starts, Start Drawing all lines
if newDay and dayofweek != dayofweek.sunday
// London Session
if (ShowLondon and DOM)
if ShowTSO
line.delete(London_Start_Vline )
line.delete(London_End_Vline )
linefill.delete(LondonFill )
London_Start_Vline := vline(LondonStartTime,transparentcol, line.style_solid, 1)
London_End_Vline := vline(LondonEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
LondonFill := linefill.new(London_Start_Vline, London_End_Vline, LSFC)
// New York Session
if (ShowNY and DOM)
if ShowTSO
line.delete(NY_Start_Vline )
line.delete(NY_End_Vline )
linefill.delete(NYFill )
NY_Start_Vline := vline(NYStartTime, transparentcol, line.style_solid, 1)
NY_End_Vline := vline(NYEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
NYFill := linefill.new(NY_Start_Vline, NY_End_Vline, NYSFC)
// London Close
if (ShowLC and DOM)
if ShowTSO
line.delete(LC_End_Vline )
linefill.delete(LCFill )
LC_Start_Vline := vline(LCStartTime, transparentcol, line.style_solid, 1)
LC_End_Vline := vline(LCEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
LCFill := linefill.new(LC_Start_Vline, LC_End_Vline, LCSFC)
// PM Session
if (ShowPM and DOM)
if ShowTSO
line.delete(PM_Start_Vline )
line.delete(PM_End_Vline )
linefill.delete(PMFill )
PM_Start_Vline := vline(PMStartTime, transparentcol, line.style_solid, 1)
PM_End_Vline := vline(PMEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
PMFill := linefill.new(PM_Start_Vline, PM_End_Vline, PMSFC)
// Asian Session
if (ShowAsian and DOM)
if ShowTSO
line.delete(Asian_Start_Vline )
line.delete(Asian_End_Vline )
linefill.delete(AsianFill )
Asian_Start_Vline := vline(AsianStartTime, transparentcol, line.style_solid, 1)
Asian_End_Vline := vline(AsianEndTime, transparentcol, line.style_solid, 1)
// if dayofweek == dayofweek.friday
// // line.delete(Asian_Start_Vline)
// // line.delete(Asian_End_Vline)
// Asian_Start_Vline := vline(MidnightOpenTime+244800000, transparentcol, line.style_solid, 1)
// Asian_End_Vline := vline(MidnightOpenTime+259200000, transparentcol, line.style_solid, 1)
if ShowSFill
AsianFill := linefill.new(Asian_Start_Vline, Asian_End_Vline, ASFC)
// Free Session
if (ShowFreeSesh and DOM)
if ShowTSO
line.delete(Free_Start_Vline )
line.delete(Free_End_Vline )
linefill.delete(FreeFill )
Free_Start_Vline := vline(FreeStartTime, transparentcol, line.style_solid, 1)
Free_End_Vline := vline(FreeEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
FreeFill := linefill.new(Free_Start_Vline, Free_End_Vline, FSFC)
// Midnight Opening Price
if (ShowMOP and DOM)
if MOLHist == false
line.delete(Midnight_Open )
Midnight_Open := vline(MidnightOpenTime, MOPColor, MNOPLS, MOPLW)
// London Opening Price
if (ShowLOP and DOM)
if ShowTSO
line.delete(London_Open )
London_Open := vline(LondonOpenTime, LOPColor, LNOPLS, LOPLW)
// New York Opening Price
if (ShowNYOP and DOM)
if ShowTSO
line.delete(NY_Open )
NY_Open := vline(NYOpenTime, NYOPColor, NWYOPLS, NYOPLW)
// Equities Opening Price
if (ShowEOP and DOM)
if ShowTSO
line.delete(Equities_Open )
Equities_Open := vline(EquitiesOpenTime, EOPColor, EQOPLS, EOPLW)
// Variables
var label MOPLB = na
var line MOPLN = na
var label NYOPLB = na
var line NYOPLN = na
var label EOPLB = na
var line EOPLN = na
var line AFTLN = na
var label AFTLB = na
// New York Midnight Open Price line
var openMidnight = 0.0
if tMidnight
if not tMidnight
openMidnight := open
else
openMidnight := math.max(open, openMidnight)
if (ShowMOPP and (openMidnight != openMidnight ) and DOM and barstate.isconfirmed)
label.delete(MOPLB )
if ShowMOPL == false
line.delete(MOPLN )
MOPLN := line.new(x1=tMidnight, y1=openMidnight, x2=tMidnight+86400000, xloc=xloc.bar_time, y2=openMidnight, color=MOPColP, style=MOPLSS, width=MOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(MOPLN, tMidnight+259200000)
if ShowLabel
MOPLB := label.new(x=tMidnight+86400000, y=openMidnight, xloc=xloc.bar_time, color=LabelColor, textcolor=MOPColP, style=label.style_label_left, size=LabelSize, tooltip="Midnight Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(MOPLB, tMidnight+259200000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(MOPLB, " 00:00 | " + str.tostring(open))
else
label.set_text(MOPLB, " 00:00 ")
label.set_tooltip(MOPLB, "Midnight Opening Price")
else
if ShowPrices == true
label.set_text(MOPLB, " Midnight Opening Price | " + str.tostring(open))
else
label.set_text(MOPLB, " Midnight Opening Price ")
label.set_tooltip(MOPLB, "")
label.set_textcolor(MOPLB, LabelTextColor)
label.set_size(MOPLB,LabelSize)
if time > PMEndTime and time < (MidnightOpenTime + 86400000)
line.delete(MOPLN )
if Terminusinp != "Terminus @ Next Midnight" and ShowMOPL == false
line.set_x2(MOPLN, Terminus(Terminusinp))
label.set_x(MOPLB, Terminus(Terminusinp))
// New York Opening Price Line
if (ShowNYOPP and (time == NYOpenTime) and DOM)
label.delete(NYOPLB )
if ShowPrev == false
line.delete(NYOPLN )
NYOPLN := line.new(x1=NYOpenTime, y1=open, x2=NYOpenTime+55800000, xloc=xloc.bar_time, y2=open, color=NYOPColP, style=NYOPLSS, width=NYOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(NYOPLN, NYOpenTime+228600000)
if ShowLabel
NYOPLB := label.new(x=NYOpenTime+55800000, y=open, xloc=xloc.bar_time, color=LabelColor, textcolor=NYOPColP, style=label.style_label_left, size=LabelSize, tooltip="New York Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(NYOPLB, NYOpenTime+228600000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(NYOPLB, " 08:30 | " + str.tostring(open))
else
label.set_text(NYOPLB, " 08:30 ")
label.set_tooltip(NYOPLB, "New York Opening Price")
else
if ShowPrices == true
label.set_text(NYOPLB, " New York Opening Price | " + str.tostring(open))
else
label.set_text(NYOPLB, " New York Opening Price ")
label.set_tooltip(NYOPLB, "")
label.set_textcolor(NYOPLB, LabelTextColor)
label.set_size(NYOPLB,LabelSize)
if Terminusinp != "Terminus @ Next Midnight" and ShowPrev == false
line.set_x2(NYOPLN, Terminus(Terminusinp))
label.set_x(NYOPLB, Terminus(Terminusinp))
// Equities Opening Price Line
if (ShowEOPP and (time == EquitiesOpenTime) and DOM)
label.delete(EOPLB )
if ShowPrev == false
line.delete(EOPLN )
EOPLN := line.new(x1=EquitiesOpenTime, y1=open, x2=EquitiesOpenTime+52200000, xloc=xloc.bar_time, y2=open, color=EOPColP, style=EOPLSS, width=EOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(EOPLN, EquitiesOpenTime+225000000)
if ShowLabel
EOPLB := label.new(x=EquitiesOpenTime+52200000, y=open, xloc=xloc.bar_time, color=LabelColor, textcolor=EOPColP, style=label.style_label_left, size=LabelSize, tooltip="Equities Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(EOPLB, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(EOPLB, " 09:30 | " + str.tostring(open))
else
label.set_text(EOPLB, " 09:30 ")
label.set_tooltip(EOPLB, "Equities Opening Price")
else
if ShowPrices == true
label.set_text(EOPLB, " Equities Opening Price | " + str.tostring(open))
else
label.set_text(EOPLB, " Equities Opening Price ")
label.set_tooltip(EOPLB, "")
label.set_textcolor(EOPLB, LabelTextColor)
label.set_size(EOPLB,LabelSize)
if Terminusinp != "Terminus @ Next Midnight" and ShowPrev == false
line.set_x2(EOPLN, Terminus(Terminusinp))
label.set_x(EOPLB, Terminus(Terminusinp))
// Afternoon Opening Price Line
if (ShowAFTPP and (time == AfternoonOpenTime) and DOM)
label.delete(AFTLB )
if ShowPrev == false
line.delete(AFTLN )
AFTLN := line.new(x1=AfternoonOpenTime, y1=open, x2=EquitiesOpenTime+52200000, xloc=xloc.bar_time, y2=open, color=AFTOPColP, style=AFTOPLSS, width=AFTOPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(AFTLN, EquitiesOpenTime+225000000)
if ShowLabel
AFTLB := label.new(x=EquitiesOpenTime+52200000, y=open, xloc=xloc.bar_time, color=LabelColor, textcolor=AFTOPColP, style=label.style_label_left, size=LabelSize, tooltip="Equities Opening Price")
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(AFTLB, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(AFTLB, " 01:30 | " + str.tostring(open))
else
label.set_text(AFTLB, " 01:30 ")
label.set_tooltip(AFTLB, " Afternoon Opening Price")
else
if ShowPrices == true
label.set_text(AFTLB, " Afternoon Opening Price | " + str.tostring(open))
else
label.set_text(AFTLB, " Afternoon Opening Price ")
label.set_tooltip(AFTLB, "")
label.set_textcolor(AFTLB, LabelTextColor)
label.set_size(AFTLB,LabelSize)
if Terminusinp != "Terminus @ Next Midnight" and ShowPrev == false
line.set_x2(AFTLN, Terminus(Terminusinp))
label.set_x(AFTLB, Terminus(Terminusinp))
// HTF Variables
var Weekly_open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=i_WeekOpenCol, style=WeekOpenLS, width=1)
var Weekly_openlbl = label.new(x=na, y=na, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize)
var WeeklyOpenTime = time
var Monthly_open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close, color=i_MonthOpenCol, style=MonthOpenLS, width=1)
var Monthly_openlbl = label.new(x=na, y=na, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize)
var MonthlyOpenTime = time
// Get HTF Price levels
WeeklyOpen = request.security(syminfo.tickerid, "W", open, lookahead = barmerge.lookahead_on)
MonthlyOpen = request.security(syminfo.tickerid, "M", open, lookahead = barmerge.lookahead_on)
// Weekly Open
if newWeek
WeeklyOpenTime := time
if ShowWeekOpen and newDay and Last4Weeks
label.delete(Weekly_openlbl )
line.delete(Weekly_open )
// if ShowPrev == false
// line.delete(Weekly_open )
Weekly_open:= line.new(x1=WeeklyOpenTime-25200000, y1=WeeklyOpen, x2=EquitiesOpenTime+52200000, xloc=xloc.bar_time, y2=WeeklyOpen, color=i_WeekOpenCol, style=WeekOpenLS, width=WEEKOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(Weekly_open, EquitiesOpenTime+225000000)
if ShowLabel
Weekly_openlbl := label.new(x=EquitiesOpenTime+52200000, y=WeeklyOpen, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize, tooltip="Weekly Open: " + str.tostring(WeeklyOpen))
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(Weekly_openlbl, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(Weekly_openlbl," W.O. | " + str.tostring(WeeklyOpen))
else
label.set_text(Weekly_openlbl," W.O. ")
label.set_tooltip(Weekly_openlbl, " Weekly Opening Price ")
else
if ShowPrices == true
label.set_text(Weekly_openlbl," Weekly Open | " + str.tostring(WeeklyOpen))
else
label.set_text(Weekly_openlbl," Weekly Open ")
label.set_tooltip(Weekly_openlbl, "")
label.set_textcolor(Weekly_openlbl, LabelTextColor)
label.set_size(Weekly_openlbl, LabelSize)
if timeframe.multiplier > 60
line.set_x2(Weekly_open, AsianEndTime + 232000000)
label.set_x(Weekly_openlbl, AsianEndTime + 232000000)
if timeframe.period == "D"
line.set_x2(Weekly_open, AsianEndTime + 832000000)
label.set_x(Weekly_openlbl, AsianEndTime + 832000000)
if timeframe.period == "M"
line.delete(Weekly_open)
label.delete(Weekly_openlbl)
if Terminusinp != "Terminus @ Next Midnight" and DOM
line.set_x2(Weekly_open, Terminus(Terminusinp))
label.set_x(Weekly_openlbl, Terminus(Terminusinp))
// Monthly Open
if newMonth
MonthlyOpenTime := time
if showMonthOpen and newDay
line.delete(Monthly_open )
label.delete(Monthly_openlbl )
Monthly_open:= line.new(x1=MonthlyOpenTime, y1=MonthlyOpen, x2=AsianEndTime, xloc=xloc.bar_time, y2=MonthlyOpen, color=i_MonthOpenCol, style=MonthOpenLS, width=MONTHOPPLW)
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
line.set_x2(Monthly_open, EquitiesOpenTime+225000000)
if ShowLabel
Monthly_openlbl := label.new(x=AsianEndTime, y=MonthlyOpen, xloc=xloc.bar_time, color=LabelColor, textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize, tooltip="Monthly Open: " + str.tostring(MonthlyOpen))
if dayofweek == dayofweek.friday and syminfo.type != "crypto"
label.set_x(Monthly_openlbl, EquitiesOpenTime+225000000)
if ShowLabelText
if SFistrue
if ShowPrices == true
label.set_text(Monthly_openlbl," M.O. | " + str.tostring(MonthlyOpen))
else
label.set_text(Monthly_openlbl," M.O. ")
label.set_tooltip(Monthly_openlbl, " Monthly Opening Price ")
else
if ShowPrices == true
label.set_text(Monthly_openlbl, " Monthly Open | " + str.tostring(MonthlyOpen))
else
label.set_text(Monthly_openlbl, " Monthly Open ")
label.set_tooltip(Monthly_openlbl, "")
label.set_textcolor(Monthly_openlbl, LabelTextColor)
label.set_size(Monthly_openlbl, LabelSize)
if timeframe.multiplier > 60
line.set_x2(Monthly_open, AsianEndTime + 232000000)
label.set_x(Monthly_openlbl, AsianEndTime + 232000000)
if timeframe.period == "D"
line.set_x2(Monthly_open, AsianEndTime + 832000000)
label.set_x(Monthly_openlbl, AsianEndTime + 832000000)
if timeframe.period == "W"
line.set_x2(Monthly_open, AsianEndTime + 2592000000)
label.set_x(Monthly_openlbl, AsianEndTime + 2592000000)
if timeframe.period == "M"
line.delete(Monthly_open)
label.delete(Monthly_openlbl)
if Terminusinp != "Terminus @ Next Midnight" and DOM
line.set_x2(Monthly_open, Terminus(Terminusinp))
label.set_x(Monthly_openlbl, Terminus(Terminusinp))
// CBDR Stuff
var float cbdr_hi = na
var float cbdr_lo = na
var float cbdr_diff = na
var box cbdrbox = na
var line cbdr_hi_line = na
var line cbdr_lo_line = na
var line dev01negline = na
var line dev02negline = na
var line dev03negline = na
var line dev04negline = na
var line dev01posline = na
var line dev02posline = na
var line dev03posline = na
var line dev04posline = na
if SessionBegins(CBDR) and DOM
cbdr_hi := high
cbdr_lo := low
cbdr_diff := cbdr_hi - cbdr_lo
if ShowTSO
box.delete(cbdrbox )
line.delete(dev01posline )
line.delete(dev01negline )
line.delete(dev02posline )
line.delete(dev02negline )
line.delete(dev03posline )
line.delete(dev03negline )
line.delete(dev04posline )
line.delete(dev04negline )
if ShowCBDR
cbdrbox := box.new(cbdrOpenTime, cbdr_hi, cbdrEndTime, cbdr_lo, color.new(CBDRBoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time, color.new(CBDRBoxCol,90), txt0, size.auto, color.new(box_text_cbdr_col,80), text_wrap=text.wrap_auto)
if dayofweek == dayofweek.friday
box.set_right(cbdrbox, cbdrOpenTime+187200000)
line.set_x2(cbdr_hi_line, cbdrOpenTime+187200000)
line.set_x2(cbdr_lo_line, cbdrOpenTime+187200000)
if box_text_cbdr == false
box.set_text(cbdrbox, "")
if ShowDev and ShowCBDR and bool_cbdr_dev
for i = 1 to DevCount by 1
if i == 1
dev01posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_hi + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev01negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev01posline, cbdrOpenTime+187200000)
line.set_x2(dev01negline, cbdrOpenTime+187200000)
if i == 2
dev02posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_lo + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev02negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev02posline, cbdrOpenTime+187200000)
line.set_x2(dev02negline, cbdrOpenTime+187200000)
if i == 3
dev03posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_lo + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev03negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev03posline, cbdrOpenTime+187200000)
line.set_x2(dev03negline, cbdrOpenTime+187200000)
if i == 4
dev04posline := line.new(cbdrOpenTime, cbdr_hi + cbdr_diff * i, cbdrEndTime, cbdr_lo + cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev04negline := line.new(cbdrOpenTime, cbdr_hi - cbdr_diff * i, cbdrEndTime, cbdr_lo - cbdr_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev04posline, cbdrOpenTime+187200000)
line.set_x2(dev04negline, cbdrOpenTime+187200000)
else if CBDRTime
cbdr_hi := math.max(high, cbdr_hi)
cbdr_lo := math.min(low, cbdr_lo)
cbdr_diff := cbdr_hi - cbdr_lo
for i = 1 to DevCount by 1
if i == 1 and ShowDev
line.set_y1(dev01posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev01posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev01negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev01negline, cbdr_lo - cbdr_diff * i)
if i == 2 and ShowDev
line.set_y1(dev02posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev02posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev02negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev02negline, cbdr_lo - cbdr_diff * i)
if i == 3 and ShowDev
line.set_y1(dev03posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev03posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev03negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev03negline, cbdr_lo - cbdr_diff * i)
if i == 4 and ShowDev
line.set_y1(dev04posline, cbdr_hi + cbdr_diff * i)
line.set_y2(dev04posline, cbdr_hi + cbdr_diff * i)
line.set_y1(dev04negline, cbdr_lo - cbdr_diff * i)
line.set_y2(dev04negline, cbdr_lo - cbdr_diff * i)
if (cbdr_hi > cbdr_hi )
if ShowCBDR
box.set_top(cbdrbox, cbdr_hi)
if (cbdr_lo < cbdr_lo )
if ShowCBDR
box.set_bottom(cbdrbox, cbdr_lo)
if DevDirection == "Upside Only"
line.delete(dev01negline)
line.delete(dev02negline)
line.delete(dev03negline)
line.delete(dev04negline)
else if DevDirection == "Downside Only"
line.delete(dev01posline)
line.delete(dev02posline)
line.delete(dev03posline)
line.delete(dev04posline)
// ASIA Stuff
var float asia_hi = na
var float asia_lo = na
var float asia_diff = na
var box asia_box = na
var line asia_hi_line = na
var line asia_lo_line = na
var line dev01negline_asia = na
var line dev02negline_asia = na
var line dev03negline_asia = na
var line dev04negline_asia = na
var line dev01posline_asia = na
var line dev02posline_asia = na
var line dev03posline_asia = na
var line dev04posline_asia = na
if SessionBegins(ASIA) and DOM
asia_hi := high
asia_lo := low
asia_diff := asia_hi - asia_lo
if ShowTSO
box.delete(asia_box )
line.delete(dev01posline_asia )
line.delete(dev01negline_asia )
line.delete(dev02posline_asia )
line.delete(dev02negline_asia )
line.delete(dev03posline_asia )
line.delete(dev03negline_asia )
line.delete(dev04posline_asia )
line.delete(dev04negline_asia )
if ShowASIA
asia_box := box.new(asiaOpenTime, asia_hi, asiaEndTime, asia_lo, color.new(ASIABoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time, color.new(ASIABoxCol,90), txt1, size.auto, color.new(box_text_asia_col,80), text_wrap=text.wrap_auto)
if box_text_asia == false
box.set_text(asia_box, "")
if ShowDev and ShowASIA and bool_asia_dev
for i = 1 to DevCount by 1
if i == 1
dev01posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_hi + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev01negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if i == 2
dev02posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev02negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if i == 3
dev03posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev03negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if i == 4
dev04posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff * i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev04negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff * i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
else if ASIATime
asia_hi := math.max(high, asia_hi)
asia_lo := math.min(low, asia_lo)
asia_diff := asia_hi - asia_lo
for i = 1 to DevCount by 1
if i == 1 and ShowDev
line.set_y1(dev01posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev01posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev01negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev01negline_asia, asia_lo - asia_diff * i)
if i == 2 and ShowDev
line.set_y1(dev02posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev02posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev02negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev02negline_asia, asia_lo - asia_diff * i)
if i == 3 and ShowDev
line.set_y1(dev03posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev03posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev03negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev03negline_asia, asia_lo - asia_diff * i)
if i == 4 and ShowDev
line.set_y1(dev04posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev04posline_asia, asia_hi + asia_diff * i)
line.set_y1(dev04negline_asia, asia_lo - asia_diff * i)
line.set_y2(dev04negline_asia, asia_lo - asia_diff * i)
if (asia_hi > asia_hi )
box.set_top(asia_box, asia_hi)
if (asia_lo < asia_lo )
box.set_bottom(asia_box, asia_lo)
if DevDirection == "Upside Only"
line.delete(dev01negline_asia)
line.delete(dev02negline_asia)
line.delete(dev03negline_asia)
line.delete(dev04negline_asia)
else if DevDirection == "Downside Only"
line.delete(dev01posline_asia)
line.delete(dev02posline_asia)
line.delete(dev03posline_asia)
line.delete(dev04posline_asia)
// FLOUT Stuff
var float flout_hi = na
var float flout_lo = na
var float flout_diff = na
var box floutbox = na
var line flout_hi_line = na
var line flout_lo_line = na
var line dev01negline_flout = na
var line dev02negline_flout = na
var line dev03negline_flout = na
var line dev04negline_flout = na
var line dev01posline_flout = na
var line dev02posline_flout = na
var line dev03posline_flout = na
var line dev04posline_flout = na
if SessionBegins(FLOUT) and DOM
flout_hi := high
flout_lo := low
flout_diff := flout_hi - flout_lo
if ShowTSO
box.delete(floutbox )
line.delete(dev01posline_flout )
line.delete(dev01negline_flout )
line.delete(dev02posline_flout )
line.delete(dev02negline_flout )
line.delete(dev03posline_flout )
line.delete(dev03negline_flout )
line.delete(dev04posline_flout )
line.delete(dev04negline_flout )
if ShowFLOUT
floutbox := box.new(floutOpenTime, flout_hi, floutEndTime, flout_lo, color.new(FLOUTBoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time, color.new(FLOUTBoxCol,90), txt7, size.auto, color.new(box_text_flout_col,80), text_wrap=text.wrap_auto)
if dayofweek == dayofweek.friday
box.set_right(floutbox, floutOpenTime+201600000)
line.set_x2(flout_hi_line, floutOpenTime+201600000)
line.set_x2(flout_lo_line, floutOpenTime+201600000)
if box_text_cbdr == false
box.set_text(floutbox, "")
if ShowDev and ShowFLOUT and bool_flout_dev
for i = 0.5 to DevCount by 0.5
if i == 0.5
dev01posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_hi + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev01negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev01posline_flout, floutOpenTime+201600000)
line.set_x2(dev01negline_flout, floutOpenTime+201600000)
if i == 1
dev02posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev02negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev02posline_flout, floutOpenTime+201600000)
line.set_x2(dev02negline_flout, floutOpenTime+201600000)
if i == 1.5
dev03posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev03negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev03posline_flout, floutOpenTime+201600000)
line.set_x2(dev03negline_flout, floutOpenTime+201600000)
if i == 2
dev04posline_flout := line.new(floutOpenTime, flout_hi + flout_diff * i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
dev04negline_flout := line.new(floutOpenTime, flout_hi - flout_diff * i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol, style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev04posline_flout, floutOpenTime+201600000)
line.set_x2(dev04negline_flout, floutOpenTime+201600000)
else if FLOUTTime
flout_hi := math.max(high, flout_hi)
flout_lo := math.min(low, flout_lo)
flout_diff := flout_hi - flout_lo
for i = 0.5 to DevCount by 0.5
if i == 0.5 and ShowDev
line.set_y1(dev01posline_flout, flout_hi + flout_diff * i)
line.set_y2(dev01posline_flout, flout_hi + flout_diff * i)
line.set_y1(dev01negline_flout, flout_lo - flout_diff * i)
line.set_y2(dev01negline_flout,
1-Min Change of State Buy/Sell SignalBuy & Sell Indicator. Calls a signal based on break of structure, momentum and trend
Daily/Weekly/Monthly High/LowThis indicator displays previous daily, weekly, and monthly highs and lows on your chart. The lines automatically disappear once price breaks through these levels, helping you identify key support and resistance zones that haven't been tested yet.
ICT SMT Divergence Lines - EnhancedThis indicator identifies and highlights Smart Money Technique (SMT) divergence between two user-selected symbols across any timeframe. It compares the last two completed candles of both symbols and marks potential SMT signals only when market context aligns with smart money principles.
⚡ Key Features
✅ SMT Bullish Signal
Symbol 1 forms a lower low compared to its prior candle.
Symbol 2 forms a higher low compared to its prior candle.
The previous candle on the chart was bearish (close < open).
✅ SMT Bearish Signal
Symbol 1 forms a higher high compared to its prior candle.
Symbol 2 forms a lower high compared to its prior candle.
The previous candle on the chart was bullish (close > open).
✅ Visual Representation
Draws a clean, subtle line between the two SMT candles — green for bullish SMT and red for bearish SMT — making divergence easy to spot.
Optional small triangle markers above or below the bar where SMT is detected.
Old lines are automatically removed to keep the chart uncluttered.
✅ Multi-timeframe compatible
Works on any chart timeframe.
Compares the last two completed candles in the current chart timeframe, or can be adapted for a fixed higher timeframe.
FVG ScalperThe FVG Scalper is an advanced multi-timeframe momentum indicator designed specifically for scalping strategies. This powerful tool combines the trend strength analysis of the Average Directional Index (ADX) from a 15-second timeframe with the momentum oscillations of the Relative Strength Index (RSI) from a 1-minute timeframe to identify high-probability entry points in trending markets.