Filter Information Box - PineCoders FAQWhen designing filters it can be interesting to have information about their characteristics, which can be obtained from the set of filter coefficients (weights). The following script analyzes the impulse response of a filter in order to return the following information:
 
  Lag
  Smoothness via the Herfindahl index
  Percentage Overshoot
  Percentage Of Positive Weights
 
The script also attempts to determine the type of the analyzed filter, and will issue warnings when the filter shows signs of unwanted behavior.
 DISPLAYED INFORMATION AND METHODS 
The script displays one box on the chart containing two sections. The filter metrics section displays the following information:
-  Lag  : Measured in bars and calculated from the convolution between the filter's impulse response and a linearly increasing sequence of value  0,1,2,3... . This sequence resets when the impulse response crosses under/over 0.
-  Herfindahl index  : A measure of the filter's smoothness described by Valeriy Zakamulin. The Herfindahl index measures the concentration of the filter weights by summing the squared filter weights, with lower values suggesting a smoother filter. With normalized weights the minimum value of the Herfindahl index for low-pass filters is  1/N  where  N  is the filter length.
-  Percentage Overshoot  : Defined as the maximum value of the filter step response, minus 1 multiplied by 100. Larger values suggest higher overshoots.
-  Percentage Positive Weights  : Percentage of filter weights greater than 0.
Each of these calculations is based on the filter's impulse response, with the impulse position controlled by the  Impulse Position  setting (its default is 1000). Make sure the number of inputs the filter uses is smaller than  Impulse Position  and that the number of bars on the chart is also greater than  Impulse Position . In order for these metrics to be as accurate as possible, make sure the filter weights add up to 1 for low-pass and band-stop filters, and 0 for high-pass and band-pass filters.
The comments section displays information related to the type of filter analyzed. The detection algorithm is based on the metrics described above. The script can detect the following type of filters:
 
  All-Pass
  Low-Pass
  High-Pass
  Band-Pass
  Band-Stop
 
It is assumed that the user is analyzing one of these types of filters. The comments box also displays various warnings. For example, a warning will be displayed when a low-pass/band-stop filter has a non-unity pass-band, and another is displayed if the filter overshoot is considered too important. 
 HOW TO SET THE SCRIPT UP 
In order to use this script, the user must first enter the filter settings in the section provided for this purpose in the top section of the script. The filter to be analyzed must then be entered into the:
 f(input) 
function, where `input` is the filter's input source. By default, this function is a simple moving average of period  length . Be sure to remove it.
If, for example, we wanted to analyze a Blackman filter, we would enter the following:
 
f(input)=>
    pi = 3.14159,sum = 0.,sumw = 0.
    for i = 0 to length-1
        k = i/length
        w = 0.42 - 0.5 * cos(2 * pi * k) + 0.08 * cos(4 * pi * k)
        sumw := sumw + w
        sum := sum + w*input 
    sum/sumw
 
 EXAMPLES 
In this section we will look at the information given by the script using various filters. The first filter we will showcase is the linearly weighted moving average (WMA) of period 9.
  
As we can see, its lag is 2.6667, which is indeed correct as the closed form of the lag of the WMA is equal to  (period-1)/3 , which for period 9 gives  (9-1)/3  which is approximately equal to 2.6667. The WMA does not have overshoots, this is shown by the the percentage overshoot value being equal to 0%. Finally, the percentage of positive weights is 100%, as the WMA does not possess negative weights. 
Lets now analyze the Hull moving average of period 9. This moving average aims to provide a low-lag response.
  
Here we can see how the lag is way lower than that of the WMA. We can also see that the Herfindahl index is higher which indicates the WMA is smoother than the HMA. In order to reduce lag the HMA use negative weights, here 55% (as there are 45% of positive ones). The use of negative weights creates overshoots, we can see with the percentage overshoot being 26.6667%.
The WMA and HMA are both low-pass filters. In both cases the script correctly detected this information. Let's now analyze a simple high-pass filter, calculated as follows:
 input - sma(input,length) 
  
Most weights of a high-pass filters are negative, which is why the lag value is negative. This would suggest the indicator is able to predict future input values, which of course is not possible. In the case of high-pass filters, the Herfindahl index is greater than 0.5 and converges toward 1, with higher values of  length . The comment box correctly detected the type of filter we were using.
Let's now test the script using the simple center of gravity bandpass filter calculated as follows:
 wma(input,length) - sma(input,length) 
  
The script correctly detected the type of filter we are using. Another type of filter that the script can detect is band-stop filters. A simple band-stop filter can be made as follows:
 input - (wma(input,length) - sma(input,length)) 
  
The script correctly detect the type of filter. Like high-pass filters the Herfindahl index is greater than 0.5 and converges toward 1, with greater values of  length . Finally the script can detect all-pass filters, which are filters that do not change the frequency content of the input.
 WARNING COMMENTS 
The script can give warning when certain filter characteristics are detected. One of them is non-unity pass-band for low-pass filters. This warning comment is displayed when the weights of the filter do not add up to 1. As an example, let's use the following function as a filter:
 sum(input,length) 
Here the filter pass-band has non unity, and the sum of the weights is equal to  length . Therefore the script would display the following comments:
  
We can also see how the metrics go wild (note that no filter type is detected, as the detected filter could be of the wrong type). The comment mentioning the detection of high overshoot appears when the percentage overshoot is greater than 50%. For example if we use the following filter:
 5*wma(input,length) - 4*sma(input,length)  
The script would display the following comment:
  
We can indeed see high overshoots from the filter:
  
 @alexgrover for PineCoders 
 Look first. Then leap.  
"the script"に関するスクリプトを検索
TTM Squeeze Scanner This script scans for TTM Squeezes for the crypto symbols included in the body of the script.  The timeframe for  the squeeze scan is controlled within the input not the chart.  
 This script is a merge of @Nico.Muselle's TTM Squeeze script and @QuantNomad's custom screener script.  Thanks to both of them!
