TradingLegend RangeLevels
Indicator Description:
I am incredibly proud and excited to share my first indicator with the TradingView community! This tool has been instrumental in helping me optimize my positioning and maximize my trades.
Tradinglegend RangeLevels— is a technical indicator that is used to determine the levels at which price may face support or resistance. This indicator consists number of levels which will show several support (S) and resistance (R) levels.
Calculation
Resistance and support values are calculated in different ways, depending on the type of the indicator, specified by the Type field in indicator inputs. To calculate TL range support/resistance levels, the values OPENcurr, OPENprev, HIGHprev, LOWprev, CLOSEprev of hour,day,weekly candles with avarage buying and selling volumes. which are the values of the current open and previous open, high, low and close, respectively, on the indicator resolution. The indicator resolution is set by the input of the different standard Timeframe.
users can change the cofficient of facor which calculated on basis of previous day high to low distance and number of 5min candles existing in a day,they can customisze it in setting for accurate results
for intraday resolutions up to and including 15 min, DAY (1D) is used
for intraday resolutions more than 15 min, WEEK (1W) is used
for daily resolutions MONTH is used (1M)
for weekly and monthly resolutions, 12-MONTH (12M) is used
Types
Leves are designed as pivot standard levels but calculation is different.When you will use it,definitely u gonna love it
Forecasting
Line Break Chart StrategyHello All!
We should not pass this year without a gift!
My last publication in 2024 is Complete Line Break Chart Strategy with many features!
What is Line Break Chart?
" Line Break is a Japanese chart style that disregards time intervals and only focuses on price movements, similar to the Kagi and Renko chart styles. Line Break charts form a series of up and down bars (referred to as lines). Up lines represent rising prices, and down lines represent falling prices. New confirmed lines only form on the chart when closing prices break the range covered by previous lines. Users can control the number of past lines used in the calculation via the "Number of Lines" input in the chart settings. The typical "Number of Lines" setting is 3, meaning the chart forms a new up line when the closing price is above the high prices of the last three lines, and it forms a new down line when the closing price is below the past three lines' low prices. If the current price is higher, it is an up line and if it is lower, it is a down line. If the current closing price is the same or the move in the opposite direction is not large enough to warrant a reversal, l then no new line is draw n" by Tradingview. You can find it here
Now let's start examining the features of the indicator:
By using Line break reversals it shows trend on the main chart. You can create alert .
Moreover, you can decide which trade should be taken by using Risk Management in the indicator. You can set the " Maximum Risk " and then if the risk is more than you set then the trade is not taken. When trend changed it checks the distance between reversal level and open price and compare it with the Maximum Risk
Breakout:
It can find breakouts and shows on the chart. You can create alert for breakouts
It can show breakouts on the main chart:
Flip-Flops:
Upon looking at set of price break charts, the trader will notice that there are instances when uptrend blocks is followed by one reversal block, and then by a reversal to a series of uptrend blocks. The opposite is also possible: a series of downtrend blocks is followed by one reversal box and then by an immediate reversal to downtrend. This price action is called a " Flip-Flop ". This structure usually produces trend continuation signal. when we see this then we better use Buy/Sell stop order. lets see this on the chart:
Temporal Sequence Table:
Sequence frequency shows the frequency distribution of the number of sequential highs and the number of sequential lows that have been generated. This is quite important to the trader who is seeking to join a trend or put on a trade when the price break reverses into a new trend direction. For example, if the pattern over the past year has been that there never were more than nine consecutive high closes, it would make sense not to enter a position late into the sequence of new high closes.
also you can see market structure. I have tried to formalize it and show it under the table. so you can understand if it's choppy market.
"Number of Lines" has very important role. While using low time frames such seconds/minutes time frame you may want to choose higher number of lines such 5,6. ( this may minimize the risk of a whipsaw )
Gaps feature:
You can set Gaps on/off. if Gaps on then you can see how long it takes for each box
Reversal and Continuation Probability:
The script calculated Reversal level and Continuation probability of the trend by using Sequence frequency.
It also shows unconfirmed box and current closing price level:
Last but not least it has Overlay option for all items, and can show all items in the main chart!
P.S. I added alerts :)
Wish you all a happy new year!
Enjoy!
IU 4 Bar UP StrategyIU 4 Bar UP Strategy
The IU 4 Bar UP Strategy is a trend-following strategy designed to identify and execute long trades during strong bullish momentum, combined with confirmation from the SuperTrend indicator. This strategy is suitable for traders aiming to capitalize on sustained upward market movements.
Features :
1. SuperTrend Confirmation: Incorporates the SuperTrend indicator as a dynamic support/resistance line to filter trades in the direction of the trend.
2. 4 Consecutive Bullish Bars: Detects a series of 4 bullish candles as a signal for strong upward momentum, ensuring robust trade setups.
3. Dynamic Alerts: Sends alerts for trade entries and exits to keep traders informed.
4. Visual Enhancements:
- Plots the SuperTrend indicator on the chart.
- Changes the background color while a trade is active for easy visualization.
Inputs :
- SuperTrend ATR Period: The period used to calculate the Average True Range (ATR) for the SuperTrend indicator.
- SuperTrend ATR Factor: The multiplier for the ATR in the SuperTrend calculation.
Entry Conditions :
A long entry is triggered when:
1. The last 4 consecutive candles are bullish (closing prices are higher than opening prices).
2. The current price is above the SuperTrend line.
3. The strategy is not already in a position.
4. The bar is confirmed (not a partially formed bar).
When all these conditions are met, the strategy enters a long position and provides an alert:
"Long Entry triggered"
Exit Conditions :
The strategy exits the long position when:
1. The closing price drops below the SuperTrend line.
2. An alert is generated: "Close the long Trade"
Visualization :
- The SuperTrend line is plotted, dynamically colored:
- Green when the trend is bullish.
- Red when the trend is bearish.
- The background color turns semi-transparent green while a trade is active, indicating a long position.
Do use proper risk management while using this strategy.
Custom Percent Pullback LevelThis script takes a stock's current day low and current day high and lets you set a custom pullback level that you can then set an alert for or use as an indicator if the stock is still bullish or bearish.
This can be useful for momentum runners as you may want to see only a set % (default is 50%) pullback in order to have a good chance for continuation. With the alert option you can set the percentage pullback you'd like to see in order to get eyes back on the stock
Global Liquidity Index with OffsetThe Global Liquidity Index by Ingeforberg, but with the option of offsetting the data by a variable number of weeks, as frequently shown by Global Macro Investor and Real Vision. Bitcoin and many other crypto assets frequently follow global liquidity, and by offsetting it, an investor "may" gain insight into future price movements. The number of weeks offset can be adjusted in the settings.
GBM with Volatility EstimationSSL Strategy Integration:
SSL High and SSL Low lines are calculated using ta.sma of the high and low prices.
Buy and sell signals are generated when the price crosses above the high line (buy) or below the low line (sell).
Dynamic Breakout Zones:
Horizontal lines for upper_bound and lower_bound adjust dynamically based on the GBM model.
Combined Signals:
Breakout signals: Triggered when the price moves above upper_bound or below lower_bound.
SSL signals: Triggered when the price crosses above the SSL High (buy) or below SSL Low (sell).
Trend Visualization:
The background color reflects the SSL trend:
Green: Bullish (price above SSL High).
Red: Bearish (price below SSL Low).
Day of the Week Indicator by rajk2186This scrip delineates each day with a fixed colour code and labels
PENGU - Viking Fun Predict The indicator predicts whether the price will rise or fall on the next candle
The indicator displays red or green circles above each of the candles
Green circle growth forecast
Red circle forecast of the fall
The indicator gives a forecast for the sixth candle based on five candles
The indicator takes the prices of the highs and lows of five candles and averages them, getting 5 values. Based on the obtained 5 values, a linear regression is constructed
If the linear regression line increases, the indicator predicts growth (green circle)
If the linear regression line increases, the indicator predicts a fall (red circle)
Longest Candles HighlighterDescription:
The Longest Candles Highlighter is a simple yet effective tool that identifies and highlights candles with significant price ranges. By visually marking candles that meet specific size criteria, this indicator helps traders quickly spot high-volatility moments or significant market moves on the chart.
Features:
1. Customizable Candle Range:
- Define the minimum and maximum candle size in pips using input fields.
- Tailor the indicator to highlight candles that are most relevant to your trading strategy.
2. Flexible for Different Markets:
- Automatically adjusts pip calculation based on the instrument type (Forex or non-Forex).
- Accounts for differences in pip values, such as the 0.01 pip for JPY pairs in Forex.
3. Visual Highlighting:
- Highlights qualifying candles with a customizable background color for easy identification.
- The default color is red, but you can choose any color to match your chart theme.
4. Precision and Efficiency:
- Quickly scans and identifies candles that meet your criteria, saving you time in analyzing charts.
- Works seamlessly across all timeframes and asset classes.
How It Works:
- The indicator calculates the range of each candle in pips by subtracting the low from the high and dividing by the appropriate pip value.
- It checks whether the candle's size falls within the user-defined minimum and maximum pip range.
- If the conditions are met, the background of the candle is highlighted with the specified color, drawing your attention to significant price movements.
Use Case:
- This indicator is ideal for identifying key market moments, such as breakouts, volatility spikes, or significant price movements.
- Traders can use it to quickly locate large candles on any chart, aiding in technical analysis and strategy development.
This tool simplifies the process of spotting important candles, empowering traders to make faster and more informed trading decisions.
Eroina Trend Reversal Indicator with ConfirmationsEroina Trend Reversal Indicator with Confirmations
Overview (English):
The Trend Reversal Indicator with Confirmations is designed to identify potential trend reversals by analyzing dynamic resistance and support levels. This script uses a robust confirmation system to reduce false signals, making it ideal for traders who seek disciplined, data-driven decisions.
Key Features:
• Dynamic Levels: Calculates resistance and support levels based on user-defined lengths.
• Breakout Confirmation: Confirms trend reversals by validating price action over a specified number of candles.
• Visual Cues: Displays “LONG” and “SHORT” signals directly on the chart, alongside resistance/support levels.
• Customizable Parameters: Adaptable to different timeframes and market conditions.
How It Works:
1. Resistance & Support Levels:
• Resistance: Calculated as the highest high over the last N bars.
• Support: Calculated as the lowest low over the last N bars.
2. Breakout Detection:
• A resistance breakout occurs when the price closes above the resistance level.
• A support breakout occurs when the price closes below the support level.
3. Confirmation Logic:
• Signals are validated only if the price remains above/below the levels for a user-defined number of candles.
4. Entry Signals:
• “LONG” signals indicate a confirmed breakout above resistance.
• “SHORT” signals indicate a confirmed breakdown below support.
Settings:
• Resistance Length: Defines the number of candles used to calculate resistance levels.
• Support Length: Defines the number of candles used to calculate support levels.
• Confirmation Candles: Specifies how many candles are required to confirm breakouts.
Usage:
This indicator is ideal for identifying trend reversals and optimizing entry points. Combine it with volume analysis or other technical indicators to enhance accuracy. For example:
• Use in conjunction with RSI to avoid overbought/oversold conditions.
• Combine with moving averages to confirm the trend direction.
Overview (Additional Language):
(Your additional language description can go here after English, e.g., Russian, Spanish, etc.)
JCM_MadridThis indicator provides dynamic bar coloring and buy/sell signals based on EMA relationships and price momentum. It allows traders to visually identify trend changes and potential trade opportunities directly on the chart.
Indicator Basics:
Name: The script is titled "JCM_Madrid".
Overlay: It overlays its calculations and outputs directly on the price chart.
User Inputs:
-Range: Defines the length of the EMA (Exponential Moving Average).
-Ref-1 and Ref-2: Set reference lengths for secondary EMAs used in the calculations.
-Source: The price data source for EMA calculations (e.g., close, open, high, low).
-Enable Buy/Sell: Boolean toggles to activate or deactivate buy and sell signals.
Calculations:
EMA Value: Computes the main EMA based on the source and Range.
CloseMA: The difference between the close price and the EMA.
SqzMA: The difference between a secondary EMA (Ref-1) and the main EMA.
RefMA: The difference between another secondary EMA (Ref-2) and the main EMA.
Bar Coloring:
Bars are colored based on the relationship between SqzMA and CloseMA:
Purple: When SqzMA > CloseMA.
Blue: When SqzMA < CloseMA.
Buy/Sell Signals:
A Buy Signal is generated when:
CloseMA crosses from below to above 0.
The close price is higher than the previous close.
Buy signals are enabled.
A Sell Signal is generated when:
CloseMA crosses from above to below 0.
The close price is lower than the previous close.
Sell signals are enabled.
Signals are displayed as labels on the chart:
"Buy": Green label below the candle.
"Sell": Yellow label below the candle
[Taj_treyder] signal buy-sell + ZigZagСалом ба хама Трейдерони Точик! Ман Абдулло Ахмадов хастам.
Ман ин индикатор-ро барои истифодабарии трейдер-хо ва тредуня-хои Точик сохтам,
Аз сабабе ки ин индикатор-ро ман аз 4- авторхои дигари Тредингвью гирифтам якчоя кардам онро дар руйи хати умуми монда наметонам. Шумо метавонед ин индикатор-ро озод дар графикхои худ истифода баред (Таймфрейми аз 45М, 1Н, 2Н, 4Н, то D1).
Хусусият-хои ин индикатор: Ердам кардан дар Торговляи шумо, Осон намудани Тичорати шумо дар бозорхои чахони!
1.- Муян намудани уровен-хои Сапративления ва Подержка,
2.- Муаян намудани Линия Тренда.
3.- Муаян намудани Восходящий ё Нисходящий Тренд (Рынок боло ё поён харакат дорад).
4.- Муаян намудани Точка входа-100% (чойи аники 100% Сделкаро кушодан).
5.- Мондани-100% Стоп-Лосс (чойи аники-100% мондани басс-зарар-дидан, - 2% аз Капитал).
6.- Мондани Тейк-профит (Чойи аники-100% баландтар-ини гирифтани фойда, 1/3, 1/5).
Ман ин индикаторро барои истифода барии Трейдер-хои тамоми Точикони руи замин сохтам! истифода-барии ин ройгон (бе пул, "без платно" мебошад).
Ин Индикатор кори шуморо-95% осон мекунад, Ердами аники хисоби математикии Уровинхо, Ердами аники математикии Линия-Тренда, Ердами-100% аники кушодани сделкахои Лонг ё Шорт (100%- сигналы Buy и Sell с помощью искусственного интеллекта).
Ердами фахмиши боло ё поён равии Рынокхо (100%- определения Восходящего и Нисходящего рынока).
AI Moving Average Crossover BotA bot that gives signals using MA(Moving average)
s a strategy rather than just an indicator. A strategy allows for backtesting and automating trades.
made with pinescript v6
Enhanced Zigzag & Pivot Levels### Description of the Script
This TradingView Pine Script combines **Zigzag Channels**, **Pivot Points**, **Missed Levels**, and a **Trend Filter** to provide a comprehensive market analysis tool. It is designed to help traders identify key market levels, trends, and potential reversals while maintaining clarity and simplicity.
### Components of the Script
1. **Zigzag Channels**:
- **Purpose**: Highlights significant price swings by connecting pivot highs and lows.
- **How It Works**:
- Uses a specified length (`zigzag_length`) to calculate significant highs and lows.
- Draws dynamic lines between consecutive highs and lows, helping visualize market structure and directional moves.
- **Visuals**: Zigzag lines in **orange** (or your chosen color).
2. **Pivot Points**:
- **Purpose**: Marks key turning points in the market (local highs and lows).
- **How It Works**:
- Identifies pivot highs and lows using `ta.pivothigh` and `ta.pivotlow` with the input `length`.
- Labels these points on the chart using upward (`▲`) or downward (`▼`) arrows.
- **Visuals**:
- Pivot highs are marked with **red labels**.
- Pivot lows are marked with **green labels**.
3. **Missed Levels**:
- **Purpose**: Highlights missed highs and lows that are lower than previous highs or higher than previous lows, which may signal missed opportunities or market inefficiencies.
- **How It Works**:
- Compares the current pivot point to the last zigzag extreme.
- If the current high is below the last high or the current low is above the last low, it labels the missed levels.
- **Visuals**: Missed levels are marked with **gray labels** labeled "Missed High" or "Missed Low."
4. **Trend Filter (SMA)**:
- **Purpose**: Provides a simple context for market direction based on a moving average.
- **How It Works**:
- Computes a Simple Moving Average (SMA) of the `close` price over a user-defined period (`sma_length`).
- Indicates an **uptrend** when the price is above the SMA and a **downtrend** when below.
- **Visuals**: SMA is plotted as a **blue line**.
### Inputs
- **Pivot Length** (`length`): Number of bars to the left and right used to identify pivot highs and lows.
- **Zigzag Length** (`zigzag_length`): Period for calculating zigzag channel points.
- **SMA Length** (`sma_length`): Period for the trend filter.
- Toggle options to show/hide:
- Pivot points
- Zigzag channels
- Missed levels
- Labels
- Customizable colors for:
- Pivot highs and lows
- Zigzag lines
- Missed levels
- Trend filter (SMA)
### How It Works
1. **Pivot Points Detection**:
- The script calculates pivot points using the specified `length`.
- If a new high or low is detected, it places a label at the bar corresponding to the pivot.
2. **Zigzag Line Plotting**:
- Lines are drawn dynamically to connect the most recent pivot points.
- These lines represent swings and give a clear view of market structure.
3. **Missed Levels Detection**:
- Compares each pivot high/low to the previous zigzag extreme.
- Labels missed levels with tooltips that show their exact values.
4. **Trend Confirmation**:
- Uses the SMA to provide context for the overall trend.
- Traders can use this to decide whether to prioritize long or short opportunities.
### Example Use Cases
1. **Trend Confirmation**:
- Use the SMA to identify the prevailing market trend.
- Trade in the direction of the trend (e.g., look for buying opportunities above the SMA).
2. **Swing Trading**:
- Use the zigzag lines to identify key swing points for entry or exit.
3. **Missed Opportunities**:
- Look for missed highs or lows to spot market inefficiencies or reversal zones.
4. **Support and Resistance**:
- Pivot points can act as potential support or resistance levels.
### Visual Example
- **Uptrend**:
- Price above the SMA (blue line).
- Zigzag lines showing higher highs and higher lows.
- Pivot highs and lows aligning with the trend.
- **Downtrend**:
- Price below the SMA.
- Zigzag lines showing lower highs and lower lows.
- Pivot points reinforcing the bearish structure.
Compare TOTAL, TOTAL2, TOTAL3, and OTHERSCompare TOTAL, TOTAL2, TOTAL3, and OTHERS
This indicator compares the performance of major cryptocurrency market cap indices: TOTAL, TOTAL2, TOTAL3, and OTHERS. It normalizes each index's performance relative to its starting value and visualizes their relative changes over time.
Features
- Normalized Performance: Tracks the percentage change of each index from its initial value.
- Customizable Timeframe: Allows users to select a base timeframe for the data (e.g., daily, weekly).
- Dynamic Labels: Displays the latest performance of each index as a label on the chart, aligned to the right of the corresponding line for easy comparison.
- Color-Coded Lines: Each index is assigned a distinct color for clear differentiation:
-- TOTAL (Blue): Represents the total cryptocurrency market cap.
-- TOTAL2 (Green): Excludes Bitcoin.
-- TOTAL3 (Orange): Excludes Bitcoin and Ethereum.
-- OTHERS (Red): Represents all cryptocurrencies excluding the top 10 by market cap.
- Baseline Reference: Includes a horizontal line at 0% for reference.
Use Cases:
- Market Trends: Identify which segments of the cryptocurrency market are outperforming or underperforming over time.
- Portfolio Insights: Assess the impact of Bitcoin and Ethereum dominance on the broader market.
- Market Analysis: Compare smaller-cap coins (OTHERS) with broader indices (TOTAL, TOTAL2, and TOTAL3).
This script is ideal for traders and analysts who want a quick, visual way to track how different segments of the cryptocurrency market perform relative to each other over time.
Note: The performance is normalized to highlight percentage changes, not absolute values.
The Final CountdownDescription:
The Final Countdown is a multi-timeframe candle countdown tool with the following features:
Dynamic Color-Coded Countdowns: Easily track candle closings with green, yellow, and red colors based on remaining time. Fully customizable thresholds.
Customizable Timeframes: Monitor up to 8 timeframes simultaneously, from 1-minute to weekly candles.
Alerts for Candle Closures: Get notified when a candle is about to close (red zone).
Flexible Display Options: Choose between vertical or horizontal layouts, adjust table size, and enable/disable individual timeframes.
Real-Time Updates: Seamlessly integrates with live charts to ensure accurate countdowns.
User-Friendly Settings: Modify colors, alert thresholds, and other parameters directly from the settings menu.
---------------------------------------------------------------
Dynamic Color-Coded Countdowns (In-Depth)
The countdown changes color based on how much time remains before a candle closes:
Green: Ample time remains.
Yellow: A warning that the candle is nearing its close.
Red: The candle is about to close imminently, requiring immediate attention.
Default Settings:
Green to Yellow: When 50% of the time has elapsed.
Yellow to Red: When only 10% of the time remains.
These percentages can be easily adjusted in the indicator settings to fit your trading needs. For example, you can set the transition to yellow at 70% elapsed time or adjust the red zone to begin with 5% time remaining for more urgency.
Stay prepared, stay informed, and never miss an important candle close with The Final Countdown!
Pi Cycle MACD Inverse OscillatorPi Cycle MACD Inverse Oscillator with Gradient and Days Since Last Top
This indicator is ideal for Bitcoin traders seeking a robust tool to visualize long-term and short-term trends with enhanced clarity and actionable insights.
This script combines the concept of the Pi Cycle indicator with a unique MACD-based inverse oscillator to analyze Bitcoin market trends. It introduces several features to help traders understand market conditions better:
Inverse Oscillator:
- Oscillator ranges between 1 and -1.
- A value of 1 indicates the two moving averages (350 MA and 111 MA) are equal.
- A value of -1 indicates the maximum observed distance between the moving averages during the selected lookback period.
- The oscillator dynamically adjusts to price changes using a configurable scaling factor.
Gradient Visualization:
The oscillator line transitions smoothly from green (closer to -1) to yellow (at 0) and red (closer to 1).
The color gradient provides a quick visual cue for market momentum.
Days Since Last Pi Cycle Top:
Calculates and displays the number of days since the last "Pi Cycle Top" (defined as a crossover between the two moving averages).
The label updates dynamically and appears only on the most recent bar.
Conditional Fill:
Highlights the area between 0 and 1 with a green gradient when the price is above the long moving average.
Enhances visual understanding of the oscillator's position relative to key thresholds.
Inputs:
- Long Moving Average (350 default): Determines the primary trend.
- Short Moving Average (111 default): Measures shorter-term momentum.
- Oscillator Lookback Period (100 default): Defines the range for normalizing the oscillator.
- Price Scaling Factor (0.01 default): Adjusts the normalization to account for large price fluctuations.
How to Use:
- Use the oscillator to identify potential reversal points and trend momentum.
- Look for transitions in the gradient color and the position relative to 0.
- Monitor the "Days Since Last Top" label for insights into the market's cycle timing.
- Utilize the conditional fill to quickly assess when the market is in a favorable position above the long moving average.
ForecastPro by BinhMyco1. Overview:
This Pine Script implements a custom forecasting tool on TradingView, labeled "BinhMyco." It provides a method to predict future price movements based on historical data and a comparison with similar historical patterns. The script supports two types of forecasts: **Prediction** and **Replication**, where the forecasted price can be either based on price peaks/troughs or an average direction. The script also calculates a confidence probability, showing how closely the forecasted data aligns with historical trends.
2. Inputs:
- Source (`src`): The input data source for forecasting, which defaults to `open`.
- Length (`len`): The length of the training data used for analysis (fixed at 200).
- Reference Length (`leng`): A fixed reference length for comparing similar historical patterns (set to 70).
- Forecast Length (`length`): The length of the forecast period (fixed at 60).
- Multiplier (`mult`): A constant multiplier for the forecast confidence cone (set to 4.0).
- Forecast Type (`typ`): Type of forecast, either **Prediction** or **Replication**.
- Direction Type (`dirtyp`): Defines how the forecast is calculated — either based on price **peaks/troughs** or an **average direction**.
- Forecast Divergence Cone (`divcone`): A boolean option to enable the display of a confidence cone around the forecast.
3. Color Constants:
- Green (`#00ffbb`): Color used for upward price movements.
- Red (`#ff0000`): Color used for downward price movements.
- Reference Data Color (`refcol`): Blue color for the reference data.
- Similar Data Color (`simcol`): Orange color for the most similar data.
- Forecast Data Color (`forcol`): Yellow color for forecasted data.
4. Error Checking:
- The script checks if the reference length is greater than half the training data length, and if the forecast length exceeds the reference length, raising errors if either condition is true.
5. Arrays for Calculation:
- Correlation Array (`c`): Holds the correlation values between the data source (`src`) and historical data points.
- Index Array (`index`): Stores the indices of the historical data for comparison.
6. Forecasting Logic:
- Correlation Calculation: The script calculates the correlation between the historical data (`src`) and the reference data over the given reference length. It then identifies the point in history most similar to the current data.
- Forecast Price Calculation: Based on the type of forecast (Prediction or Replication), the script calculates future prices either by predicting based on similar bars or by replicating past data. The forecasted prices are stored in the `forecastPrices` array.
- Forecast Line Drawing: The script draws lines to represent the forecasted price movements. These lines are color-coded based on whether the forecasted price is higher or lower than the current price.
7. Divergence Cone (Optional):
- If the **divcone** option is enabled, the script calculates and draws a confidence cone around the forecasted prices. The upper and lower bounds of the cone are calculated using a standard deviation factor, providing a visual representation of forecast uncertainty.
8. Probability Table:
- A table is displayed on the chart, showing the probability of the forecast being accurate. This probability is calculated using the correlation between the current data and the most similar historical pattern. If the probability is positive, the table background turns green; if negative, it turns red. The probability is presented as a percentage.
9. Key Functions:
- `highest_range` and `lowest_range`: Functions to find the highest and lowest price within a range of bars.
- `ftype`: Determines the forecast type (Prediction or Replication) and adjusts the forecasting logic accordingly.
- `ftypediff`: Computes the difference between the forecasted and actual prices based on the selected forecast type.
- `ftypelim`, `ftypeleft`, `ftyperight`: Additional functions to adjust the calculation of the forecast based on the forecast type.
10. Conclusion:
The "ForecastPro" script is a unique tool for forecasting future price movements on TradingView. It compares historical price data with similar historical trends to generate predictions. The script also offers a customizable confidence cone and displays the probability of the forecast's accuracy. This tool provides traders with valuable insights into future price action, potentially enhancing decision-making in trading strategies.
---
This script provides advanced functionality for traders who wish to explore price forecasting, and can be customized to fit various trading styles.
Market Movement After OpenDescription:
This script provides a detailed visualization of market movements during key trading hours: the German market opening (08:00–09:00 UTC+1) and the US market opening (15:30–16:30 UTC+1). It is designed to help traders analyze price behavior in these critical trading periods by capturing and presenting movement patterns and trends directly on the chart and in an interactive table.
Key Features:
Market Movement Analysis:
Tracks the price movement during the German market's first hour (08:00–09:00 UTC+1) and the US market's opening session (15:30–16:30 UTC+1).
Analyzes whether the price moved up or down during these intervals.
Visual Representation:
Dynamically colored price lines indicate upward (green) or downward (red) movement during the respective periods.
Labels ("DE" for Germany and "US" for the United States) mark key moments in the chart.
Historical Data Table:
Displays the past 10 trading days' movement trends in an interactive table, including:
Date: Trading date.
German Market Movement: Up (▲), Down (▼), or Neutral (-) for 08:00–09:00 UTC+1.
US Market Movement: Up (▲), Down (▼), or Neutral (-) for 15:30–16:30 UTC+1.
The table uses color coding for easy interpretation: green for upward movements, red for downward, and gray for neutral.
Real-Time Updates:
Automatically updates during live trading sessions to reflect the most recent movements.
Highlights incomplete periods (e.g., ongoing sessions) to indicate their status.
Customizable:
Suitable for intraday analysis or broader studies of market trends.
Designed to overlay directly on any price chart.
Use Case:
This script is particularly useful for traders who focus on market openings, which are often characterized by high volatility and significant price movements. By providing a clear visual representation of historical and live data, it aids in understanding and capitalizing on market trends during these critical periods.
Notes:
The script works best when the chart is set to the appropriate timezone (UTC+1 for the German market or your local equivalent).
For precise trading decisions, consider combining this script with other technical indicators or trading strategies.
Feel free to share feedback or suggest additional features to enhance the script!
IU open equal to high/low strategyIU open equal to high/low strategy:
The "IU Open Equal to High/Low Strategy" is designed to identify and trade specific market conditions where the day's first price action shows a strong directional bias. This strategy automatically enters trades based on the relationship between the market's open price and its first high or low of the day.
Entry Conditions:
1. Long Entry: A long position is initiated when the first open price of the session equals the day's first low. This signals a potential upward move.
2. Short Entry: A short position is initiated when the first open price of the session equals the day's first high. This signals a potential downward move.
Exit Conditions:
1. Stop Loss (SL): For both long and short trades, the stop loss is calculated based on the low or high of the candle where the position was entered.
2. Take Profit (TP): The take profit is set using a Risk-to-Reward (RTR) ratio, which is customizable by the user. The TP is calculated relative to the entry price and the distance between the entry and the stop loss.
Additional Features:
- Plots are used to visualize the entry price, stop loss, and take profit levels directly on the chart, providing clear and actionable insights.
- Labels are displayed to indicate the occurrence of the "Open == Low" or "Open == High" conditions for easier identification of potential trade setups.
- A dynamic fill highlights the areas between the entry price and the stop loss or take profit, offering a clear visual representation of the trade's risk and reward zones.
This strategy is designed for traders looking to capitalize on directional momentum at the start of the trading session. It is customizable, allowing users to set their desired Risk-to-Reward ratio and tailor the strategy to fit their trading style.
M2 Global Liquidity Index - Time-Shift - KHM2 Global Liquidity Index - Enhanced Time-Shift Indicator
Based on original work by @Mik3Christ3ns3n
Enhanced with advanced time-shift functionality and overlay capabilities.
Description:
This indicator tracks and visualizes the global M2 money supply from five major economies, allowing precise time-shift analysis for correlation studies. All values are converted to USD in real-time and aggregated to provide a comprehensive view of global liquidity conditions.
Key Features:
- Advanced time-shift capability (-1000 to +1000 days) with shape preservation
- Real-time currency conversion to USD
- Overlay functionality with main chart
- Right-scale display for better comparison
- Full historical data preservation during time shifts
Components Tracked:
- US M2 Money Supply (USM2)
- China M2 Money Supply (CNM2)
- Eurozone M2 Money Supply (EUM2)
- Japan M2 Money Supply (JPM2)
- UK M2 Money Supply (GBM2)
Primary Use Cases:
1. Correlation Analysis:
- Compare global liquidity trends with asset prices
- Identify leading/lagging relationships through time-shift
- Study monetary policy impacts across different time periods
2. Market Analysis:
- Track global liquidity conditions
- Monitor central bank policy effects
- Identify potential macro trend changes
Settings:
- Time Offset: Shift the M2 data backwards or forwards (-1000 to +1000 days)
- Positive values: Move M2 data into the future
- Negative values: Move M2 data into the past
- Zero: Current alignment
Technical Notes:
- Data updates follow central banks' M2 publication schedules
- All currency conversions performed in real-time
- Historical shape preservation during time-shifts
- Enhanced data consistency through lookahead mechanism
Credits:
Original concept and base code by @Mik3Christ3ns3n
Enhanced version includes advanced time-shift capabilities and shape preservation
License:
Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
#M2 #GlobalLiquidity #MoneySupply #Macro #CentralBanks #MonetaryPolicy #TimeShift #Correlation #TradingIndicator #MacroAnalysis #LiquidityAnalysis #MarketIndicator
Pivot Highs/Lows with Bar CountsWhat does the indicator do?
This indicator adds labels to a chart at swing (a.k.a., "pivot") highs and lows. Each label may contain a date, the closing price at the swing, the number of bars since the last swing in the same direction, and the number of bars from the last swing in the opposite direction. A table is also added to the chart that shows the average, min, and max number of bars between swings.
OK, but how do I use it?
Many markets -- especially sideways-moving ones -- commonly cycle between swing highs and lows at regular time intervals. By measuring the number of bars between highs and lows -- both same-sided swings (i.e., H-H and L-L) and opposite-sided swings (i.e., H-L and L-H) -- you can then project the averages of those bar counts from the last high or low swing to make predictions about where the next swing high or low should occur. Note that this indicator does not make the projection for you. You have to determine which swing you want to project from and then use the bar counts from the indicator to draw a line, place a label, etc.
Example: Chart of BTC/USD
The indicator shows pivot highs and lows with bar counts, and it displays a table of stats on those pivots.
If you focus on the center section of the chart, you can see that prices were moving in a sideways channel with very regular highs and lows. This indicator counts the bars between these pivots, and you could have used those counts to predict when the next high or low may have occurred.
The bar counts do not work as well on the more recent section of the chart because there are no regularly time swings.