PulseMA + MADescription
The PulseMA + MA indicator is an analytical tool that combines the analysis of the price relationship to a base Exponential Moving Average (EMA) with a smoothed Simple Moving Average (SMA) of this relationship. The indicator helps traders identify the direction and momentum of market trends and generates entry signals, displaying data as lines below the price chart.
Key Features
PulseMA: Calculates trend momentum by multiplying the number of consecutive candles above or below the base EMA by the slope of this average. The number of candles determines trend strength (positive for an uptrend, negative for a downtrend), while the EMA slope reflects the rate of change of the average. The PulseMA value is scaled by multiplying by 100.
Smoothed Average (PulseMA MA): Adds a smoothed SMA, facilitating the identification of long-term changes in market momentum.
Dynamic Colors: The PulseMA line changes color based on the price position relative to the base EMA (green for price above, red for price below).
Zero Line: Indicates the area where the price is close to the base EMA.
Applications
The PulseMA + MA indicator is designed for traders and technical analysts who aim to:
Analyze the direction and momentum of market trends, particularly with higher PulseMA Length values (e.g., 100), which provide a less sensitive EMA for longer-term trends.
Generate entry signals based on the PulseMA color change or the crossover of PulseMA with PulseMA MA.
Anticipate potential price reversals to the zero line when PulseMA is significantly distant from it, which may indicate market overextension.
How to Use
Add the Indicator to the Chart: Search for "PulseMA + MA" in the indicator library and add it to your chart.
Adjust Parameters:
PulseMA Length: Length of the base EMA (default: 50).
PulseMA Smoothing Length: Length of the smoothed SMA (default: 20).
Interpretation:
Green PulseMA Line: Price is above the base EMA, suggesting an uptrend.
Red PulseMA Line: Price is below the base EMA, indicating a downtrend.
PulseMA Color Change: May signal an entry point (recommended to wait for 2 candles to reduce noise).
PulseMA Crossing PulseMA MA from Below: May indicate a buy signal in an uptrend.
Zero Line: Indicates the area where the price is close to the base EMA.
Significant Deviation of PulseMA from the Zero Line: Suggests a potential price reversal to the zero line, indicating possible market overextension.
Notes
The indicator generates trend signals and can be used to independently identify entry points, e.g., on PulseMA color changes (waiting 2 candles is recommended to reduce noise) or when PulseMA crosses PulseMA MA from below.
In sideways markets, it is advisable to use the indicator with a volatility filter to limit false signals.
Adjusting the lengths of the averages to suit the specific instrument can improve signal accuracy.
Indicators and strategies
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
Custom Session ZonesCreate your own custom market session zones. Currently marks for Asia, London, NY, NY Open, ICT Silver Bullet AM/PM timings.
GK Accounting - Gold Trading Signalhi this is new indicator for trading anytime frame any market its work really good
TASC 2025.07 Laguerre Filters█ OVERVIEW
This script implements the Laguerre filter and oscillator described by John F. Ehlers in the article "A Tool For Trend Trading, Laguerre Filters" from the July 2025 edition of TASC's Traders' Tips . The new Laguerre filter utilizes the UltimateSmoother filter in place of an exponential moving average (EMA) in its calculation, offering improved responsiveness and reduced lag.
█ CONCEPTS
As Ehlers explains in his article, the Laguerre filter is a form of transversal filter . A transversal filter calculates an output signal using a tapped delay line . It creates multiple delayed versions of an input signal, applies weight to each delay, and then calculates their sum to generate the filtered result.
The Laguerre filter's structure relies on Laguerre polynomials — solutions to a differential equation solved by Edmond Laguerre in the 1800s. When Ehlers analyzed the formula for these polynomials on discrete systems (e.g., financial time series), he found that the first term's expression corresponds to an EMA response, and all subsequent terms correspond to an all-pass response. In contrast to other filter types, an all-pass filter produces phase shift (i.e., delay) in an input signal's components without affecting its amplitude.
Ehlers observed that these characteristics of Laguerre polynomials make them suitable for use in a transversal filter structure, and thus the Laguerre filter was born. However, he notes that EMAs are not great filters in general. As such, to improve on the Laguerre filter's design, Ehlers modified it by replacing the EMA term with his UltimateSmoother filter. The resulting Laguerre filter has significantly reduced lag, achieving a tighter response to market fluctuations while maintaining smoothness. Ehlers suggests that traders can analyze crossings between the UltimateSmoother and this Laguerre filter, or those between two Laguerre filters of different order, for helpful buy and sell signals.
In addition to the Laguerre filter, Ehlers derived a smooth, low-lag oscillator based on the difference between the first and second terms in the modified filter structure, scaled by the root mean square (RMS). The resulting oscillator provides an alternative filtered representation of market data, which can help traders identify swing and mean-reversion signals.
█ USAGE
This indicator calculates both the Laguerre filter and the Laguerre oscillator described in Ehlers' article. It displays the Laguerre filter on the main chart pane and the oscillator in a separate pane.
Users can control the behavior of the filter and oscillator with the inputs in the "Settings/Inputs" tab:
The "Period" input defines the critical period of the UltimateSmoother used in the Laguerre filter and oscillator calculations. Its default value is 30.
The "Gamma" input determines the weighting behavior of the Laguerre filter and oscillator. It accepts a positive value between 0 and 1. Use a lower value for quicker responsiveness to market changes, and a higher value for trends. The default value is 0.5.
The "RMS length" input determines the length of the RMS calculation for oscillator normalization. The default value is 100 bars.
CrumpBot Short - Górny Knot z filtrem wzrostu (knots)The indicator works on the same principle as Crumpbot, this one is for shorts
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.
Past ADR (3 & 5 Days)Average Daily Range for the past 3 and 5 days.
It takes the daily ranges and calculates the averages.
By hovering over the numbers on the left side of the screen, you will see the averages.
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
[km] Pivot Points ColoredScript Overview: Your Compass in a Complex Market – Supporting Your Next Move with Daily & Weekly Pivots
This indicator is designed to be a powerful compass that answers those questions, guiding your trading decisions.
This script automatically displays Pivot Points (PP), along with Resistance (R) and Support (S) lines, for both Daily and Weekly timeframes. These lines represent key market turning points, price levels that many traders worldwide actively watch. With this single tool, you'll gain immediate clarity on crucial levels across all timeframes, from day trading to swing trading.
These Pivot Points will powerfully assist your trade judgment. Add it to your chart and experience its effectiveness for yourself!
Key Features: Deeper Analysis for Your Trading
Daily & Weekly Pivot Display: See both daily pivots, for tracking intraday movements, and weekly pivots, for understanding broader trends, simultaneously. This allows you to overlap and confirm key levels across different timeframes right on your chart.
Extensive Line Style Customization: Freely customize the color, thickness, and line style (solid, dashed, etc.) for the Pivot Point, and each Resistance and Support line. Adjust them to match your chart's theme and personal preferences for optimal visibility.
Flexible Pivot Period Specification: You can set the period used for pivot calculations. This allows you to adjust the sensitivity of the pivot lines according to your specific analytical objectives.
Traditional Pivot Calculation: By default, the indicator uses the Traditional Pivot calculation method, which is the most common and widely utilized by traders. Capture market movements precisely with this simple yet powerful approach.
Donchian + EMA + T3 + Supertrend (RR 1:2)Trend Catcher Build with Donchain channels and EMA cross, also confirmation with Supertrend
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.
Grothendieck-Teichmüller Geometric SynthesisDskyz's Grothendieck-Teichmüller Geometric Synthesis (GTGS)
THEORETICAL FOUNDATION: A SYMPHONY OF GEOMETRIES
The 🎓 GTGS is built upon a revolutionary premise: that market dynamics can be modeled as geometric and topological structures. While not a literal academic implementation—such a task would demand computational power far beyond current trading platforms—it leverages core ideas from advanced mathematical theories as powerful analogies and frameworks for its algorithms. Each component translates an abstract concept into a practical market calculation, distinguishing GTGS by identifying deeper structural patterns rather than relying on standard statistical measures.
1. Grothendieck-Teichmüller Theory: Deforming Market Structure
The Theory : Studies symmetries and deformations of geometric objects, focusing on the "absolute" structure of mathematical spaces.
Indicator Analogy : The calculate_grothendieck_field function models price action as a "deformation" from its immediate state. Using the nth root of price ratios (math.pow(price_ratio, 1.0/prime)), it measures market "shape" stretching or compression, revealing underlying tensions and potential shifts.
2. Topos Theory & Sheaf Cohomology: From Local to Global Patterns
The Theory : A framework for assembling local properties into a global picture, with cohomology measuring "obstructions" to consistency.
Indicator Analogy : The calculate_topos_coherence function uses sine waves (math.sin) to represent local price "sections." Summing these yields a "cohomology" value, quantifying price action consistency. High values indicate coherent trends; low values signal conflict and uncertainty.
3. Tropical Geometry: Simplifying Complexity
The Theory : Transforms complex multiplicative problems into simpler, additive, piecewise-linear ones using min(a, b) for addition and a + b for multiplication.
Indicator Analogy : The calculate_tropical_metric function applies tropical_add(a, b) => math.min(a, b) to identify the "lowest energy" state among recent price points, pinpointing critical support levels non-linearly.
4. Motivic Cohomology & Non-Commutative Geometry
The Theory : Studies deep arithmetic and quantum-like properties of geometric spaces.
Indicator Analogy : The motivic_rank and spectral_triple functions compute weighted sums of historical prices to capture market "arithmetic complexity" and "spectral signature." Higher values reflect structured, harmonic price movements.
5. Perfectoid Spaces & Homotopy Type Theory
The Theory : Abstract fields dealing with p-adic numbers and logical foundations of mathematics.
Indicator Analogy : The perfectoid_conv and type_coherence functions analyze price convergence and path identity, assessing the "fractal dust" of price differences and price path cohesion, adding fractal and logical analysis.
The Combination is Key : No single theory dominates. GTGS ’s Unified Field synthesizes all seven perspectives into a comprehensive score, ensuring signals reflect deep structural alignment across mathematical domains.
🎛️ INPUTS: CONFIGURING THE GEOMETRIC ENGINE
The GTGS offers a suite of customizable inputs, allowing traders to tailor its behavior to specific timeframes, market sectors, and trading styles. Below is a detailed breakdown of key input groups, their functionality, and optimization strategies, leveraging provided tooltips for precision.
Grothendieck-Teichmüller Theory Inputs
🧬 Deformation Depth (Absolute Galois) :
What It Is : Controls the depth of Galois group deformations analyzed in market structure.
How It Works : Measures price action deformations under automorphisms of the absolute Galois group, capturing market symmetries.
Optimization :
Higher Values (15-20) : Captures deeper symmetries, ideal for major trends in swing trading (4H-1D).
Lower Values (3-8) : Responsive to local deformations, suited for scalping (1-5min).
Timeframes :
Scalping (1-5min) : 3-6 for quick local shifts.
Day Trading (15min-1H) : 8-12 for balanced analysis.
Swing Trading (4H-1D) : 12-20 for deep structural trends.
Sectors :
Stocks : Use 8-12 for stable trends.
Crypto : 3-8 for volatile, short-term moves.
Forex : 12-15 for smooth, cyclical patterns.
Pro Tip : Increase in trending markets to filter noise; decrease in choppy markets for sensitivity.
🗼 Teichmüller Tower Height :
What It Is : Determines the height of the Teichmüller modular tower for hierarchical pattern detection.
How It Works : Builds modular levels to identify nested market patterns.
Optimization :
Higher Values (6-8) : Detects complex fractals, ideal for swing trading.
Lower Values (2-4) : Focuses on primary patterns, faster for scalping.
Timeframes :
Scalping : 2-3 for speed.
Day Trading : 4-5 for balanced patterns.
Swing Trading : 5-8 for deep fractals.
Sectors :
Indices : 5-8 for robust, long-term patterns.
Crypto : 2-4 for rapid shifts.
Commodities : 4-6 for cyclical trends.
Pro Tip : Higher towers reveal hidden fractals but may slow computation; adjust based on hardware.
🔢 Galois Prime Base :
What It Is : Sets the prime base for Galois field computations.
How It Works : Defines the field extension characteristic for market analysis.
Optimization :
Prime Characteristics :
2 : Binary markets (up/down).
3 : Ternary states (bull/bear/neutral).
5 : Pentagonal symmetry (Elliott waves).
7 : Heptagonal cycles (weekly patterns).
11,13,17,19 : Higher-order patterns.
Timeframes :
Scalping/Day Trading : 2 or 3 for simplicity.
Swing Trading : 5 or 7 for wave or cycle detection.
Sectors :
Forex : 5 for Elliott wave alignment.
Stocks : 7 for weekly cycle consistency.
Crypto : 3 for volatile state shifts.
Pro Tip : Use 7 for most markets; 5 for Elliott wave traders.
Topos Theory & Sheaf Cohomology Inputs
🏛️ Temporal Site Size :
What It Is : Defines the number of time points in the topological site.
How It Works : Sets the local neighborhood for sheaf computations, affecting cohomology smoothness.
Optimization :
Higher Values (30-50) : Smoother cohomology, better for trends in swing trading.
Lower Values (5-15) : Responsive, ideal for reversals in scalping.
Timeframes :
Scalping : 5-10 for quick responses.
Day Trading : 15-25 for balanced analysis.
Swing Trading : 25-50 for smooth trends.
Sectors :
Stocks : 25-35 for stable trends.
Crypto : 5-15 for volatility.
Forex : 20-30 for smooth cycles.
Pro Tip : Match site size to your average holding period in bars for optimal coherence.
📐 Sheaf Cohomology Degree :
What It Is : Sets the maximum degree of cohomology groups computed.
How It Works : Higher degrees capture complex topological obstructions.
Optimization :
Degree Meanings :
1 : Simple obstructions (basic support/resistance).
2 : Cohomological pairs (double tops/bottoms).
3 : Triple intersections (complex patterns).
4-5 : Higher-order structures (rare events).
Timeframes :
Scalping/Day Trading : 1-2 for simplicity.
Swing Trading : 3 for complex patterns.
Sectors :
Indices : 2-3 for robust patterns.
Crypto : 1-2 for rapid shifts.
Commodities : 3-4 for cyclical events.
Pro Tip : Degree 3 is optimal for most trading; higher degrees for research or rare event detection.
🌐 Grothendieck Topology :
What It Is : Chooses the Grothendieck topology for the site.
How It Works : Affects how local data integrates into global patterns.
Optimization :
Topology Characteristics :
Étale : Finest topology, captures local-global principles.
Nisnevich : A1-invariant, good for trends.
Zariski : Coarse but robust, filters noise.
Fpqc : Faithfully flat, highly sensitive.
Sectors :
Stocks : Zariski for stability.
Crypto : Étale for sensitivity.
Forex : Nisnevich for smooth trends.
Indices : Zariski for robustness.
Timeframes :
Scalping : Étale for precision.
Swing Trading : Nisnevich or Zariski for reliability.
Pro Tip : Start with Étale for precision; switch to Zariski in noisy markets.
Unified Field Configuration Inputs
⚛️ Field Coupling Constant :
What It Is : Sets the interaction strength between geometric components.
How It Works : Controls signal amplification in the unified field equation.
Optimization :
Higher Values (0.5-1.0) : Strong coupling, amplified signals for ranging markets.
Lower Values (0.001-0.1) : Subtle signals for trending markets.
Timeframes :
Scalping : 0.5-0.8 for quick, strong signals.
Swing Trading : 0.1-0.3 for trend confirmation.
Sectors :
Crypto : 0.5-1.0 for volatility.
Stocks : 0.1-0.3 for stability.
Forex : 0.3-0.5 for balance.
Pro Tip : Default 0.137 (fine structure constant) is a balanced starting point; adjust up in choppy markets.
📐 Geometric Weighting Scheme :
What It Is : Determines the framework for combining geometric components.
How It Works : Adjusts emphasis on different mathematical structures.
Optimization :
Scheme Characteristics :
Canonical : Equal weighting, balanced.
Derived : Emphasizes higher-order structures.
Motivic : Prioritizes arithmetic properties.
Spectral : Focuses on frequency domain.
Sectors :
Stocks : Canonical for balance.
Crypto : Spectral for volatility.
Forex : Derived for structured moves.
Indices : Motivic for arithmetic cycles.
Timeframes :
Day Trading : Canonical or Derived for flexibility.
Swing Trading : Motivic for long-term cycles.
Pro Tip : Start with Canonical; experiment with Spectral in volatile markets.
Dashboard and Visual Configuration Inputs
📋 Show Enhanced Dashboard, 📏 Size, 📍 Position :
What They Are : Control dashboard visibility, size, and placement.
How They Work : Display key metrics like Unified Field , Resonance , and Signal Quality .
Optimization :
Scalping : Small size, Bottom Right for minimal chart obstruction.
Swing Trading : Large size, Top Right for detailed analysis.
Sectors : Universal across markets; adjust size based on screen setup.
Pro Tip : Use Large for analysis, Small for live trading.
📐 Show Motivic Cohomology Bands, 🌊 Morphism Flow, 🔮 Future Projection, 🔷 Holographic Mesh, ⚛️ Spectral Flow :
What They Are : Toggle visual elements representing mathematical calculations.
How They Work : Provide intuitive representations of market dynamics.
Optimization :
Timeframes :
Scalping : Enable Morphism Flow and Spectral Flow for momentum.
Swing Trading : Enable all for comprehensive analysis.
Sectors :
Crypto : Emphasize Morphism Flow and Future Projection for volatility.
Stocks : Focus on Cohomology Bands for stable trends.
Pro Tip : Disable non-essential visuals in fast markets to reduce clutter.
🌫️ Field Transparency, 🔄 Web Recursion Depth, 🎨 Mesh Color Scheme :
What They Are : Adjust visual clarity, complexity, and color.
How They Work : Enhance interpretability of visual elements.
Optimization :
Transparency : 30-50 for balanced visibility; lower for analysis.
Recursion Depth : 6-8 for balanced detail; lower for older hardware.
Color Scheme :
Purple/Blue : Analytical focus.
Green/Orange : Trading momentum.
Pro Tip : Use Neon Purple for deep analysis; Neon Green for active trading.
⏱️ Minimum Bars Between Signals :
What It Is : Minimum number of bars required between consecutive signals.
How It Works : Prevents signal clustering by enforcing a cooldown period.
Optimization :
Higher Values (10-20) : Fewer signals, avoids whipsaws, suited for swing trading.
Lower Values (0-5) : More responsive, allows quick reversals, ideal for scalping.
Timeframes :
Scalping : 0-2 bars for rapid signals.
Day Trading : 3-5 bars for balance.
Swing Trading : 5-10 bars for stability.
Sectors :
Crypto : 0-3 for volatility.
Stocks : 5-10 for trend clarity.
Forex : 3-7 for cyclical moves.
Pro Tip : Increase in choppy markets to filter noise.
Hardcoded Parameters
Tropical, Motivic, Spectral, Perfectoid, Homotopy Inputs : Fixed to optimize performance but influence calculations (e.g., tropical_degree=4 for support levels, perfectoid_prime=5 for convergence).
Optimization : Experiment with codebase modifications if advanced customization is needed, but defaults are robust across markets.
🎨 ADVANCED VISUAL SYSTEM: TRADING IN A GEOMETRIC UNIVERSE
The GTTMTSF ’s visuals are direct representations of its mathematics, designed for intuitive and precise trading decisions.
Motivic Cohomology Bands :
What They Are : Dynamic bands ( H⁰ , H¹ , H² ) representing cohomological support/resistance.
Color & Meaning : Colors reflect energy levels ( H⁰ tightest, H² widest). Breaks into H¹ signal momentum; H² touches suggest reversals.
How to Trade : Use for stop-loss/profit-taking. Band bounces with Dashboard confirmation are high-probability setups.
Morphism Flow (Webbing) :
What It Is : White particle streams visualizing market momentum.
Interpretation : Dense flows indicate strong trends; sparse flows signal consolidation.
How to Trade : Follow dominant flow direction; new flows post-consolidation signal trend starts.
Future Projection Web (Fractal Grid) :
What It Is : Fibonacci-period fractal projections of support/resistance.
Color & Meaning : Three-layer lines (white shadow, glow, colored quantum) with labels showing price, topological class, anomaly strength (φ), resonance (ρ), and obstruction ( H¹ ). ⚡ marks extreme anomalies.
How to Trade : Target ⚡/● levels for entries/exits. High-anomaly levels with weakening Unified Field are reversal setups.
Holographic Mesh & Spectral Flow :
What They Are : Visuals of harmonic interference and spectral energy.
How to Trade : Bright mesh nodes or strong Spectral Flow warn of building pressure before price movement.
📊 THE GEOMETRIC DASHBOARD: YOUR MISSION CONTROL
The Dashboard translates complex mathematics into actionable intelligence.
Unified Field & Signals :
FIELD : Master value (-10 to +10), synthesizing all geometric components. Extreme readings (>5 or <-5) signal structural limits, often preceding reversals or continuations.
RESONANCE : Measures harmony between geometric field and price-volume momentum. Positive amplifies bullish moves; negative amplifies bearish moves.
SIGNAL QUALITY : Confidence meter rating alignment. Trade only STRONG or EXCEPTIONAL signals for high-probability setups.
Geometric Components :
What They Are : Breakdown of seven mathematical engines.
How to Use : Watch for convergence. A strong Unified Field is reliable when components (e.g., Grothendieck , Topos , Motivic ) align. Divergence warns of trend weakening.
Signal Performance :
What It Is : Tracks indicator signal performance.
How to Use : Assesses real-time performance to build confidence and understand system behavior.
🚀 DEVELOPMENT & UNIQUENESS: BEYOND CONVENTIONAL ANALYSIS
The GTTMTSF was developed to analyze markets as evolving geometric objects, not statistical time-series.
Why This Is Unlike Anything Else :
Theoretical Depth : Uses geometry and topology, identifying patterns invisible to statistical tools.
Holistic Synthesis : Integrates seven deep mathematical frameworks into a cohesive Unified Field .
Creative Implementation : Translates PhD-level mathematics into functional Pine Script , blending theory and practice.
Immersive Visualization : Transforms charts into dynamic geometric landscapes for intuitive market understanding.
The GTTMTSF is more than an indicator; it’s a new lens for viewing markets, for traders seeking deeper insight into hidden order within chaos.
" Where there is matter, there is geometry. " - Johannes Kepler
— Dskyz , Trade with insight. Trade with anticipation.
EMA Confluence Oscillator📌 EMA Confluence Oscillator + Signal
This oscillator helps detect ranging vs trending conditions by measuring EMA alignment, slope, and choppiness. It’s designed for traders who want to avoid chop and trade in clean directional moves.
⸻
🔍 How It Works:
• Uses 3 EMAs (Fast, Medium, Slow) to assess market structure
• Measures how flat the slow EMA is (low slope = range)
• Detects short-term momentum flips in fast/medium EMAs
• Calculates EMA spread to find tight, choppy zones
• Combines all signals into a Range Score (0–1 scale)
⸻
🧠 How to Use:
• High Range Score (near 1): Market likely ranging
• Low Range Score (near 0): More directional/trending
• Watch for crosses below the range threshold to spot trend breakouts
• Optional Signal Line helps smooth decision points
⸻
⚙️ Features:
• Custom lengths for 3 EMAs
• Adjustable slope and convergence thresholds
• Toggle smoothing and signal line
• Background highlight when market is likely in a range
• Clean layout designed for fast intraday analysis
⸻
🛠️ Input Settings Explained:
• Fast/Medium/Slow EMA: Controls trend detection windows
• Slope Lookback: Period used to assess flatness of slow EMA
• Convergence Threshold: How close EMAs must be to count as “tight”
• Smooth Output: Reduces noise in final Range Score
• Signal Line: Smoothed version of the score for easier reading
• Range Threshold: Level where choppiness is likely
• Show Background: Highlights range zones visually
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.
Breakout & Pullback | Auto S&D + Telegram AlertsBreakout & Pullback | Auto S&D + Telegram Alerts Achraf
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.
Dual MACD Overlay + Signal Cross AlertMacd indicator with 2 different settings that visually alert you when the signal lines cross.
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: 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,