Opening Range Break LRSThis script is designed for a trend-following, opening range breakout strategy. The main idea is to only trade breakouts that happen in the same direction as the short-term trend, which the script identifies using a linear regression slope.
1. Identify the Short-Term Trend
This is the first and most important step. The script does this for you using the Linear Regression and the bar coloring.
•	If the bars are colored BLUE: The linear regression slope is positive. This means the script considers the short-term trend to be UP. A trader using this script would only look for long (buy) trades.
•	If the bars are colored YELLOW: The linear regression slope is negative. This means the script considers the short-term trend to be DOWN. A trader using this script would only look for short (sell) trades.
This filter is designed to prevent you from trading a "false breakout" against the immediate momentum.
2. Watch the Opening Ranges Form
At the start of the trading session (8:30 AM by default), the script will begin drawing boxes for the 5, 15, 30, and 60-minute opening ranges you've enabled.
•	The 5-minute box (e.g., gray) will be set after the 8:30 - 8:35 period.
•	The 15-minute box (e.g., blue) will be set after the 8:30 - 8:45 period.
•	...and so on.
These boxes, which extend for the rest of the day, represent the key high and low levels established at the open. The "Live Box Extension" input simply keeps the right edge of the box a few bars away from the current price so you can see it clearly.
3. Look for a Filtered Breakout Signal
This is where the trend filter (Step 1) and the range boxes (Step 2) come together.
Bullish Trade Example (Long):
1.	A trader sees the bars are colored BLUE (uptrend). They are now only looking for a break above one of the ORB highs.
2.	They will ignore any break below the ORB lows, as that would be trading against the trend filter.
3.	The price moves up and finally closes above the 15-minute ORB high.
4.	The script will plot a green "Break 15" label. This is the trader's signal to enter a long trade.
Bearish Trade Example (Short):
1.	A trader sees the bars are colored YELLOW (downtrend). They are now only looking for a break below one of the ORB lows.
2.	They will ignore any break above the ORB highs.
3.	The price moves down and closes below the 5-minute ORB low.
4.	The script will plot a red "Break 5" label. This is the trader's signal to enter a short trade.
4. Use Multiple Timeframes for Context
The real power of this script is seeing all the ranges at once. A trader wouldn't just trade them in isolation.
•	Confirmation: A "Break 5" signal is a quick, early signal. But if the price also breaks the "15" and "30" minute highs, it signals much stronger bullish consensus, which might encourage the trader to hold the trade longer.
•	Support & Resistance: The other ORB levels act as a map for the day.
o	As Targets: If a trader takes a "Break 15" long signal, the 30-minute ORB high and 60-minute ORB high become logical profit targets.
o	As Warning Signs: If the price gives a "Break 5" long signal but is struggling right under the 15-minute high, a trader might wait for that 15-minute level to break before entering, seeing it as a key resistance level.
Summary: A Trader's Workflow
1.	Morning (8:30 AM): Watch the script. What color are the bars? (Blue = longs only, Yellow = shorts only).
2.	Wait: Let the 5, 15, 30, and 60-minute ranges form. The boxes will be drawn on the chart.
3.	Execute: Wait for a "Break" signal (a label) that matches your trend direction.
4.	Manage: Use the other ORB levels as potential profit targets or as confirmation of the move's strength.
5.	Single Signal: The "Single Signal Only" input, if checked, ensures they only get one signal per timeframe (e.g., one "Break 15" long, and that's it for the day), which helps prevent over-trading in choppy conditions.
ACR(Average Candle Range) With TargetsWhat is ACR?
The Average Candle Range (ACR) is a custom volatility metric that calculates the mean distance between the high and low of a set number of past candles. ACR focuses only on the actual candle range (high - low) of specific past candles on a chosen timeframe.
This script calculates and visualizes the Average Candle Range (ACR) over a user-defined number of candles on a custom timeframe. It displays a table of recent range values, plots dynamic bullish and bearish target levels, and marks the start of each new candle with a vertical line. All calculations update in real time as price action develops. This script was inspired by the “ICT ADR Levels - Judas x Daily Range Meter°” by toodegrees.
Key Features
 
 Custom Timeframe Selection: Choose any timeframe (e.g., 1D, 4H, 15m) for analysis.
 User-Defined Lookback: Calculate the average range across 1 to 10 previous candles.
 Dynamic Targets:
 Bullish Target: Current candle low + ACR.
 Bearish Target: Current candle high – ACR.
 Live Updates: Targets adjust intrabar as highs or lows change during the current candle.
 Candle Start Markers: Vertical lines denote the open of each new candle on the selected timeframe.
 Floating Range Table:
 Displays the current ACR value.
 Lists individual ranges for the previous five candles.
 Extend Target Lines: Choose to extend bullish and bearish target levels fully across the screen.
 Global Visibility Controls: Toggle on/off all visual elements (targets, vertical lines, and table) for a cleaner view.
 
How It Works
At each new candle on the user-selected timeframe, the script:
 
 Draws a vertical line at the candle’s open.
 Recalculates the ACR based on the inputted previous number of candles.
 Plots target levels using the current candle's developing high and low values.
 
Limitation
Once the price has already moved a full ACR in the opposite direction from your intended trade, the associated target loses its practical value. For example, if you intended to trade long but the bearish ACR target is hit first, the bullish target is no longer a reliable reference for that session.
Use Case
This tool is designed for traders who:
 
 Want to visualize the average movement range of candles over time.
 Use higher or lower timeframe candles as structural anchors.
 Require real-time range-based price levels for intraday or swing decision-making.
 
This script does not generate entry or exit signals. Instead, it supports range awareness and target projection based on historical candle behavior.
Key Difference from Similar Tools
While this script was inspired by “ICT ADR Levels - Judas x Daily Range Meter°” by toodegrees, it introduces a major enhancement: the ability to customize the timeframe used for calculating the range. Most ADR or candle-range tools are locked to a single timeframe (e.g., daily), but this version gives traders full control over the analysis window. This makes it adaptable to a wide range of strategies, including intraday and swing trading, across any market or asset.
Ultimate JLines & MTF EMA (Configurable, Labels)## Ultimate JLines & MTF EMA (Configurable, Labels) — Script Overview
This Pine Script is a comprehensive, multi-timeframe indicator based on J Trader concepts. It overlays various Exponential Moving Averages (EMAs), VWAP, inside bar highlights, and dynamic labels onto price charts. The script is highly configurable, allowing users to tailor which elements are displayed and how they appear.
### Key Features
#### 1. **Multi-Timeframe JLines**
- **JLines** are pairs of EMAs (default lengths: 72 and 89) calculated on several timeframes:
- 1 minute (1m)
- 3 minutes (3m)
- 5 minutes (5m)
- 1 hour (1h)
- Custom timeframe (user-selectable)
- Each pair can be visualized as individual lines and as a "cloud" (shaded area between the two EMAs).
- Colors and opacity for each timeframe are user-configurable.
#### 2. **200 EMA on Multiple Timeframes**
- Plots the 200-period EMA on selectable timeframes: 1m, 3m, 5m, 15m, and 1h.
- Each can be toggled independently and colored as desired.
#### 3. **9 EMA and VWAP**
- Plots a 9-period EMA, either on the chart’s current timeframe or a user-specified one.
- Plots VWAP (Volume-Weighted Average Price) for additional trend context.
#### 4. **5/15 EMA Cross Cloud (5min)**
- Calculates and optionally displays a shaded "cloud" between the 5-period and 15-period EMAs on the 5-minute chart.
- Highlights bullish (5 EMA above 15 EMA) and bearish (5 EMA below 15 EMA) conditions with different colors.
- Optionally displays the 5 and 15 EMA lines themselves.
#### 5. **Inside Bar Highlighting**
- Highlights bars where the current high is less than or equal to the previous high and the low is greater than or equal to the previous low (inside bars).
- Color is user-configurable.
#### 6. **9 EMA / VWAP Cross Arrows**
- Plots up/down arrows when the 9 EMA crosses above or below the VWAP.
- Arrow colors and visibility are configurable.
#### 7. **Dynamic Labels**
- On the most recent bar, displays labels for each enabled line (EMAs, VWAP), offset to the right for clarity.
- Labels include the timeframe, type, and current value.
### Customization Options
- **Visibility:** Each plot (line, cloud, arrow, label) can be individually toggled on/off.
- **Colors:** All lines, clouds, and arrows can be colored to user preference, including opacity for clouds.
- **Timeframes:** JLines and EMAs can be calculated on different timeframes, including a custom one.
- **Label Text:** Labels dynamically reflect current indicator values and are color-coded to match their lines.
### Technical Implementation Highlights
- **Helper Functions:** Functions abstract away the logic for multi-timeframe EMA calculation.
- **Security Calls:** Uses `request.security` to fetch data from other timeframes, ensuring accurate multi-timeframe plotting.
- **Efficient Label Management:** Deletes old labels and creates new ones only on the last bar to avoid clutter and maintain performance.
- **Conditional Plotting:** All visual elements are conditionally plotted based on user input, making the indicator highly flexible.
### Use Cases
- **Trend Identification:** Multiple EMAs and VWAP help traders quickly identify trend direction and strength across timeframes.
- **Support/Resistance:** 200 EMA and JLines often act as dynamic support/resistance levels.
- **Entry/Exit Signals:** Crosses between 9 EMA and VWAP, as well as 5/15 EMA clouds, can signal potential trade entries or exits.
- **Pattern Recognition:** Inside bar highlights aid in spotting consolidation and breakout patterns.
### Summary Table of Configurable Elements
| Feature | Timeframes | Cloud Option | Label Option | Color Customizable | Description |
|----------------------------|-------------------|--------------|--------------|--------------------|-----------------------------------------------|
| JLines (72/89 EMA) | 1m, 3m, 5m, 1h, Custom | Yes | Yes | Yes | Key trend-following EMAs with cloud fill |
| 200 EMA | 1m, 3m, 5m, 15m, 1h | No | Yes | Yes | Long-term trend indicator |
| 9 EMA | Any | No | Yes | Yes | Short-term trend indicator |
| VWAP | Chart TF | No | Yes | Yes | Volume-weighted average price |
| 5/15 EMA Cloud (5m) | 5m | Yes | No | Yes | Bullish/bearish cloud between 5/15 EMAs |
| Inside Bar Highlight | Chart TF | No | N/A | Yes | Highlights price consolidation |
| 9 EMA / VWAP Cross Arrows | Chart TF | No | N/A | Yes | Marks EMA/VWAP crossovers with arrows |
This script is ideal for traders seeking a robust, multi-timeframe overlay that combines trend, momentum, and pattern signals in a single, highly customizable indicator. I do not advocate to subscribe to JTrades or the system they tout. This is based on my own observations and not a copy of any JTrades scripts. It is open source to allow full transparency. 
Daily Percent Change LabelDaily Percent Change Label
Overview
This Pine Script displays the percentage change from the previous day's closing price as a text label near the current price level on the chart. It works seamlessly across any timeframe (daily, hourly, minute charts) by referencing the daily chart's previous close, making it perfect for traders tracking daily performance.
The label is displayed with a semi-transparent background (green for positive changes, red for negative changes) and white text, ensuring a clean and readable appearance.
Features
Accurate Daily Percent Change: Calculates the percentage change based on the previous day's closing price, even on intraday timeframes (e.g., 1-hour, 5-minute).
Dynamic Label: Shows the percentage change as a label aligned with the current price, updating in real-time.
Color-Coded Background: Semi-transparent green background for positive changes and red for negative changes.
Customizable: Adjust label position, size, color, and style to fit your preferences.
Minimal Impact: No additional plots or graphs, keeping the chart uncluttered.
How to Use
Add the Script:
Copy and paste the script into the Pine Editor in TradingView.
Click "Add to Chart" to apply it.
Check the Output:
A text label (e.g., "+2.34%" or "-1.56%") appears near the current price with a semi-transparent background.
The label is colored green (positive) or red (negative) and updates in real-time.
Switch Timeframes:
Works on any timeframe. The percentage change is always calculated relative to the previous day's close.
Customization Options
Modify the label.new function to customize the label:
Label Position:
Change style=label.style_label_left to label.style_label_right or label.style_label_down to adjust label placement.
Adjust bar_index with an offset (e.g., bar_index + 1) to move the label horizontally.
Text Color:
Modify textcolor=color.white to another color (e.g., color.rgb(255, 255, 0) for yellow).
Background Color:
Adjust color=percent_change >= 0 ? color.new(color.green, 50) : color.new(color.red, 50) to change transparency (e.g., color.new(color.green, 0) for no transparency).
Text Size:
Change size=size.normal to size.small or size.large for smaller or larger text.
Code Details
Timeframe Handling: Uses request.security with the "D" timeframe to fetch the previous day's closing price, ensuring accuracy on intraday charts.
Performance: Updates only on the last bar (barstate.islast) for optimal performance.
Dynamic Styling: Background color changes based on the direction of the price change.
Notes
The label is positioned near the current price for easy reference. To move it closer to the Y-axis, adjust the bar_index offset.
For different reference points (e.g., weekly close), modify the request.security timeframe (e.g., "W" for weekly).
Ensure the script is copied correctly without extra spaces or characters. Use a plain text editor (e.g., Notepad) for copying.
Feedback
Please share your feedback or customizations in the comments! If you find this script helpful, give it a thumbs-up or let others know how you're using it. Happy trading!
Anchored Darvas Box## ANCHORED DARVAS BOX 
---
### OVERVIEW  
**Anchored Darvas Box** lets you drop a single timestamp on your chart and build a Darvas-style consolidation zone forward from that exact candle. The indicator freezes the first user-defined number of bars to establish the range, verifies that price respects that range for another user-defined number of bars, then waits for the first decisive breakout. The resulting rectangle captures every tick of the accumulation phase and the exact moment of expansion—no manual drawing, complete timestamp precision.
---
### HISTORICAL BACKGROUND  
Nicolas Darvas’s 1950s box theory tracked institutional accumulation by hand-drawing rectangles around tight price ranges. A trade was triggered only when price escaped the rectangle.  
The anchored version preserves Darvas’s logic but pins the entire sequence to a user-chosen candle: perfect for analysing a market open, an earnings release, FOMC minute, or any other catalytic bar.
---
### ALGORITHM DETAIL  
1. **ANCHOR BAR**  
   *You provide a timestamp via the settings panel.* The script waits until the chart reaches that bar and records its index as **startBar**.
2. **RANGE DEFINITION — BARS 1-7**  
   • `rangeHigh` = highest high of bars 1-7 plus optional tolerance.  
   • `rangeLow`  = lowest  low  of bars 1-7 minus optional tolerance.  
3. **RANGE VALIDATION — BARS 8-14**  
   • Price must stay inside ` `.  
   • Any violation aborts the test; no box is created.  
4. **ARMED STATE**  
   • If bars 8-14 hold the range, two live guide-lines appear:  
     – **Green** at `rangeHigh`  
     – **Red**   at `rangeLow`  
   • The script is now “armed,” waiting indefinitely for the first true breakout.
5. **BREAKOUT & BOX CREATION**  
   • **Up breakout**  =`high > rangeHigh` → rectangle drawn in **green**.  
   • **Down breakout**=`low  < rangeLow` → rectangle drawn in **red**.  
   • Box extends from **startBar** to the breakout bar and never updates again.  
   • Optional labels print the dollar and percentage height of the box at its left edge.
6. **OPTIONAL COOLDOWN**  
   • After the box is painted the script can stay silent for a user-defined number of bars, letting you study the fallout without another range immediately arming on top of it.
---
### INPUT PARAMETERS  
• **ANCHOR TIME** – Precise yyyy-mm-dd HH:MM:SS that seeds the sequence.  
• **BARS TO DEFINE RANGE** – Default 7; affects both definition and validation windows.  
• **OPTIONAL TOLERANCE** – Absolute price buffer to ignore micro-wicks.  
• **COOLDOWN BARS AFTER BREAKOUT** – Pause length before the indicator is allowed to re-anchor (set to zero to disable).  
• **SHOW BOX DISTANCE LABELS** – Toggle to print Δ\$ and Δ% on every completed box.
---
### USER WORKFLOW  
1. Add the indicator, open settings, and set **ANCHOR TIME** to the candle you care about (e.g., “2025-04-23 09:30:00” for NYSE open).  
2. Watch live as the script:  
   – Paints the seven-bar range.  
   – Draws validation lines.  
   – Locks in the box on breakout.  
3. Use the box boundaries as structural stops, targets, or context for further trades.
---
### PRACTICAL APPLICATIONS  
• **OPENING RANGE BREAKOUTS** – Anchor at the first second of the session; capture the initial 7-bar range and trade the first clean break.  
• **EVENT STUDIES** – Anchor at a news candle to measure immediate post-event volatility.  
• **VOLUME PROFILE FUSION** – Combine the anchored box with VPVR to see if the breakout occurs at a high-volume node or a low-liquidity pocket.  
• **RISK DISCIPLINE** – Stop-loss can sit just inside the opposite edge of the anchored range, enforcing objective risk.
---
### ADVANCED CUSTOMISATION IDEAS  
• **MULTIPLE ANCHORS** – Clone the indicator and anchor several boxes (e.g., London open, New York open).  
• **DYNAMIC WINDOW** – Switch the 7-bar fixed length to a volatility-scaled length (ATR percentile).  
• **STRATEGY WRAPPER** – Turn the indicator into a `strategy{}` script and back-test anchored boxes on decades of data.
---
### FINAL THOUGHTS  
Anchored Darvas Boxes give you Darvas’s timeless range-break methodology anchored to any candle of interest—perfect for dissecting openings, economic releases, or your own bespoke “important” bars with laboratory precision.
Combined EMA/Smiley & DEM System## 🔷 General Overview
This script creates an advanced technical analysis system for TradingView, combining multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), dynamic Fibonacci levels, and ATR (Average True Range) analysis. It presents the results clearly through interactive, real-time tables directly on the chart.
---
## 🔹 Indicator Structure
The script consists of two main parts:
### **1. EMA & SMA Combined System with Fibonacci**
- **Purpose:**  
  Provides visual insights by comparing multiple EMA/SMA periods and identifying significant dynamic price levels using Fibonacci ratios around a calculated "Golden" line.
