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.
インジケーターとストラテジー
RACZ-SIGNAL-V2.1RACZ-SIGNAL-V2.1 – Reactive Analytical Confluence Zones
Developed by: RACZ Trading
Indicator Type: Multi-Factor Confluence System
Overlay: Off (separate pane)
Purpose: Detect powerful trade opportunities through confluence of technical signals.
⸻
🔍 What is RACZ?
RACZ stands for Reactive Analytical Confluence Zones.
It’s a high-precision trading tool built for traders who rely on multi-signal confirmation, momentum alignment, and market structure awareness.
Rather than relying on a single technical metric, RACZ dynamically combines RSI, VWAP-RSI, Divergence, ADX, and Volume Analytics to produce a composite signal score from 0 to 12 — the higher the score, the stronger the signal.
⸻
🧠 How It Works – Core Components
1. RSI Analysis
• Detects momentum shifts.
• Compares RSI value to overbought (default: 67) and oversold (default: 33) thresholds.
• Adds points to Bullish or Bearish score.
2. VWAP-RSI
• Uses RSI based on VWAP (Volume Weighted Average Price).
• Adds weight to signals influenced by volume-adjusted price movement.
3. Divergence Detection
• Detects potential reversal zones.
• Bullish Divergence: RSI crosses up from low zone.
• Bearish Divergence: RSI crosses down from high zone.
• Strong confluence signal when present.
4. ADX Dynamic Strength Filter
• Custom-calculated ADX (trend strength indicator).
• Uses a dynamic threshold derived from SMA of ADX over a lookback period, scaled by a factor (default 0.9).
• Ensures signals are only validated in strong trend environments.
5. Volume Z-Score
• Detects anomalies in volume behavior.
• Z-score applied to 20-period volume average & deviation.
• Labels spikes, drops, high/low volume conditions.
⸻
📊 Signal Scoring Logic
Each component (RSI, VWAP-RSI, Divergence, ADX) can score up to 3 points each.
• Bullish Score: Total from bullish alignment of each factor.
• Bearish Score: Total from bearish alignment of each factor.
• Signal Power = max(bullish, bearish)
📈 Signal Interpretation
• BUY: Bullish Score > Bearish Score
• SELL: Bearish Score > Bullish Score
• NEUTRAL: Scores are equal
• Signal power is plotted on a 0–12 histogram:
• 0–5 = Weak
• 6–8 = Medium
• 9–12 = Strong (High Confluence Zone)
🖥️ Live Status Panel (Top-Right Corner)
This real-time panel helps you break down the signal:Component
Value Explanation: RSI / VWAP / DIV / ADX
Shows points contributing to signal
SIGNAL: Current market bias (BUY, SELL, NEUTRAL)
VOLUME: Volume classification (Spike, Drop, High, Low, Normal)
Color-coded for quick interpretation.
✅ How to Use
1. Look at Histogram: Bars ≥6 suggest valid setups, especially ≥9.
2. Confirm Panel Agreement: Check which components are supporting the signal.
3. Validate Volume: Unusual spikes/drops often precede strong moves.
4. Follow Direction: Use BUY/SELL signals aligned with signal power and trend.
⸻
⚙️ Customizable Inputs
• RSI period, overbought/oversold levels
• VWAP-RSI period
• ADX period and dynamic threshold settings
• Fully adjustable to fit any trading style
⸻
🚀 Why Choose RACZ?
• Clarity: Scores & signals derived from multiple tools, not just one.
• Confluence Logic: Designed for traders who look for confirmation across indicators.
• Speed: Real-time responsiveness to changing market dynamics.
• Volume Awareness: Integrated volume intelligence gives a deeper edge.
⸻
⚠️ Disclaimer
This indicator is intended strictly for educational and informational purposes only. It is not financial advice and should not be used to make actual investment decisions. Always conduct your own research or consult with a licensed financial advisor before trading or investing. Use of this script is at your own risk.
Running Minimum HighThe running minimum high looks at the minimum high from a defined lookback period (default 10 days) and plots that on the price chart. Green arrows signify when the low of the candle is above the running minimum high (suggesting an uptrend), and red arrows signify when the high of the candle is below the running minimum high (suggesting a downtrend).
It is recommended to use this on high timeframes (e.g. 1 hour and above) given the high number of signals it generates on lower timeframes.
Impulse Profile Zones [BigBeluga] - with Alerts📌 Indicator Description
This indicator highlights impulse price zones that occur when a large-bodied candle (high momentum candle) appears. Within these zones, the indicator performs the following:
Calculates vertical volume distribution (Volume Profile) using lower timeframe data.
Draws a histogram bar across 10 price levels within the zone to show volume concentration.
Identifies the POC (Point of Control) — the price level with the highest volume.
Provides automatic BUY/SELL alerts based on the direction of the impulse candle:
📈 Buy alert is triggered when a large bullish candle forms.
📉 Sell alert is triggered when a large bearish candle forms.
🚀 Future Development Potential
🧠 AI sentiment integration for enhanced signal validation
📤 Webhook alerts to external systems like Telegram or Discord
📉 BUY/SELL arrow visualization directly on the chart
🔄 Auto-drawn support/resistance levels derived from volume profile zones
ETHUSDT 1H - Momentum Breakout with ATR TP/SL (Long & Short)momentum candle untuk pair ethusdt TF 1H
• Timeframe: 1H
• Entry Long:
• Price Up ≥ 2% in1 candle
• Breakout high from 10 candles before
• Entry Short:
• Price Down ≥ 2% in 1 candle
• Breakdown low from 10 candles before
• TP: Use ATR × multiplier (default: 1.5)
• SL:
• Long → Low from candle momentum
• Short → High from candle momentum
Wyckoff Entry Times @jqrmThis indicator visually marks two custom time zones on your TradingView chart by drawing vertical lines at the start and end of each zone. The first time zone spans from 9:27 AM to 9:33 AM, highlighted in red, and the second spans from 9:50 AM to 10:10 AM, highlighted in blue. You can enable or disable each zone's lines using the indicator inputs. This helps to quickly spot important intraday sessions or time ranges on your chart.
ADX Trend Visualizer with Dual ThresholdsADX Trend Visualizer with Dual Thresholds
A minimal, color coded ADX indicator designed to filter market conditions into weak, moderate, or strong trend phases.
Uses a dual threshold system for separating weak, moderate, and strong trend conditions.
Color coded ADX line:
Green– Strong trend (above upper threshold)
Yellow – Moderate trend (between thresholds)
Red – Weak or no trend (below lower threshold)
Two horizontal reference lines plotted at threshold levels
Optional +DI and -DI lines (Style tab)
Recommended Use:
Use on higher time frames (1h and above) as a trend filter
Combine with entry/exit signals from other indicators or strategies
Avoid possible false entries when ADX is below the weak threshold
This trend validator helps highlight strong directional moves and avoid weak market conditions
MACD_without_pricePublic sharing has been approved by Mr. Niu Jun. This code does not involve candlestick chart prices. Please make further judgements based on volatility and prices.
公开分享已征得牛军老师同意。本代码未涉及K线价格,请结合波动和价格做进一步判断。
YouTube:
@牛军开门-股市牛转门
@小二帆
RSI Rangebound AreaRSI Rangebound Area is a Pine Script v6 indicator that automatically detects consolidation zones where both price and RSI stay within user-defined thresholds. During a rangebound period it:
Shades the background to highlight consolidation
Places “Range Start” and “Range End” labels at the beginning and end
Displays an info table (RSI value, price range %, RSI range, current state: Rangebound/Trending)
Key Inputs
RSI Length
Overbought / Oversold Levels
Range Detection Period
Max Price Range (%)
Max RSI Range
Toggle for “Please add RSI(14) indicator” reminder
Ideal for spotting flat markets and refining breakout or mean-reversion entries. Free and open-source—feel free to customize and contribute!
MTF strategy with (CE, TT, Bernoulli,DMF,RSI filters)Strategy Overview
The strategy designed to be highly customizable, allowing users to select and configure different components.
Key Components:
1. Entry Signal Source
You can choose between two primary signal generators:
Chandelier Exit: A volatility-based indicator that provides buy/sell signals when the price moves a certain multiple of the Average True Range (ATR) away from a high or low.
Configurable parameters: ATR Period, ATR Multiplier, and whether to use the Close price for extremums.
Trend Trader: This appears to be a custom combination of MACD and ADX. It generates buy/sell signals based on MACD crossovers when the ADX is above a certain threshold (25, indicating a trending market).
Configurable parameters: Fast Length, Slow Length, Signal Smoothing (for MACD), ADX Length, and DI Length.
2. Take Profit (TP) Settings
The strategy offers flexible Take Profit options:
Enable/Disable: You can choose whether to use Take Profit at all.
Method:
Percentage: Closes the trade when a specified percentage profit is reached.
Risk/Reward Ratio: Calculates the Take Profit level based on a multiple of the initial Stop Loss distance.
Hold Until Stop: An option to override Take Profit and reverse signals, keeping the trade open until the Stop Loss is hit.
3. Stop Loss (SL) Settings (by chadmex)
This section defines how Stop Loss is calculated and managed:
Type:
Trailing: The Stop Loss dynamically adjusts as the trade moves in profit, locking in gains.
Fixed: The Stop Loss remains at its initial calculated level.
ATR Length: Period for ATR calculation, used in determining the Stop Loss distance.
Use Structure (High/Low): If enabled, the Stop Loss is calculated relative to recent Highs/Lows; otherwise, it's based on the Close price.
Lookback: The period for finding recent Highs/Lows for structure-based Stop Loss.
ATR Multiplier: A multiplier applied to the ATR value to set the Stop Loss distance.
4. Alert Settings
Customizable messages for various trade events:
Long Entry
Short Entry
Take Profit Hit
Stop Loss Hit
5. Filtering Mechanisms
The strategy includes a wide array of filters that can be independently enabled and configured to refine trade entries:
EMA Crossover Filter: Allows trades only when a fast EMA is above a slow EMA (for long) or vice versa (for short).
Configurable parameters: Timeframe, Fast EMA Length, Slow EMA Length.
RSI + Bollinger Bands + EMA Filter: Filters trades based on the relationship between an RSI-based Moving Average (Fast or Slow EMA of RSI) and the Bollinger Band Basis of RSI.
Configurable parameters: Timeframe, RSI Length, BB Length, BB Multiplier, Fast EMA Length, Slow EMA Length.
RSI EMA Level Filter: Prevents trades when RSI EMA is in overbought (for long) or oversold (for short) regions.
Configurable parameters: Upper Level (forbid longs), Lower Level (forbid shorts).
MFI (Custom) Filter: Filters trades based on a custom Money Flow Index (MFI) indicator. Default is long for MFI > 0, short for MFI < 0, with an option to reverse the logic.
Configurable parameters: Timeframe, MFI Period.
RSI+MFI (by VuManChu) Filter: Filters trades based on a combined RSI and MFI indicator. Default is long for indicator > 0, short for < 0, with an option to reverse the logic.
Configurable parameters: Timeframe, RSI+MFI Period, Multiplier, Y Position Offset.
OBV (On-Balance Volume) Filter: Two options for filtering based on OBV and its EMAs/SMAs.
Option 1: Fast EMA of OBV vs. OBV SMA.
Option 2: Fast EMA of OBV vs. OBV SMA and Slow EMA.
Configurable parameters: Timeframe, OBV BB Length, OBV Fast EMA Length, OBV Slow EMA Length, and an option to invert the logic.
Bernoulli (by kocurekc) Filter: Filters trades using a Bernoulli entropy indicator. Default is long for value > 0, short for < 0, with options to reverse the logic and block trades in a "gray zone" (close to zero).
Configurable parameters: Timeframe, Entropy Length, Averaging Length, Trade Band (gray zone), Measurement Type, Bernoulli Purest, Probability Smoother, Include Source (price), Include Volume.
EMA Deviation (v2) Filter: Prevents trades after significant price deviations from EMAs, indicating potential overextension.
Configurable parameters: Timeframe, Fast EMA Length, Slow EMA Length, Average Lookback, Signal Multiplier.
Advanced RSI Conditions Filter (Forbidding): Allows defining multiple conditions based on RSI, its EMAs, and Bollinger Bands that, if any are met, forbid a trade. Includes "Death Cross" and "Golden Cross" variations.
Configurable parameters: Timeframe, RSI Length, BB Length, BB Multiplier, Fast EMA Length, Slow EMA Length, and numerous toggleable rules with customizable operators (Above/Below) and values for BB, RSI, and EMA relationships.
Advanced RSI Conditions Filter - 2 (Allowing): Similar to the forbidding filter, but trades are only allowed if all enabled conditions are met.
Configurable parameters: Same as the forbidding filter, but for allowing rules.
DMF (Dynamic Money Flow) Filter: Filters trades based on a custom Dynamic Money Flow indicator and its moving averages.
Configurable parameters: Timeframe, Period, Moving Average Type (EMA, WMA, T3, FRAMA), Fast Length, Slow Length.
Detailed Long/Short Conditions: Allows precise control over the DMF value, fast MA, and slow MA ranges, and cloud conditions for both long and short entries.
Trade Execution Logic:
Signal Generation: Either Chandelier Exit or Trend Trader generates a raw buy or sell signal.
Filter Application: The raw signal is then passed through all enabled filters.
For forbidding filters, if any of their active rules are met, the trade is blocked.
For allowing filters, all of their active rules must be met for the trade to proceed.
Combined Filters: All active filters must allow a trade for it to be considered valid.
Entry: If a valid buySignal and allowLong conditions are met (and not holding until stop, or if holding until stop, there's no open position), a "Long" entry is executed. The same applies for "Short" entries.
Stop Loss Calculation: Upon entry, an initial Stop Loss price is calculated based on the chosen type (Fixed/Trailing) and parameters.
For trailing SL, the active_long_stop or active_short_stop is updated to trail the price.
Take Profit Calculation: If useTakeProfit is true and holdUntilStop is false, a Take Profit target is calculated based on the chosen method (Percentage or Risk/Reward).
Exit:
If the price hits the Stop Loss, the position is closed.
If the price hits the Take Profit target, the position is closed (unless holdUntilStop is active).
Plotting:
The script plots:
Calculated Stop Loss and Take Profit levels (as white lines, typically for visual debugging).
The active Trailing Stop Loss lines (green for long, red for short).
Volume + Price Reversal SignalTesting so not sure if it works, using volume and candlesticks to determine reversals
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.
5DMA Optional HMA Entry📈 5DMA Optional HMA Entry Signal – Precision-Based Momentum Trigger
Category: Trend-Following / Reversal Timing / Entry Optimization
🔍 Overview:
The 5DMA Optional HMA Entry indicator is a refined price-action entry tool built for traders who rely on clean trend alignment and precise timing. This script identifies breakout-style entry points when price gains upward momentum relative to short-term moving averages — specifically the 5-day Simple Moving Average (5DMA) and an optional Hull Moving Average (HMA).
Whether you're swing trading stocks, scalping ETFs like UVXY or VXX, or looking for pullback recovery entries, this tool helps time your long entries with clarity and flexibility.
⚙️ Core Logic:
Primary Condition (Always On):
🔹 Close must be above the 5DMA – ensuring upward short-term momentum is confirmed.
Optional Condition (Toggled by User):
🔹 Close above the HMA – adds slope-responsive trend filtering for smoother setups. Enable or disable via checkbox.
Bonus Entry Filter (Optional):
🔹 Green Candle Wick Breakout – optional pattern logic that detects bullish momentum when the high pierces above both MAs, with a green body.
Reset Mechanism:
🔁 Signal resets only after price closes back below all active MAs (5DMA and HMA if enabled), reducing noise and avoiding repeated signals during chop.
🧠 Why This Works:
This indicator captures the kind of setups that professional traders look for:
Momentum crossovers without chasing late.
Mean reversion snapbacks that align with fresh bullish moves.
Avoids premature entries by requiring clear structure above moving averages.
Optional HMA filter allows adaptability: turn it off during choppy markets or range conditions, and on during trending environments.
🔔 Features:
✅ Adjustable HMA Length
✅ Enable/Disable HMA Filter
✅ Optional Green Wick Breakout Detection
✅ Visual “Buy” label plotted below qualifying bars
✅ Real-time Alert Conditions for automated trading or manual alerts
🎯 Use Cases:
VIX-based ETFs (e.g., UVXY, VXX): Catch early breakouts aligned with volatility spikes.
Growth Stocks: Time pullback entries during bullish runs.
Futures/Indices: Combine with macro levels for intraday scalps or swing setups.
Overlay on Trend Filters: Combine with RSI, MACD, or VWAP for confirmation.
🛠️ Recommended Settings:
For smooth setups in volatile names, use:
HMA Length: 20
Keep green wick filter ON
For fast momentum trades, disable the HMA filter to act on 5DMA alone.
⭐ Final Thoughts:
This script is built to serve both systematic traders and discretionary scalpers who want actionable signals without noise or lag. The toggleable HMA feature lets you adjust sensitivity depending on market conditions — a key edge in adapting to volatility cycles.
Perfect for those who value clean, non-repainting entries rooted in logical structure.
Smart Zones Pro [FVG, OB, VWAP, Sessions, Alerts, Structure]ICT Package. Basically I combined vwap with ICT concepts with supply and demand.
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
EMA 52W 65-80% Down ShiftShifted EMA 52W. Useful in identifying the low points of medium- and long-term trends on altcoins. EMA 52 W - Annual Trend A 65-75% downward shift relative to the current position potentially indicates deep drawdowns for most investor participants and can serve as an approximate zone for a medium-term rebound or trend reversal.
One Line RuleOne Line Rule – Momentum-Based EMA Signal Indicator
The One Line Rule is a precision tool that combines market momentum with volume confirmation, built around a single, dynamic trend line. This line is the average of the EMA 22 and EMA 200, providing a balanced view of short- and long-term trend bias.
🧠 How It Works:
Trend Line Color:
🟢 Green: Bullish momentum (EMA 22 above EMA 200)
🔴 Red: Bearish momentum (EMA 22 below EMA 200)
⚪ Gray: Neutral momentum (sideways movement within a small threshold)
Signal Logic:
✅ Buy Signal: When price crosses above the line from below on high volume (momentum must be bullish)
❌ Sell Signal: When price crosses below the line from above on high volume (momentum must be bearish)
🔇 No signals are generated during neutral (gray) phases to avoid noise
Smoothing: Optional smoothing of the line to better capture trend structure
Volume Filter: Customizable volume threshold ensures signals only trigger during significant moves
Breakout & Pullback | Auto S&D + Telegram AlertsBreakout & Pullback | Auto S&D + Telegram Alerts Achraf
Consolidation Zones[RanaAlgo]Overview
This indicator helps traders identify price consolidation zones (ranges) and potential breakouts in the market. It is useful for spotting periods of low volatility before significant price movements.
How It Works
Detects Consolidation Zones
Uses the ADX (Average Directional Index) to determine when the market is in a consolidation phase .
When ADX is below the threshold , the indicator marks the start of a consolidation zone.
Draws a semi-transparent box around the price range, adjusting its height as new highs/lows form.
Tracks Breakouts
When price breaks above/below the consolidation box, it signals a potential trend continuation.
Displays breakout arrows/labels (configurable shape & style) when price exits the range.
Visual Features
Boxes highlight consolidation areas (customizable color, border, and style).
Labels show real-time status ("CONSOLIDATING" or "TRENDING").
Breakout signals appear as arrows or shapes (up/down).
Usefulness in Trading
Range Trading: Helps traders identify sideways markets for buying low and selling high.
Breakout Trading: Signals potential trend entries when price exits consolidation.
Trend Confirmation: Low ADX + consolidation box = weak trend; breakout = possible trend start.
Example: If price stays in a blue box (consolidation) and then breaks above with an arrow, it suggests a bullish move.
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.
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: www.tradingview.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,
@khaicao| APB HistogramIntroducing the APB Histogram Indicator
A Powerful Tool for Visualizing Price Momentum
The APB Histogram (Average Price Bar Histogram) is a unique and insightful indicator designed to help traders identify price momentum and potential trend reversals. By calculating a smoothed average of price action and plotting the difference between the APB Close and APB Open as a histogram, this indicator provides a clear visual representation of bullish and bearish pressure in the market.
Key Features:
✅ Smoothed Price Calculation – Uses a recursive formula to generate a dynamic average price bar, reducing noise and highlighting meaningful trends.
✅ Intuitive Histogram Display – Positive (green) bars indicate bullish momentum, while negative (red) bars signal bearish momentum.
✅ Customizable Colors – Adjust the bullish and bearish colors to match your trading style.
✅ Non-Overlay Design – Plotted in a separate panel for clear visualization without cluttering the main chart.
How to Use the APB Histogram:
Bullish Signals: When the histogram bars are green and rising, it suggests increasing buying pressure.
Bearish Signals: When the histogram bars are red and falling, it indicates growing selling pressure.
Trend Confirmation: Use alongside other indicators, recommended to use with Stochastic (8,3,3) to confirm trend strength.
Perfect For:
Swing Traders looking for momentum shifts
Day Traders needing quick visual cues on price direction
Trend Followers confirming entry and exit points
Try the APB Histogram today and enhance your trading strategy with a cleaner, more intuitive view of market momentum!
🔹 Like & Follow for more unique indicators!
🔹 Comment below if you have any questions or improvement suggestions!
Happy Trading! 🚀