- **Components:**
  - **Moving Averages (MAs)**:
    - 20 EMAs (periods from 20 to 400)
    - 20 SMAs (also from 20 to 400)
  - **Golden Line:**  
    Calculated as the average of all EMAs and SMAs.
  - **Dynamic Fibonacci Levels:**  
    Key ratios around the Golden line (0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.0) dynamically adjust based on market conditions.
  - **Fibonacci Labels:**  
    Labels are shown next to Fibonacci lines, indicating their numeric value clearly on the chart.
- **Table (Top Right Corner):**
  - Displays:
    - **Input:** EMA/SMA periods sorted by their current average price levels.
    - **AVG:** The average of corresponding EMA & SMA pairs.
    - **EMA & SMA Values:** Individual EMA/SMA values clearly marked.
    - **Dynamic Highlighting:** Highlights the row whose average (EMA+SMA)/2 is closest to the current price, helping identify immediate price action significance.
  - **Sorting Logic:**  
    Each EMA/SMA pair is dynamically sorted based on their average values. Color coding (red/green) is used:
    - **Green:** EMA/SMA pairs with shorter periods when their average is lower.
    - **Red:** EMA/SMA pairs with longer periods when their average is lower.
    - **Star (⭐):** Represents the "Golden" average clearly.
---
### **2. DEM System (Dynamic EMA/ATR Metrics)**
- **Purpose:**  
  Provides detailed ATR statistics to assess market volatility clearly and quickly.
- **Components:**
  - **Moving Averages:**
    - SMA lines: 25, 50, 100, 200.
  - **Bollinger Bands:**
    - Based on 20-period SMA of highs and standard deviation of lows.
  - **ATR Analysis:**
    - ATR calculations for multiple periods (1-day, 10, 20, 30, 40, 50).
    - **ATR Premium:** Average ATR of all calculated periods, providing an overarching volatility indicator.
  - **ATR Table (Bottom Right Corner):**
    - Displays clearly structured ATR values and percentages relative to the current close price:
      - Columns: **ATR Period**, **Value**, and **% of Close**.
      - Rows: Each specific ATR (1D, 10, 20, 30, 40, 50), plus ATR premium.
    - The ATR premium is highlighted in yellow to signify its importance clearly.
---
## 🔹 Key Features and Logic Explained
- **Dynamic EMA/SMA Sorting:**
  The script computes the average of each EMA/SMA pair and sorts them dynamically on each bar, highlighting their relative importance visually. This allows traders to easily interpret the strength of current support/resistance levels based on moving averages.
- **Closest EMA/SMA Pair to Current Price:**
  Calculates the absolute difference between the current price and all EMA/SMA averages, highlighting the closest one for quick reference.
- **Fibonacci Ratios:**
  - Dynamically calculated Fibonacci levels based on the "Golden" EMA/SMA average give clear visual guidance for potential targets, supports, and resistances.
  - Labels are continuously updated and placed next to levels for clarity.
- **ATR Volatility Analysis:**
  - Provides immediate insight into market volatility with absolute and relative (percentage-based) ATR values.
  - ATR premium summarizes volatility across multiple timeframes clearly.
---
## 🔹 Practical Use Case:
- Traders can quickly identify support/resistance and critical price zones through EMA/SMA and Fibonacci combinations.
- Useful in assessing immediate volatility, guiding stop-loss and take-profit levels through detailed ATR metrics.
- The dynamic highlighting in tables provides intuitive, real-time decision support for active traders.
---
## 🔹 How to Use this Script:
1. **Adjust EMA & SMA Lengths** from indicator settings if different periods are preferred.
2. **Monitor dynamic Fibonacci levels** around the "Golden" average to identify possible reversal or continuation points.
3. **Check EMA/SMA table:** Rows highlighted indicate immediate significance concerning current market price.
4. **ATR table:** Use volatility metrics for better risk management.
---
## 🔷 Conclusion
This advanced Pine Script indicator efficiently combines multiple EMAs, SMAs, dynamic Fibonacci retracement levels, and volatility analysis using ATR into a comprehensive real-time analytical tool, enhancing traders' decision-making capabilities by providing clear and actionable insights directly on the TradingView chart.
Transient Impact Model [ScorsoneEnterprises]This indicator is an implementation of the Transient Impact Model. This tool is designed to show the strength the current trades have on where price goes before they decay. 
Here are links to more sophisticated research articles about Transient Impact Models than this post arxiv.org and arxiv.org 
The way this tool is supposed to work in a simple way, is when impact is high price is sensitive to past volume, past trades being placed. When impact is low, it moves in a way that is more independent from past volume. In a more sophisticated system, perhaps transient impact should be calculated for each trade that is placed, not just the total volume of a past bar. I didn't do it to ensure parameters exist and aren’t na, as well as to have more iterations for optimization. Note that the value will change as volume does, as soon as a new candle occurs with no volume, the values could be dramatically different.
How it works
There are a few components to this script, so we’ll go into the equation and then the other functions used in this script.
 // Transient Impact Model
transient_impact(params, price_change, lkb) =>
    alpha = array.get(params, 0)
    beta = array.get(params, 1)
    lambda_ = array.get(params, 2)
    instantaneous = alpha * volume 
    transient = 0.0
    for t = 1 to lkb - 1
        if na(volume )
            break
        transient := transient + beta * volume  * math.exp(-lambda_ * t)
    predicted_change = instantaneous + transient
    math.pow(price_change - predicted_change, 2) 
The parameters alpha, beta, and lambda all represent a different real thing. 
Alpha (α):
Represents the instantaneous impact coefficient. It quantifies the immediate effect of the current volume on the price change. In the equation, instantaneous = alpha * volume , alpha scales the current bar's volume (volume ) to determine how much of the price change is due to immediate market impact. A larger alpha suggests that current volume has a stronger instantaneous influence on price.
Beta (β):
Represents the transient impact coefficient.It measures the lingering effect of past volumes on the current price change. In the loop calculating transient, beta * volume  * math.exp(-lambda_ * t) shows that beta scales the volume from previous bars (volume ), contributing to a decaying effect over time. A higher beta indicates a stronger influence from past volumes, though this effect diminishes with time due to the exponential decay factor.
Lambda (λ):
Represents the decay rate of the transient impact.It controls how quickly the influence of past volumes fades over time in the transient component. In the term math.exp(-lambda_ * t), lambda determines the rate of exponential decay, where t is the time lag (in bars). A larger lambda means the impact of past volumes decays faster, while a smaller lambda implies a longer-lasting effect.
So in full.
The instantaneous term, alpha * volume , captures the immediate price impact from the current volume.
The transient term, sum of beta * volume  * math.exp(-lambda_ * t) over the lookback period, models the cumulative, decaying effect of past volumes.
The total predicted_change combines these two components and is compared to the actual price change to compute an error term, math.pow(price_change - predicted_change, 2), which the script minimizes to optimize alpha, beta, and lambda.
Other parts of the script.
Objective function:
This is a wrapper function with a function to minimize so we get the best alpha, beta, and lambda values. In this case it is the Transient Impact Function, not something like a log-likelihood function, helps with efficiency for a high iteration count.
Finite Difference Gradient:
This function calculates the gradient of the objective function we spoke about. The gradient is like a directional derivative. Which is like the direction of the rate of change. Which is like the direction of the slope of a hill, we can go up or down a hill. It nudges around the parameter, and calculates the derivative of the parameter. The array of these nudged around parameters is what is returned after they are optimized.
Minimize:
This is the function that actually has the loop and calls the Finite Difference Gradient each time. Here is where the minimizing happens, how we go down the hill. If we are below a tolerance, we are at the bottom of the hill.
Applied
After an initial guess, we optimize the parameters and get the transient impact value. This number is huge, so we apply a log to it to make it more readable. From here we need some way to tell if the value is low or high. We shouldn’t use standard deviation because returns are not normally distributed, an IQR is similar and better for non normal data. We store past transient impact values in an array, so that way we can see the 25th and 90th percentiles of the data as a rolling value. If the current transient impact is above the 90th percentile, it is notably high. If below the 25th percentile, notably low. All of these values are plotted so we can use it as a tool.
Tool examples:
The idea around it is that when impact is low, there is room for big money to get size quickly and move prices around.
   
Here we see the price reacting in the IQR Bands. We see multiple examples where the value above the 90th percentile, the red line, corresponds to continuations in the trend, and below the 25th percentile, the purple line, corresponds to reversals. There is no guarantee these tools will be perfect, that is outlined in these situations, however there is clearly a correlation in this tool and trend.
   
This tool works on any timeframe, daily as we saw before, or lower like a two minute. The bands don’t represent a direction, like bullish or bearish, we need to determine that by interpreting price action. We see at open and at close there are the highest values for the transient impact. This is to be expected as these are the times with the highest volume of the trading day.
   
This works on futures as well as equities with the same context. Volume can be attributed to volatility as well. In volatile situations, more volatility comes in, and we can perceive it through the transient impact value.
Inputs
Users can enter the lookback value.
No tool is perfect, the transient impact value is also not perfect and should not be followed blindly. It is good to use any tool along with discretion and price action. 
Change % Inteligente - NQ / ES / YMTopstep Compliance: Daily Price Change % Alert (NQ / ES / YM)
Script Purpose
This script helps funded traders (especially those using Topstep or similar programs) monitor the real-time percentage change of major equity index futures: Nasdaq (NQ), S&P 500 (ES), and Dow Jones (YM).
⚠️ Why it matters
Topstep prohibits trading within 2% of the daily price limits set by the CME. If a trader holds a position too close to those limits, they risk account disqualification.
📊 How it works
• Detects the instrument: NQ1!, ES1!, YM1!, or M2025 contracts  
• Calculates the real-time % change from today’s market open  
• Simulates daily CME price limits (+7% / -7%)  
• Highlights when price enters the last 2% of the limit range (prohibited zone)  
• Displays a clean, floating panel with the current % change and a warning if necessary  
• Sends a visual and optional audio alert when in the prohibited zone  
🧠 What makes this script unique?
This tool is **not for technical analysis**. It focuses exclusively on **funding program compliance** and **account protection**, which is not covered by other public scripts. It’s lightweight, intuitive, and designed for traders who manage risk like professionals.
✅ Open-source and ready for review.
✅ CHART SETUP FOR PUBLICATION
✔️ Use a clean chart
✔️ Only apply this script
✔️ Make sure the panel is visible (top-right or top-center recommended)
❌ No extra indicators or drawings
✔️ Use NQM2025, ESM2025 or YMM2025 on a volatile day (to show -1% to -3% range)
 INSTRUCTIONS 
1. Add the script to your chart.
2. Use it with NQ1!, ES1!, or YM1! (or M2025 contracts).
3. The panel will show today’s price change %.
4. If the market is within the last 2% of the CME price limit, a warning will appear.
5. Use this to avoid violating Topstep’s trading rules during volatile days.
VIX bottom/top with color scale [Ox_kali]📊  Introduction 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The “VIX Bottom/Top with Color Scale” script is designed to provide an intuitive, color-coded visualization of the VIX (Volatility Index), helping traders interpret market sentiment and volatility extremes in real time.
It segments the VIX into clear threshold zones, each associated with a specific market condition—ranging from fear to calm—using a dynamic color-coded system.
 This script offers significant value for the following reasons: 
Intuitive Risk Interpretation: Color-coded zones make it easy to interpret market sentiment at a glance.
Dynamic Trend Detection: A 200-period SMA of the VIX is plotted and dynamically colored based on trend direction.
Customization and Flexibility: All colors are editable in the parameters panel, grouped under “## Color parameters ##”.
Visual Clarity: Key thresholds are marked with horizontal lines for quick reference.
Practical Trading Tool: Helps identify high-risk and low-risk environments based on volatility levels.
🔍  Key Indicators 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 VIX (CBOE Volatility Index) : Measures market volatility and investor fear.
 SMA 200 : Long-term trendline of the VIX, with color-coded direction (green = uptrend, red = downtrend).
 Color-coded VIX Levels: 
🔴 33+ → Something bad just happened
🟠 23–33 → Something bad is happening
🟡 17–23 → Something bad might happen
🟢 14–17 → Nothing bad is happening
✅ 12–14 → Nothing bad will ever happen
🔵 <12 → Something bad is going to happen
🧠  Originality and Purpose 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Unlike traditional VIX indicators that only plot a line, this script enhances interpretation through visual segmentation and dynamic trend tracking.
It serves as a risk-awareness tool that transforms the VIX into a simple, emotional market map.
This is the first version of the script, and future updates may include alerts, background fills, and more advanced features.
⚙️  How It Works 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The script maps the current VIX value to a range and applies the corresponding color.
It calculates a SMA 200 and colors it green or red depending on its slope.
It displays horizontal dotted lines at key thresholds (12, 14, 17, 23, 33).
All colors are configurable via input parameters under the group: "## Color parameters ##".
🧭  Indicator Visualization and Interpretation 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The VIX line changes color based on market condition zones.
The SMA line shows long-term direction with dynamic color.
Horizontal threshold lines visually mark the transitions between volatility zones.
Ideal for quickly identifying periods of fear, caution, or stability.
🛠️  Script Parameters 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Grouped under “## Color parameters ##”, the following elements are customizable:
🎨 VIX Zone Colors: 
33+ → Red
23–33 → Orange
17–23 → Yellow
14–17 → Light Green
12–14 → Dark Green
<12 → Blue
📈  SMA Colors: 
Uptrend → Green
Downtrend → Red
These settings allow users to match the script’s visuals to their preferred chart style or theme.
✅  Conclusion 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The “VIX Bottom/Top with Color Scale” is a clean, powerful script designed to simplify how traders view volatility.
By combining long-term trend data with real-time color-coded sentiment analysis, this script becomes a go-to reference for managing risk, timing trades, or simply staying in tune with market mood.
🧪  Notes 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This is version 1 of the script. More features such as alert conditions, background fill, and dashboard elements may be added soon. Feedback is welcome!
💡 Color code concept inspired by the original VIX interpretation chart by @nsquaredvalue on Twitter. Big thanks for the visual clarity!  💡
⚠️  Disclaimer 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This script is a visual tool designed to assist in market analysis. It does not guarantee future performance and should be used in conjunction with proper risk management. Past performance is not indicative of future results.
Bitcoin Polynomial Regression ModelThis is the main version of the script. Click  here  for the Oscillator part of the script.
 💡Why this model was created: 
One of the key issues with most existing models, including our own  Bitcoin Log Growth Curve Model , is that they often fail to realistically account for diminishing returns. As a result, they may present overly optimistic bull cycle targets (hence, we introduced alternative settings in our previous Bitcoin Log Growth Curve Model).
This new model however, has been built from the ground up with a primary focus on incorporating the principle of diminishing returns. It directly responds to this concept, which has been briefly explored  here .
 📉The theory of diminishing returns: 
This theory suggests that as each four-year market cycle unfolds, volatility gradually decreases, leading to more tempered price movements. It also implies that the price increase from one cycle peak to the next will decrease over time as the asset matures. The same pattern applies to cycle lows and the relationship between tops and bottoms. In essence, these price movements are interconnected and should generally follow a consistent pattern. We believe this model provides a more realistic outlook on bull and bear market cycles.
To better understand this theory, the relationships between cycle tops and bottoms are outlined below:https://www.tradingview.com/x/7Hldzsf2/
 🔧Creation of the model: 
For those interested in how this model was created, the process is explained here. Otherwise, feel free to skip this section.
This model is based on two separate cubic polynomial regression lines. One for the top price trend and another for the bottom. Both follow the general cubic polynomial function:
 ax^3 +bx^2 + cx + d. 
In this equation, x represents the weekly bar index minus an offset, while a, b, c, and d are determined through polynomial regression analysis. The input (x, y) values used for the polynomial regression analysis are as follows:
Top regression line (x, y) values:
 
 113, 18.6
 240, 1004
 451, 19128
 655, 65502
 
Bottom regression line (x, y) values:
 
 103, 2.5
 267, 211
 471, 3193
 676, 16255
 
The values above correspond to historical Bitcoin cycle tops and bottoms, where x is the weekly bar index and y is the weekly closing price of Bitcoin. The best fit is determined using metrics such as R-squared values, residual error analysis, and visual inspection. While the exact details of this evaluation are beyond the scope of this post, the following optimal parameters were found:
Top regression line parameter values:
 
 a: 0.000202798
 b: 0.0872922
 c: -30.88805
 d: 1827.14113
 
Bottom regression line parameter values:
 
 a: 0.000138314
 b: -0.0768236
 c: 13.90555
 d: -765.8892
 
 📊Polynomial Regression Oscillator: 
This publication also includes the oscillator version of the this model which is displayed at the bottom of the screen. The oscillator applies a logarithmic transformation to the price and the regression lines using the formula  log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed top and bottom regression line with the formula:
 normalized price = log(close) - log(bottom regression line) / log(top regression line) - log(bottom regression line) 
This transformation results in a price value between 0 and 1 between both the regression lines. The Oscillator version can be found here.
 🔍Interpretation of the Model: 
In general, the red area represents a caution zone, as historically, the price has often been near its cycle market top within this range. On the other hand, the green area is considered an area of opportunity, as historically, it has corresponded to the market bottom.
The top regression line serves as a signal for the absolute market cycle peak, while the bottom regression line indicates the absolute market cycle bottom.
Additionally, this model provides a predicted range for Bitcoin's future price movements, which can be used to make extrapolated predictions. We will explore this further below.
 🔮Future Predictions: 
Finally, let's discuss what this model actually predicts for the potential upcoming market cycle top and the corresponding market cycle bottom. In our previous post  here , a cycle interval analysis was performed to predict a likely time window for the next cycle top and bottom:
In the image, it is predicted that the next top-to-top cycle interval will be 208 weeks, which translates to November 3rd, 2025. It is also predicted that the bottom-to-top cycle interval will be 152 weeks, which corresponds to October 13th, 2025. On the macro level, these two dates align quite well. For our prediction, we take the average of these two dates: October 24th 2025. This will be our target date for the bull cycle top.
Now, let's do the same for the upcoming cycle bottom. The bottom-to-bottom cycle interval is predicted to be 205 weeks, which translates to October 19th, 2026, and the top-to-bottom cycle interval is predicted to be 259 weeks, which corresponds to October 26th, 2026. We then take the average of these two dates, predicting a bear cycle bottom date target of October 19th, 2026.
Now that we have our predicted top and bottom cycle date targets, we can simply reference these two dates to our model, giving us the Bitcoin top price prediction in the range of 152,000 in Q4 2025 and a subsequent bottom price prediction in the range of 46,500 in Q4 2026.
For those interested in understanding what this specifically means for the predicted diminishing return top and bottom cycle values, the image below displays these predicted values. The new values are highlighted in yellow:
And of course, keep in mind that these targets are just rough estimates. While we've done our best to estimate these targets through a data-driven approach, markets will always remain unpredictable in nature. What are your targets? Feel free to share them in the comment section below.
Bitcoin Polynomial Regression OscillatorThis is the oscillator version of the script. Click  here  for the other part of the script.
 💡Why this model was created: 
One of the key issues with most existing models, including our own  Bitcoin Log Growth Curve Model , is that they often fail to realistically account for diminishing returns. As a result, they may present overly optimistic bull cycle targets (hence, we introduced alternative settings in our previous Bitcoin Log Growth Curve Model).
This new model however, has been built from the ground up with a primary focus on incorporating the principle of diminishing returns. It directly responds to this concept, which has been briefly explored  here .
 📉The theory of diminishing returns: 
This theory suggests that as each four-year market cycle unfolds, volatility gradually decreases, leading to more tempered price movements. It also implies that the price increase from one cycle peak to the next will decrease over time as the asset matures. The same pattern applies to cycle lows and the relationship between tops and bottoms. In essence, these price movements are interconnected and should generally follow a consistent pattern. We believe this model provides a more realistic outlook on bull and bear market cycles.
To better understand this theory, the relationships between cycle tops and bottoms are outlined below:https://www.tradingview.com/x/7Hldzsf2/
 🔧Creation of the model: 
For those interested in how this model was created, the process is explained here. Otherwise, feel free to skip this section.
This model is based on two separate cubic polynomial regression lines. One for the top price trend and another for the bottom. Both follow the general cubic polynomial function:
 ax^3 +bx^2 + cx + d. 
In this equation, x represents the weekly bar index minus an offset, while a, b, c, and d are determined through polynomial regression analysis. The input (x, y) values used for the polynomial regression analysis are as follows:
Top regression line (x, y) values:
 
 113, 18.6
 240, 1004
 451, 19128
 655, 65502
 
Bottom regression line (x, y) values:
 
 103, 2.5
 267, 211
 471, 3193
 676, 16255
 
The values above correspond to historical Bitcoin cycle tops and bottoms, where x is the weekly bar index and y is the weekly closing price of Bitcoin. The best fit is determined using metrics such as R-squared values, residual error analysis, and visual inspection. While the exact details of this evaluation are beyond the scope of this post, the following optimal parameters were found:
Top regression line parameter values:
 
 a: 0.000202798
 b: 0.0872922
 c: -30.88805
 d: 1827.14113
 
Bottom regression line parameter values:
 
 a: 0.000138314
 b: -0.0768236
 c: 13.90555
 d: -765.8892
 
 📊Polynomial Regression Oscillator: 
This publication also includes the oscillator version of the this model which is displayed at the bottom of the screen. The oscillator applies a logarithmic transformation to the price and the regression lines using the formula  log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed top and bottom regression line with the formula:
 normalized price = log(close) - log(bottom regression line) / log(top regression line) - log(bottom regression line) 
This transformation results in a price value between 0 and 1 between both the regression lines. 
 🔍Interpretation of the Model: 
In general, the red area represents a caution zone, as historically, the price has often been near its cycle market top within this range. On the other hand, the green area is considered an area of opportunity, as historically, it has corresponded to the market bottom.
The top regression line serves as a signal for the absolute market cycle peak, while the bottom regression line indicates the absolute market cycle bottom.
Additionally, this model provides a predicted range for Bitcoin's future price movements, which can be used to make extrapolated predictions. We will explore this further below.
 🔮Future Predictions: 
Finally, let's discuss what this model actually predicts for the potential upcoming market cycle top and the corresponding market cycle bottom. In our previous post  here , a cycle interval analysis was performed to predict a likely time window for the next cycle top and bottom:
In the image, it is predicted that the next top-to-top cycle interval will be 208 weeks, which translates to November 3rd, 2025. It is also predicted that the bottom-to-top cycle interval will be 152 weeks, which corresponds to October 13th, 2025. On the macro level, these two dates align quite well. For our prediction, we take the average of these two dates: October 24th 2025. This will be our target date for the bull cycle top.
Now, let's do the same for the upcoming cycle bottom. The bottom-to-bottom cycle interval is predicted to be 205 weeks, which translates to October 19th, 2026, and the top-to-bottom cycle interval is predicted to be 259 weeks, which corresponds to October 26th, 2026. We then take the average of these two dates, predicting a bear cycle bottom date target of October 19th, 2026.
Now that we have our predicted top and bottom cycle date targets, we can simply reference these two dates to our model, giving us the Bitcoin top price prediction in the range of 152,000 in Q4 2025 and a subsequent bottom price prediction in the range of 46,500 in Q4 2026.
For those interested in understanding what this specifically means for the predicted diminishing return top and bottom cycle values, the image below displays these predicted values. The new values are highlighted in yellow:
And of course, keep in mind that these targets are just rough estimates. While we've done our best to estimate these targets through a data-driven approach, markets will always remain unpredictable in nature. What are your targets? Feel free to share them in the comment section below.
TimeMapTimeMap is a visual price-reference indicator designed to help traders rapidly visualize how current price levels relate to significant historical closing prices. It overlays your chart with reference lines representing past weekly, monthly, quarterly (3-month), semi-annual (6-month), and annual closing prices. By clearly plotting these historical price references, TimeMap helps traders quickly gauge price position relative to historical market structure, aiding in the identification of trends, support/resistance levels, and potential reversals.
How it Works:
The indicator calculates the precise number of historical bars corresponding to weekly, monthly, quarterly, semi-annual, and annual intervals, dynamically adjusting according to your chart’s timeframe (intraday, daily, weekly, monthly) and chosen market type (Stocks US, Crypto, Forex, or Futures). Historical closing prices from these periods are plotted directly on your chart as horizontal reference lines.
For intraday traders, the script accurately calculates historical offsets considering regular and extended trading sessions (e.g., pre-market and after-hours sessions for US stocks), ensuring correct positioning of historical lines.
User-Configurable Inputs Explained in Detail:
Market Type:
Allows you to specify your trading instrument type, automatically adjusting calculations for:
- Stocks US (default): 390 minutes per regular session (780 minutes if extended hours enabled), 5 trading days/week.
- Crypto: 1440 minutes/day, 7 trading days/week.
- Forex: 1440 minutes/day, 5 trading days/week.
- Futures: 1320 minutes/day, 5 trading days/week.
Show Weekly Close:
When enabled, plots a line at the exact closing price from one week ago. Provides short-term context and helps identify recent price momentum.
Show Monthly Close:
When enabled, plots a line at the exact closing price from one month ago. Helpful for evaluating medium-term price positioning and monthly trend strength.
Show 3-Month Close:
When enabled, plots a line at the exact closing price from three months ago. Useful for assessing quarterly market shifts, intermediate trend changes, and broader market sentiment.
Show 6-Month Close:
When enabled, plots a line at the exact closing price from six months ago. Useful for identifying semi-annual trends, significant price pivots, and longer-term support/resistance levels.
Show 1-Year Close:
When enabled, plots a line at the exact closing price from one year ago. Excellent for assessing long-term market direction and key annual price levels.
Enable Smoothing:
Activates a Simple Moving Average (SMA) smoothing of historical reference lines, reducing volatility and providing clearer visual references. Recommended for traders preferring less volatile reference levels.
Smoothing Length:
Determines the number of bars used in calculating the SMA smoothing of historical lines. Higher values result in smoother but slightly delayed reference lines; lower values offer more immediate yet more volatile levels.
Use Extended Hours (Intraday Only):
When enabled (only applicable for Stocks US), it accounts for pre-market and after-hours trading sessions, providing accurate intraday historical line calculations based on extended sessions (typically 780 minutes/day total).
Important Notes and Compliance:
- This indicator does not provide trading signals, recommendations, or predictions. It serves purely as a visual analytical tool to supplement traders’ existing methods.
- Historical lines plotted are strictly based on past available price data; the indicator never accesses future data or data outside the scope of Pine Script’s standard capabilities.
- The script incorporates built-in logic to avoid runtime errors if insufficient historical data exists for a selected timeframe, ensuring robustness even with limited historical bars.
- TimeMap is original work developed exclusively by Julien Eche (@Julien_Eche). It does not reuse or replicate third-party or existing open-source scripts.
Recommended Best Practices:
- Use TimeMap as a complementary analytical reference, not as a standalone strategy or trade decision-making tool.
- Adapt displayed historical periods and smoothing settings based on your trading style and market approach.
- Default plot colors are optimized for readability on dark-background charts; adjust as necessary according to your preference and chart color scheme.
This script is published open-source to benefit the entire TradingView community and fully complies with all TradingView script publishing rules and guidelines.
Wave N + KDJ + Volumi + SMC + IchimokuWave N + KDJ + Volume + SMC + Ichimoku Indicator
Overview
This script is a multi-layered technical indicator designed to provide traders with enhanced market insights by combining five key methodologies:
	•	Wave N Pattern (Price Action)
	•	KDJ Oscillator (Momentum)
	•	Volume Filtering (Confirmation)
	•	Smart Money Concepts (Order Blocks) (Institutional Activity)
	•	Ichimoku Cloud (Trend and Support/Resistance)
By integrating these components, the indicator identifies high-probability trading signals, early warnings of trend shifts, and institutional price zones to improve decision-making in volatile markets.
⸻
How It Works
1️⃣ Wave N Pattern (Price Action Structure)
The Wave N pattern is a classic price action formation that helps spot potential trend reversals and continuations:
	•	A Bullish Wave N is detected when a higher low and a higher high structure appears.
	•	A Bearish Wave N is detected when a lower high and a lower low structure forms.
2️⃣ KDJ Oscillator (Momentum & Trend Strength)
The KDJ Indicator is a variation of the Stochastic Oscillator that adds a third line, J, to amplify sensitivity to trend movements.
	•	J > 50 indicates bullish momentum.
	•	J < 50 indicates bearish momentum.
	•	The script includes an early warning signal when J crosses 50, suggesting a possible trend shift.
3️⃣ Volume Filtering (Trade Confirmation)
To avoid false signals, the script integrates volume confirmation:
	•	A signal is valid only if the volume is above the 20-period EMA of volume.
	•	This ensures that trade signals are supported by strong market participation.
4️⃣ Smart Money Concepts (Order Blocks)
Order Blocks represent areas of institutional interest, where large traders accumulate or distribute positions.
	•	The script detects bullish order blocks (potential support) and bearish order blocks (potential resistance).
	•	These areas help identify optimal entry and exit points.
5️⃣ Ichimoku Cloud (Trend & Dynamic Support/Resistance)
The Ichimoku Cloud is used to confirm trend direction:
	•	Baseline (Kijun-sen) acts as a key trend filter.
	•	Senkou Span A & B form the cloud (Kumo), indicating dynamic support/resistance.
	•	Buy signals require price to be above the baseline, while sell signals require price to be below the baseline.
⸻
Trading Signals & Visual Elements
✅ BUY Signal (Green Arrow)
Occurs when:
	•	A Bullish Wave N forms
	•	J > 50 (Bullish KDJ Signal)
	•	Volume is above EMA threshold
	•	Price is above the Ichimoku Baseline
❌ SELL Signal (Red Arrow)
Occurs when:
	•	A Bearish Wave N forms
	•	J < 50 (Bearish KDJ Signal)
	•	Volume is above EMA threshold
	•	Price is below the Ichimoku Baseline
⚠️ Early Warning (Trend Shift Signal)
	•	An early warning appears when J crosses 50, indicating a possible upcoming trend shift.
	•	The line color changes based on the potential move:
	•	Green/Blue → Possible Uptrend
	•	Red/Orange → Possible Downtrend
⸻
Why This Indicator is Unique?
Unlike simple trend-following indicators, this script:
	•	Combines Price Action, Momentum, Volume, and Institutional Order Flow for a multi-dimensional approach.
	•	Filters out weak signals using volume confirmation and Ichimoku.
	•	Provides early warnings before major trend shifts.
	•	Visualizes Smart Money Order Blocks, giving traders an edge in spotting institutional zones.
⸻
Best Timeframes & Markets
📊 Recommended Timeframes:
	•	1H & 1D (works best on medium/long-term trends)
💹 Markets:
	•	Crypto, Forex, and Stocks
This indicator is designed for traders who value confluence and strong confirmation in their strategies. Whether you are a trend trader, swing trader, or institutional flow analyst, this tool can help refine your decision-making process.
🚀 Optimize your trades with Wave N + KDJ + Volume + SMC + Ichimoku! 🚀
Time-based Alerts for Trading Windows🌟  Time-based Alerts for Trading Windows  🌐📈
 This is a re-uploaded script as the previous one got hidden. 
This Time-based Alerts for Trading Windows script is a highly customizable and reliable tool designed to assist traders in managing automated strategies or manually monitoring specific market conditions. Inspired by CrossTrade's Time-based Alert, this script is tailored for those who rely on precise time windows to trigger actions, such as sending webhook signals or managing Expert Advisors (EAs).
Whether you are a scalper, day trader, or algorithmic trader, this script empowers you to stay on top of your trades with fully customizable time-based alerts.
🛠️  Customizable Time Alerts 
This indicator allows you to create up to 12 unique time windows by specifying the exact hour and minute for each alert. Each time window corresponds to an individual alert condition, making it perfect for managing trades during specific market sessions or key time periods.
 For example: 
 
 Alert 1 can be set at 9:30 AM (market open).
 Alert 2 can be set at 3:55 PM (just before market close).
 Each alert can be toggled on or off in the indicator settings, allowing you to manage alerts without having to reconfigure your script.
 You can adjust the colours to fit any colour scheme you like!
 
🕒  Odd and Even Time Alerts 
The script comes with three built-in alert type categories:
 
 Odd Alerts (marked with a green triangle on the chart): These correspond to odd-numbered inputs like Alert 1, Alert 3, Alert 5, and so on.
 Even Alerts (marked with a red triangle on the chart): These correspond to even-numbered inputs like Alert 2, Alert 4, Alert 6, and so on.
 You can also customize all 12 alerts individually to include a custom alert message
 
These alerts serve as a convenient way to differentiate between multiple trading strategies or market conditions. You can customize alert messages for odd and even alerts directly from TradingView’s alert panel.
🔗  Webhook Integration for Automation 
This script is fully compatible with webhook-based automation. By configuring your alerts in TradingView, you can send signals to trading bots, EAs, or any third-party system. For example, you can:
 
 Turn off an EA at a specific time (e.g., 3:55 PM EST).
 Send buy/sell signals to your bot during predefined trading windows.
 Simply use TradingView’s alert message editor to format webhook payloads for your automation system.
 
🌐  Timezone Flexibility 
Trading happens across multiple time zones, and this script accounts for that. You can toggle between:
 
 Eastern Time (New York): Ideal for most US-based markets.
 Central Time (Exchange): Useful for futures and commodities traders.
 
This ensures your alerts are always in sync with your preferred time zone, eliminating confusion.
🎨 Visual Indicators 
The script plots visual markers directly on your chart to indicate active alerts:
 
 Up Facing Triangles: Represent odd-numbered alerts, providing a quick reference for these time windows.
 Down Facing Triangles: Represent even-numbered alerts, helping you track different strategies or conditions.
 
These visual markers make it easy to see when alerts are triggered, even at a glance.
📈  Practical Use Case 
Let’s say you’re trading the USTEC index on a 1-minute chart. You want to:
 
 Turn off your trading bot at 16:55 EST to avoid after-market volatility.
 Trigger a re-entry signal at 17:30 EST to capture moves during the Asian session.
 Visually monitor these actions on your chart for easy reference.
 
This script makes it possible with precision alerts and webhook integration. Simply configure the time windows in the settings and set up your alerts in TradingView.
🚨  How to Set Up Alerts 
 
 Enable or Disable Alerts: Use the script’s settings to toggle specific alerts on or off as needed.
 Set Custom Time Windows: Define the hour and minute for each alert in the settings panel.
 Create Alerts in TradingView:
 Go to the TradingView alert panel.
 Select the condition (e.g., "Odd Time-based Alert (Green)" or "Even Time-based Alert (Red)").
 Customize the alert message for webhook integration or personal notification.
 Choose the trigger type: Once Per Bar or Once Per Bar Close to keep the alert active.
 Integrate with Webhooks: Use the alert message field to format payloads for automation systems like MT4, MT5, or third-party bots.
 
📋  Key Notes 
 
 Alerts can trigger indefinitely if set to "Once Per Bar" or "Once Per Bar Close".
 Always ensure the expiration date is set far in the future to avoid unexpected alert deactivation.
 Test webhook messages and alert configurations thoroughly before using them in live trading.
 This script is a powerful addition to your trading toolbox, offering precision, flexibility, and automation capabilities. Whether you’re turning off an EA, managing trades during market sessions, or automating strategies via webhooks, this script is here to support you.
 
Start using the Time-based Alerts for Trading Windows today and trade with confidence! 🚀✨
JMA Quantum Edge: Adaptive Precision Trading System JMA Quantum Edge: Adaptive Precision Trading System - Enhanced Visuals & Risk Management
Get ready to experience a groundbreaking trading strategy that adapts in real-time to market conditions! This powerful, open-source script combines advanced technical analysis with state-of-the-art risk management tools, designed to give you the edge you need in today's dynamic markets.
What It Does:
Adaptive JMA Indicator:
Utilizes a custom Jurik Moving Average (JMA) that adjusts its sensitivity based on market volatility, ensuring you get precise signals even in the most fluctuating environments.
Dynamic Risk Management:
Features built-in support for partial exits (scaling out) to secure profits, along with an optional Kelly Criterion-based position sizing that tailors your exposure based on historical performance metrics.   
Robust Error Handling:
Incorporates market condition filters—like minimum volume and maximum allowed gap percentage—to ensure trades are only executed under favorable conditions.                             
Vivid Visual Enhancements:
Enjoy an animated background that reflects market momentum, dynamic pivot markers, and clearly drawn trend channels. Plus, interactive tables provide real-time performance analytics and detailed error metrics.                  
Fully Customizable:
With a comprehensive set of inputs, you can easily tailor the strategy to your personal trading style and market preferences. Adjust everything from JMA parameters to refresh intervals for tables and labels!                                                                                                  
How to Use It:
Add the Script:
Copy and paste the script into the Pine Script Editor on TradingView and click “Add to Chart.”
Configure Your Settings:
Customize your risk management (capital, commission, position sizing, partial exits, etc.) and tweak the JMA settings to match your preferred trading style. Use the extensive input panel to adjust visuals, alerts, and more.                                                                           
Backtest & Optimize:
Run the strategy in the Strategy Tester to analyze its historical performance. Monitor real-time analytics and error metrics via the interactive tables, and fine-tune your parameters for optimal performance.
Go Live with Confidence:
Once you're satisfied with the backtest results, use the generated signals for live trading, and let the system help you stay ahead in fast-paced markets!                                 
                                         How to use the imputs:
This cutting-edge strategy is designed to adapt to changing market conditions and offers you complete control over your trading parameters. Here’s a breakdown of what each group of inputs does and how you should use them:                           
 Risk Management & Trade Settings
Recalculate on Every Tick:
What it does: When enabled, the strategy recalculates on every price update.
Recommendation: Leave it true for fast charts.
Initial Capital:
What it does: Sets your starting capital for backtesting, which influences position sizing and performance metrics.
Recommendation: Start with $10,000 (or adjust according to your trading capital).
Commission (%):
What it does: Simulates the cost per trade.
Recommendation: Use a realistic rate (e.g., 0.04%).                            
Position Size & Quantity Type:
What they do: Define how large each trade will be. Choose between a fixed unit amount or a percentage of equity.
Recommendation: For beginners, the default fixed value is a good start. Experiment later with percentage-based sizing if needed.
Order Comment:
What it does: Adds a label to your orders for easier tracking.
Allow Reverse Orders:
What it does: If disabled, the strategy will close opposing positions before entering a new trade, reducing conflicts.
Enable Dynamic Position Sizing:
What it does: Adjusts trade size based on current volatility.
Recommendation: Beginners may start with this disabled until they understand basic sizing.                                 
Partial Exit Inputs:
What they do:
Enable Partial Exits: When turned on, you can scale out of your position to lock in profits.
Partial Exit Profit (%): The profit percentage that triggers a partial exit.
Partial Exit Percentage: The percentage of your current position to exit. Recommendation: Use defaults (e.g., 5% profit, 50% exit) to secure profits gradually.
Kelly Criterion Option:
What it does: When enabled, adjusts your position sizing using historical performance (win rate and profit factor).
Recommendation: Beginners might leave this disabled until comfortable with backtest performance metrics.                                  
Market Condition Filters:
What they do:
Minimum Volume: Ensures trades occur only when there’s sufficient market activity.
Maximum Gap (%): Prevents trading if there’s an unusually large gap between the previous close and current open. Recommendation: Defaults work well for most markets. If trades seem erratic, consider tightening these limits.                           
JMA Settings
Price Source:
What it does: The input series for the JMA calculation, typically set to the closing price.
JMA Length:
What it does: Controls the smoothing period of the JMA. Lower values are more sensitive; higher values smooth out the noise. Recommendation: Start with 21.
JMA Phase & Power:
What they do: Adjust how responsive the JMA is. Phase controls timing; power adjusts the intensity. Recommendation: Default settings (63 phase and 3 power) are a balanced starting point.                  
Visual Settings & Style
Show JMA Line, Pivot Lines, and Pivot Labels:
What they do: Toggle visual elements on your chart for easier signal identification.
Pivot History Count:
What it does: Limits how many historical pivot markers are displayed.
Color Settings (Up/Down Neon Colors):
What they do: Set the visual cues for buy and sell signals.
Pivot Marker & Line Style:
What they do: Choose the style and thickness of your pivot markers and lines.
Show Stats Panel:
What it does: Displays real-time performance and error metrics.                  
Dynamic Background & Visual Enhancements
Animate Background:
What it does: Changes the background color based on market momentum.
Show Trend Channels & Volume Zones:
What they do: Draw trend channels and highlight areas of high volatility/volume.
Show Data-Rich Labels:
What it does: Displays key metrics like volume, error percentage, and momentum on the chart.
High Volatility Threshold:
What it does: Determines the multiplier for when the chart background should change due to high volatility.                                                
Multi-Timeframe Settings
Higher Timeframe:
What it does: Uses a higher timeframe’s JMA for trend confirmation. Recommendation: Use Daily ('D') or Weekly ('W') for broader trend analysis.
Show HTF Trend Zone & Opacity:
What they do: Display a visual zone from the higher timeframe to help confirm trends.
6. Trailing Stop Settings
Trailing Stop ATR Factor & Offset Multiplier:
What they do: Calculate trailing stops based on the Average True Range (ATR), adjusting stop distances dynamically. Recommendation: Default settings are a good balance but can be fine-tuned based on asset volatility.                                         
Alerts & Notifications
Alerts on Pivot Formation & JMA Crossover:
What they do: Notify you when key events occur.
Dynamic Power Threshold:
What it does: Sets the sensitivity for dynamic alerts.
8. Static Stop Loss / Take Profit
Static Stop Loss (%) & Take Profit (%):
What they do: Allow you to set fixed stop loss or take profit levels. Recommendation: Leave them at 0 to disable if you prefer dynamic risk management, or set them if you have strict risk/reward preferences.   
Advanced Settings
ATR Length:
What it does: Determines the period for ATR calculation, impacting trailing stop sensitivity. Recommendation: Start with 14.                                
Optimization Feedback & Enhanced Error Analysis
Error Metric Length & Error Threshold (%):
What they do: Calculate error metrics (like average error, skewness, and kurtosis) to help you fine-tune the JMA. Recommendation: Use the defaults and adjust if the error metrics seem off during backtesting.                      
UI - User-Driven Tweaking & Table Customization
Parameter Tweaker Panel, Debug/Performance Table Settings:
What they do: Provide interactive tables that display real-time performance, error metrics, and allow you to monitor strategy parameters.
Refresh Frequency Options (Table & Label Refresh Intervals):
What they do: Set how often the tables and labels update.
Recommendation: Start with an interval of 1 bar; increase it if your chart is too busy.    
Important for Beginners:
Default Settings:
All default values have been chosen for balanced performance across different markets. If you ever experience unexpected behavior, start by resetting the inputs to their defaults.
Step-by-Step Adjustments:
Experiment by changing one setting at a time while observing how the strategy’s signals and performance metrics change. This will help you understand the impact of each parameter.
Resetting to Defaults:
If things seem off or you’re not getting the expected results, you can always reset the indicator. Either reload the script or use the “Reset Inputs” option (if available) to revert to the default settings.
Jump in, experiment, and enjoy the power of adaptive precision trading. This strategy is built to grow with your skills—have fun exploring and refining your trading edge!              
                                                       Happy trading!        
     
    
    
   
    
   
Multi-indicator Signal Builder [Skyrexio]Overview 
 Multi-Indicator Signal Builder  is a versatile, all-in-one script designed to streamline your trading workflow by combining multiple popular technical indicators under a single roof. It features a single-entry, single-exit logic, intrabar stop-loss/take-profit handling, an optional time filter, a visually accessible condition table, and a built-in statistics label. Traders can choose any combination of 12+ indicators (RSI, Ultimate Oscillator, Bollinger %B, Moving Averages, ADX, Stochastic, MACD, PSAR, MFI, CCI, Heikin Ashi, and a “TV Screener” placeholder) to form entry or exit conditions. This script aims to simplify strategy creation and analysis, making it a powerful toolkit for technical traders.
 Indicators Overview 
 1.	RSI (Relative Strength Index) 
Measures recent price changes to evaluate overbought or oversold conditions on a 0–100 scale.
 2.	Ultimate Oscillator (UO) 
Uses weighted averages of three different timeframes, aiming to confirm price momentum while avoiding false divergences.
 3.	Bollinger %B 
Expresses price relative to Bollinger Bands, indicating whether price is near the upper band (overbought) or lower band (oversold).
 4.	Moving Average (MA) 
Smooths price data over a specified period. The script supports both SMA and EMA to help identify trend direction and potential crossovers.
 5.	ADX (Average Directional Index) 
Gauges the strength of a trend (0–100). Higher ADX signals stronger momentum, while lower ADX indicates a weaker trend.
 6.	Stochastic 
Compares a closing price to a price range over a given period to identify momentum shifts and potential reversals.
 7.	MACD (Moving Average Convergence/Divergence) 
Tracks the difference between two EMAs plus a signal line, commonly used to spot momentum flips through crossovers.
 8.	PSAR (Parabolic SAR) 
Plots a trailing stop-and-reverse dot that moves with the trend. Often used to signal potential reversals when price crosses PSAR.
 9.	MFI (Money Flow Index) 
Similar to RSI but incorporates volume data. A reading above 80 can suggest overbought conditions, while below 20 may indicate oversold.
 10.	CCI (Commodity Channel Index) 
Identifies cyclical trends or overbought/oversold levels by comparing current price to an average price over a set timeframe.
 11.	Heikin Ashi 
A type of candlestick charting that filters out market noise. The script uses a streak-based approach (multiple consecutive bullish or bearish bars) to gauge mini-trends.
 12.	TV Screener 
A placeholder condition designed to integrate external buy/sell logic (like a TradingView “Buy” or “Sell” rating). Users can override or reference external signals if desired.
 
 Unique Features 
 1.	Multi-Indicator Entry and Exit 
You can selectively enable any subset of 12+ classic indicators, each with customizable parameters and conditions. A position opens only if all enabled entry conditions are met, and it closes only when all enabled exit conditions are satisfied, helping reduce false triggers.
 2.	Single-Entry / Single-Exit with Intrabar SL/TP 
The script supports a single position at a time. Once a position is open, it monitors intrabar to see if the price hits your stop-loss or take-profit levels before the bar closes, making results more realistic for fast-moving markets.
 3.	Time Window Filter 
Users may specify a start/end date range during which trades are allowed, making it convenient to focus on specific market cycles for backtesting or live trading.
 4.	Condition Table and Statistics 
A table at the bottom of the chart lists all active entry/exit indicators. Upon each closed trade, an integrated statistics label displays net profit, total trades, win/loss count, average and median PnL, etc.
 5.	Seamless Alerts and Automation 
  Configure alerts in TradingView using “Any alert() function call.”
  The script sends JSON alert messages you can route to your own webhook.
  The indicator can be integrated with Skyrexio alert bots to automate execution on major cryptocurrency exchanges 
 6.	Optional MA/PSAR Plots 
For added visual clarity, optionally plot the chosen moving averages or PSAR on the chart to confirm signals without stacking multiple indicators.
 
 Methodology 
 1. Multi-Indicator Entry Logic 
When multiple entry indicators are enabled (e.g., RSI + Stochastic + MACD), the script requires all signals to align before generating an entry. Each indicator can be set for crossovers, crossunders, thresholds (above/below), etc. This “AND” logic aims to filter out low-confidence triggers.
 2. Single-Entry Intrabar SL/TP 
   One Position At a Time:  Once an entry signal triggers, a trade opens at the bar’s close.
   Intrabar Checks:  Stop-loss and take-profit levels (if enabled) are monitored on every tick. If either is reached, the position closes immediately, without waiting for the bar to end. 
 3. Exit Logic 
   All Conditions Must Agree:  If the trade is still open (SL/TP not triggered), then all enabled exit indicators must confirm a closure before the script exits on the bar’s close. 
 4. Time Filter 
   Optional Trading Window:  You can activate a date/time range to constrain entries and exits strictly to that interval. 
 
 Justification of Methodology 
   Indicator Confluence:  Combining multiple tools (RSI, MACD, etc.) can reduce noise and false signals.
   Intrabar SL/TP:  Capturing real-time spikes or dips provides a more precise reflection of typical live trading scenarios.
   Single-Entry Model:  Straightforward for both manual and automated tracking (especially important in bridging to bots).
   Custom Date Range:  Helps refine backtesting for specific market conditions or to avoid known irregular data periods. 
 
 How to Use 
 1.	Add the Script to Your Chart 
  In TradingView, open  Indicators , search for “Multi-indicator Signal Builder”.
  Click to add it to your chart. 
 2.	Configure Inputs 
   Time Filter:  Set a start and end date for trades.
   Alerts Messages:  Input any JSON or text payload needed by your external service or bot.
   Entry Conditions:  Enable and configure any indicators (e.g., RSI, MACD) for a confluence-based entry.
   Close Conditions:  Enable exit indicators, along with optional SL (negative %) and TP (positive %) levels. 
 3.	Set Up Alerts 
  In TradingView, select “Create Alert” → Condition = “Any alert() function call” → choose this script.
   Entry Alert:  Triggers on the script’s entry signal.
   Close Alert:  Triggers on the script’s close signal (or if SL/TP is hit).
   Skyrexio Alert Bots:  You can route these alerts via webhook to Skyrexio alert bots to automate order execution on major crypto exchanges (or any other supported broker). 
 4.	Visual Reference 
  A  condition table  at the bottom summarizes active signals.
   Statistics Label  updates automatically as trades are closed, showing PnL stats and distribution metrics. 
 
 Backtesting Guidelines 
   Symbol/Timeframe:  Works on multiple assets and timeframes; always do thorough testing.
   Realistic Costs:  Adjust commissions and potential slippage to match typical exchange conditions.
   Risk Management:  If using the built-in stop-loss/take-profit, set percentages that reflect your personal risk tolerance.
   Longer Test Horizons:  Verify performance across diverse market cycles to gauge reliability. 
 Example of statistic calculation 
   Test Period:  2023-01-01 to 2025-12-31
   Initial Capital:  $1,000
   Commission:  0.1%, Slippage ~5 ticks
   Trade Count:  468 (varies by strategy conditions)
   Win rate:  76% (varies by strategy conditions)
   Net Profit:  +96.17% (varies by strategy conditions) 
 
 Disclaimer 
This indicator is provided  strictly for informational and educational purposes . 
  It does not constitute financial or trading advice.
  Past performance never guarantees future results.
  Always test thoroughly in demo environments before using real capital. 
 
Enjoy exploring the  Multi-Indicator Signal Builder!  Experiment with different indicator combinations and adjust parameters to align with your trading preferences, whether you trade manually or link your alerts to external automation services. Happy trading and stay safe!
Buy Signal Forex & Crypto v0 ImprovedPurpose of the Script: 
This script is designed to generate buy and sell signals for trading Forex and cryptocurrencies by analyzing price trends using exponential moving averages (EMAs), volatility, and volume filters. The signals are displayed as arrows on the chart.
What the Script Does
Input Settings:
The script allows the user to configure various settings, such as the lengths of EMAs, a higher timeframe for trend confirmation, and thresholds for volume and volatility (ATR - Average True Range).
Key settings:
5 EMA Length – Length of the short-term EMA.
13 EMA Length – Length of the medium-term EMA.
26 EMA Length – Length of the long-term EMA.
21 EMA Length – Used for trend confirmation on a higher timeframe.
Higher Timeframe – Lets you select a timeframe (e.g., daily) for confirming the overall trend.
ATR Threshold – Filters out signals when the market's volatility is too low.
Volume Filter – Ensures sufficient trading activity before generating signals.
Calculating EMAs (Exponential Moving Averages):
Four EMAs are calculated:
ema5 (short-term), ema13 (medium-term), ema26 (long-term), and ema21 (higher timeframe confirmation).
These EMAs help determine price trends and crossovers, which are critical for identifying buy and sell opportunities.
Trend Confirmation Using a Higher Timeframe:
The 21 EMA on the higher timeframe (e.g., daily) is used to confirm the overall direction of the market.
Defining Signal Conditions:
Buy Signal:
A buy signal is generated when:
ema5 crosses above ema13 (indicating a bullish trend).
ema5 crosses above ema26 (stronger bullish confirmation).
The closing price is above ema5, ema13, ema26, and the 21 EMA on the higher timeframe.
The market's volatility (ATR) is above the defined threshold.
The volume meets the conditions or volume filtering is disabled.
Sell Signal:
A sell signal is generated when:
ema5 crosses below ema13 (indicating a bearish trend).
ema5 crosses below ema26 (stronger bearish confirmation).
The closing price is below ema5, ema13, ema26, and the 21 EMA on the higher timeframe.
The market's volatility (ATR) is above the defined threshold.
The volume meets the conditions or volume filtering is disabled.
Volume Filtering:
Ensures there’s enough trading activity by comparing the current volume to a 20-period moving average of volume.
Persistent Variables:
These variables (crossed13 and crossed13Sell) help track whether the short-term EMA (ema5) has crossed the medium-term EMA (ema13). This prevents false or repeated signals.
Displaying Signals on the Chart:
Buy signals are displayed as green upward arrows below the price.
Sell signals are displayed as red downward arrows above the price.
 How It Helps Traders: 
This script provides visual cues for potential entry and exit points by combining moving average crossovers, volatility, volume, and higher timeframe trend confirmation. It works well for trending markets and ensures signals are filtered for stronger conditions to reduce noise.
Uptrick: Arbitrage OpportunityINTRODUCTION  
This script, titled Uptrick: Arbitrage Monitor, is a Pine Script™ indicator that aims to help traders quickly visualize potential arbitrage scenarios across multiple cryptocurrency exchanges. Arbitrage, in general, involves taking advantage of price differences for the same asset across different trading platforms. By comparing market prices of the same symbol on two user-selected exchanges, as well as scanning a broader list of exchanges, this script attempts to signal areas where you might want to buy on one exchange and sell on another. It includes various graphical tools, calculations, and an optional Automated Detection signal feature, allowing users to incorporate more advanced data scanning into their trading decisions. Keep in mind that transaction fees must also be considered in real-world scenarios. These fees can negate potential profits and, in some cases, result in a net loss. 
PURPOSE  
The primary purpose of this indicator is to show potential percentage differences between the same cryptocurrency trading pairs on two different exchanges. This difference is displayed numerically, visually as a line chart, and it is also tested against user-defined thresholds. With the threshold in place, buy and sell signals can be generated. The script allows you to quickly gauge how significant a spread is between two exchanges and whether that spread surpasses a specified threshold. This is particularly useful for arbitrage trading, where an asset is bought at a lower price on one exchange and sold at a higher price on another, capitalizing on price discrepancies. By identifying these opportunities, traders can potentially secure profits across different markets.
WHY IT WAS MADE  
This script was developed to help traders who frequently look for arbitrage opportunities in the fast-paced cryptocurrency market. Cryptocurrencies sometimes experience quick price divergences across different exchanges. By having an automated approach that compares and displays prices, traders can spend less time manually tracking price discrepancies and more time focusing on actual trading strategies. The script was also made with user customization in mind, allowing you to toggle an optional Automated-based approach and choose different moving average methods to smooth out the displayed price difference.  
WHAT ARBITRAGE IS  
Arbitrage is the practice of buying an asset on one market (or exchange) at a lower price and simultaneously selling it on another market where the price is higher, thus profiting from the price difference. In cryptocurrency markets, these price differentials can occur across multiple exchanges due to varying liquidity, trading volume, geographic factors, or market inefficiencies. Though sometimes small, these differences can be exploited for profit when approached methodically.  
EXPLANATION OF INPUTS  
The script includes a variety of user inputs that help tailor the indicator to your specific needs:  
1. Compared Symbol 1: This is the primary symbol you want to track (for example, BTCUSDT).  Make sure it's written in all capital and make sure that it's price from that exchange is available on Tradingview.
2. Compare Exchange 1: The first exchange on which the script will request pricing data for the chosen symbol.  
3. Compared to Exchange: The second exchange, used for the comparison.  
4. Opportunity Threshold (%): A percentage threshold that, when exceeded by the price difference, can trigger buy or sell signals.  
5. Plot Style?: Allows you to choose between plotting the raw difference line or a moving average of that difference.  
6. MA Type: Select among SMA, EMA, WMA, RMA, or HMA for your moving average calculation.  
7. MA Length: The lookback period for the selected moving average.  
8. Plot Buy/Sell Signals?: Enables or disables the plotting of arrows signaling potential buy or sell zones based on threshold crossovers.  
9. Automated Detection?: Toggles an additional multi-exchange data scan feature that calculates the highest and lowest prices for the specified symbol across a predefined list of exchanges.  
CALCULATIONS  
At its core, the script calculates price1 and price2 using the request.security function to fetch close prices from two selected exchanges. The difference is measured as (price1 - price2) / price2 * 100. This results in a percentage that indicates how much higher or lower price1 is relative to price2. Additionally, the script calculates a slope for this difference, which helps color the line depending on whether it is trending up or down. If you choose the moving average option, the script will replace the raw difference data with one of several moving average calculations (SMA, EMA, WMA, RMA, or HMA).  
The script also includes an iterative scan of up to 15 different exchanges for Automated detection, collecting the highest and lowest price across all those exchanges. If the Automated option is enabled, it compiles a potential recommendation: buy at the cheapest exchange price and sell at the most expensive one. The difference across all exchanges (allExDiffPercent) is calculated using (highestPriceAll - lowestPriceAll) / lowestPriceAll * 100.  
WHAT AUTOMATED DETECTION SIGNAL DOES  
If enabled, the Automated detection feature scans all 15 supported exchanges for the specified symbol. It then identifies the exchange with the highest price and the exchange with the lowest price. The script displays a recommended action: buy on the lowest-exchange price and sell on the highest-exchange price. While called “Automated,” it is essentially a multi-exchange data query that automates a portion of research by consolidating different price points. It does not replace thorough analysis or guaranteed execution; it simply provides an overview of potential extremes.  
WHAT ALL-EX-DIFF IS  
The variable allExDiffPercent is used to show the overall difference between the highest price and the lowest price found among the 15 pre-chosen exchanges. This figure can be useful for anyone wanting a big-picture view of how large the arbitrage spread might be across the broader market.  
SIGNALS AND HOW THEY ARE GENERATED  
The script provides two main modes of signal generation:  
1. Raw Difference Mode: If the user chooses “Use Normal Line,” the script compares the percentage difference of the two selected exchanges (price1 and price2) to the user-defined threshold. When the difference crosses under the positive threshold, a sell signal is displayed (red arrow). Conversely, when the difference crosses above the negative threshold, a buy signal is displayed (green arrow).  
2. Moving Average Mode: If the user selects “Use Moving Average,” the script instead references the moving average values (maValue). The signals fire under similar conditions but use the average line to gauge whether the threshold has been crossed.  
HOW TO USE THE INDICATOR  
1. Add the script to your chart in TradingView.  
2. In the script’s settings panel, configure the symbol you wish to compare (for example, BTCUSDT), choose the two exchanges you want to evaluate, and set your desired threshold.  
3. Optionally, pick a moving average type and length if you prefer a smoother representation of the difference.  
4. Enable or disable buy/sell signals according to your preference.  
5. If you’d like to see potential extremes among a broader list of exchanges, enable Automated Detection. Keep in mind that this feature runs additional security requests, so it might slow down performance on weaker devices or if you already have many scripts running.  
EXCHANGES TO USE  
The script currently supports up to 15 exchanges: BYBIT, BINANCE, MEXC, BLOFIN, BITGET, OKX, KUCOIN, COINBASE, COINEX, PHEMEX, POLONIEX, GATEIO, BITSTAMP, and KRAKEN. You can choose any two of these for direct comparison, and if you enable the Automated detection, it will attempt to query them all to find extremes in real time.  
VISUALS
The exchanges and current prices & differences are all plotted in the table while the colored line represents the difference in the price. The two thresholds colored red are where signals are generated. A cross below the upper threshold is a sell signal and a cross above the lower threshold is a buy signal. In the line at the bottom, purple is a negative slope and aqua is a positive slope.
LIMITATIONS AND POTENTIAL PROBLEMS  
If you enable too many visual elements such as signals, additional lines, and the Automated-based scanning table, you may find that your chart becomes cluttered, or text might overlap. One workaround is to remove and reapply the indicator to refresh its display. You may also want to reduce the number of displayed table rows by disabling some features if your chart becomes too crowded. Sometimes there might be an error that the price of an asset is not available on an exchange, to fix this, go and select another exchange to compare it to, or if it happens in Automated detection, choose a different asset, ideally more widely spread.
UNIQUENESS  
This indicator stands out due to its multifaceted approach: it doesn’t just look at two exchanges but optionally scans up to 15 exchanges in real time, presenting users with a much broader view of the market. The dual-mode system (raw difference vs. moving average) allows for both immediate, unfiltered signals and smoother, noise-reduced signals depending on user preference. By default, it introduces dynamic visual cues through color changes when the slope of the difference transitions upward or downward. The optional Automated detection, while not a deep learning system, adds a functional intelligence layer by collating extreme price points from multiple exchanges in one place, thereby streamlining the manual research process. This combination of features gives the script a unique edge in the TradingView ecosystem, catering equally to novices wanting a straightforward approach and to advanced users looking for an aggregated multi-exchange analysis.
CONCLUSION  
Uptrick: Arbitrage Monitor is a versatile and customizable Pine Script™ indicator that highlights price differences for a specified symbol between two user-selected exchanges. Through signals, threshold-based alerts, and optional Automated detection across multiple exchanges, it aims to support traders in identifying potential arbitrage opportunities quickly and efficiently. This script makes no guarantees of profitability but can serve as a valuable tool to add to your trading toolkit. Always use caution when implementing arbitrage strategies, and be mindful of market risks, exchange fees, and latency.  
 ADDITIONAL DISCLOSURES  
This script is provided for educational and informational purposes only. It does not constitute financial advice or a guarantee of performance. Users are encouraged to conduct thorough research and consider the inherent risks of arbitrage trading. Market conditions can change rapidly, and orders may fail to execute at desired prices, especially when large price discrepancies attract competition from other traders.  
 
HOD/LOD/PMH/PML/PDH/PDL Strategy by @tradingbauhaus This script is a trading strategy @tradingbauhaus designed to trade based on key price levels, such as the High of Day (HOD), Low of Day (LOD), Premarket High (PMH), Premarket Low (PML), Previous Day High (PDH), and Previous Day Low (PDL). Below, I’ll explain in detail what the script does:
Core Functionality of the Script:
Calculates Key Price Levels:
HOD (High of Day): The highest price of the current day.
LOD (Low of Day): The lowest price of the current day.
PMH (Premarket High): The highest price during the premarket session (before the market opens).
PML (Premarket Low): The lowest price during the premarket session.
PDH (Previous Day High): The highest price of the previous day.
PDL (Previous Day Low): The lowest price of the previous day.
Draws Horizontal Lines on the Chart:
Plots horizontal lines on the chart for each key level (HOD, LOD, PMH, PML, PDH, PDL) with specific colors for easy visual identification.
Defines Entry and Exit Rules:
Long Entry (Buy): If the price crosses above the PMH (Premarket High) or the PDH (Previous Day High).
Short Entry (Sell): If the price crosses below the PML (Premarket Low) or the PDL (Previous Day Low).
Long Exit: If the price reaches the HOD (High of Day) during a long position.
Short Exit: If the price reaches the LOD (Low of Day) during a short position.
How the Script Works Step by Step:
Calculates Key Levels:
Uses the request.security function to fetch the HOD and LOD of the current day, as well as the highs and lows of the previous day (PDH and PDL).
Calculates the PMH and PML during the premarket session (before 9:30 AM).
Plots Levels on the Chart:
Uses the plot function to draw horizontal lines on the chart representing the key levels (HOD, LOD, PMH, PML, PDH, PDL).
Each level has a specific color for easy identification:
HOD: White.
LOD: Purple.
PDH: Orange.
PDL: Blue.
PMH: Green.
PML: Red.
Defines Trading Rules:
Uses conditions with ta.crossover and ta.crossunder to detect when the price crosses key levels.
Long Entry: If the price crosses above the PMH or PDH, a long position (buy) is opened.
Short Entry: If the price crosses below the PML or PDL, a short position (sell) is opened.
Long Exit: If the price reaches the HOD during a long position, the position is closed.
Short Exit: If the price reaches the LOD during a short position, the position is closed.
Executes Orders Automatically:
Uses the strategy.entry and strategy.close functions to open and close positions automatically based on the defined rules.
Advantages of This Strategy:
Based on Key Levels: Uses important price levels that often act as support and resistance.
Easy to Visualize: Horizontal lines on the chart make it easy to identify levels.
Automated: Entries and exits are executed automatically based on the defined rules.
Limitations of This Strategy:
Dependent on Volatility: Works best in markets with significant price movements.
False Crosses: There may be false crosses that generate incorrect signals.
No Advanced Risk Management: Does not include dynamic stop-loss or take-profit mechanisms.
How to Improve the Strategy:
Add Stop-Loss and Take-Profit: To limit losses and lock in profits.
Filter Signals with Indicators: Use RSI, MACD, or other indicators to confirm signals.
Optimize Levels: Adjust key levels based on the asset’s behavior.
In summary, this script is a trading strategy that operates based on key price levels, such as HOD, LOD, PMH, PML, PDH, and PDL. It is useful for traders who want to trade based on significant support and resistance levels.
Enigma Endgame with Dynamic Trend-Based FibonacciThe Enigma Endgame script combines dynamic trend-based Fibonacci levels with the core principles of the ENIGMA strategy. It provides traders with actionable signals by identifying key levels of fractal support and resistance and highlighting opportunities to trade with market momentum. This tool is designed for multi-timeframe analysis and is especially effective during high-volatility sessions like London and New York.
  
  
  
  
  
Purpose and Usefulness
This script was developed to simplify complex market dynamics by integrating Fibonacci principles with ENIGMA's logic of fractal support and resistance. Traders can use it to:  
- Identify key breakout and retracement levels dynamically.  
- Understand the shift between support and resistance as price action evolves.  
- Gain confidence in their entries with real-time signals derived from logical fractal behavior.  
By merging Fibonacci levels with fractal-based trading insights, this script offers a unique and comprehensive approach to analyzing market structure.
How It Works
The script uses a dual approach to provide insights:  
1. Dynamic Fibonacci Levels:  
   - Automatically plots Fibonacci retracement and extension levels based on recent high and low swings, adjusting dynamically to current market trends.  
   - Allows traders to visualize key levels where price might reverse or extend.
2. Fractal Support and Resistance Logic:
   - The script identifies fractal support and resistance by analyzing candle formations.  
   - When a candle body closes below the low of a previous candle, the previous low, which was fractal support, now becomes fractal resistance. The script generates a bearish signal, encouraging traders to look for sell opportunities at or above the previous low.  
   - Conversely, when a candle body closes above the high of a previous candle, the previous high, which was fractal resistance, becomes fractal support. The script generates a bullish signal, encouraging traders to look for buy opportunities at or below the previous high.  
Real-Time Signals
The script marks these transitions with arrows on the chart:  
- Bearish arrows indicate broken fractal support turning into resistance.  
- Bullish arrows** indicate broken fractal resistance turning into support.  
These signals help traders stay aligned with the trend and trade with market momentum.
Key Features 
1. Session-Based Analysis: Focuses on high-probability setups by allowing traders to customize session times, such as London or US sessions.  
2. Multi-Timeframe Support: Works seamlessly across multiple timeframes for both scalpers and swing traders.  
3. Real-Time Alerts: Sends customizable alerts when price interacts with critical Fibonacci levels or fractal support/resistance shifts.  
How to Use the Script  
1. Apply the script to a clean chart for clear visualization. Avoid combining it with other scripts unless necessary.  
2. Use the arrows to identify shifts in fractal support and resistance and validate opportunities for buy/sell trades.  
3. Monitor the dynamic Fibonacci levels to find confluence with key price areas.  
4. Customize session times to focus on high-probability trading hours.  
Key Notes for Traders
- This script provides insights based on logical market structure but should be used alongside proper risk management and trading plans.  
- The fractal-based approach works well in conjunction with dynamic Fibonacci levels, helping traders build confidence in their strategy.  
- Adapt the script settings to match your unique trading style and timeframe preferences.  
By offering a seamless integration of fractal logic and Fibonacci principles, Enigma Endgame empowers traders with actionable insights to navigate markets effectively.
1-3-1 Strat Combo with 50% Level (12h)Logic Explanation
1-3-1 Combo Detection:
The script detects the 1-3-1 pattern using the previous 3 candles:
Candle 4: Inside Bar (Type 1).
Candle 3: Outside Bar (Type 3).
Candle 2: Inside Bar (Type 1).
4th Candle Behavior:
If the 4th candle (current bar):
Stays an inside bar (Type 1) → isFourthInsideBar is true.
Becomes a directional bar (Type 2) → isFourthDirectional is true.
If either of these conditions is true, the script stops calculating and waits for the next valid 1-3-1 setup.
50% Level Calculation:
If the conditions are not met (e.g., the 4th candle doesn’t stop the pattern), the script:
Plots a dotted line at the 50% level of the 3rd candle.
Adds a label showing the 50% level.
Stop Calculations:
No line, box, or label is drawn if the 4th candle is a Type 1 (inside bar) or Type 2 (directional bar).
Visual Outputs:
Dotted Box: Marks the 1-3-1 combo setup.
50% Line: Drawn only if the 4th candle does not invalidate the pattern.
Label: Displays the 50% level of the 3rd candle.
How to Use:
Apply this script on the 12-hour chart.
The script will:
Detect valid 1-3-1 patterns.
Stop drawing any calculations if the 4th candle is an inside bar (1) or a directional bar (2).
Wait for the next valid 1-3-1 combo.






















