Market Stats Panel [Daveatt]█ Introduction
I've created a script that brings TradingView's watchlist stats panel functionality directly to your charts. This isn't just another performance indicator - it's a pixel-perfect (kidding) recreation of TradingView's native stats panel.
Important Notes
You might need to adjust manually the scaling the firs time you're using this script to display nicely all the elements.
█ Core Features
Performance Metrics
The panel displays key performance metrics (1W, 1M, 3M, 6M, YTD, 1Y) in real-time, with color-coded boxes (green for positive, red for negative) for instant performance assessment.
Display Modes
Switch seamlessly between absolute prices and percentage returns, making it easy to compare assets across different price scales.
Absolute mode
Percent mode
Historical Comparison
View year-over-year performance with color-coded lines, allowing for quick historical pattern recognition and analysis.
Data Structure Innovation
Let's talk about one of the most interesting challenges I faced. PineScript has this quirky limitation where request.security() can only return 127 tuples at most. £To work around this, I implemented a dual-request system. The first request handles indices 0-63, while the second one takes care of indices 64-127.
This approach lets us maintain extensive historical data without compromising script stability.
And here's the cool part: if you need to handle even more years of historical data, you can simply extend this pattern by adding more request.security() calls.
Each additional call can fetch another batch of monthly open prices and timestamps, following the same structure I've used.
Think of it as building with LEGO blocks - you can keep adding more pieces to extend your historical reach.
Flexible Date Range
Unlike many scripts that box you into specific timeframes, I've designed this one to be completely flexible with your date selection. You can set any start year, any end year, and the script will dynamically scale everything to match. The visual presentation automatically adjusts to whatever range you choose, ensuring your data is always displayed optimally.
█ Customization Options
Visual Settings
The panel's visual elements are highly customizable. You can adjust the panel width to perfectly fit your workspace, fine-tune the line thickness to match your preferences, and enjoy the pre-defined year color scheme that makes tracking historical performance intuitive and visually appealing.
Box Dimensions
Every aspect of the performance boxes can be tailored to your needs. Adjust their height and width, fine-tune the spacing between them, and position the entire panel exactly where you want it on your chart. The goal is to make this tool feel like it's truly yours.
█ Technical Challenges Solved
Polyline Precision
Creating precise polylines was perhaps the most demanding aspect of this project.
The challenge was ensuring accurate positioning across both time and price axes, while handling percentage mode scaling with precision.
The script constantly updates the current year's data in real-time, seamlessly integrating new information as it comes in.
Axis Management
Getting the axes right was like solving a complex puzzle. The Y-axis needed to scale dynamically whether you're viewing absolute prices or percentages.
The X-axis required careful month labeling that stays clean and readable regardless of your selected timeframe.
Everything needed to align perfectly while maintaining proper spacing in all conditions.
█ Final Notes
This tool transforms complex market data into clear, actionable insights. Whether you're day trading or analyzing long-term trends, it provides the information you need to make informed decisions. And remember, while we can't predict the future, we can certainly be better prepared for it with the right tools at hand.
A word of warning though - seeing those red numbers in a beautifully formatted panel doesn't make them any less painful! 😉
---
Happy Trading! May your charts be green and your stops be far away!
Daveatt
Pine utilities
Breakout MasterA range breakout occurs when the price moves outside a defined range or consolidation zone, either above resistance or below support. This breakout often signals a potential new trend direction, as it indicates increased momentum and interest in the asset beyond the previous range boundaries. Traders may use range breakouts as entry signals for trending moves.
Historical EventsThis TradingView script, "Historical Events" provides users with a visual timeline of significant global events that may have impacted markets and world history. Events include major wars, economic crises, pandemics, cyber-attacks, natural disasters, and more. Each event is displayed directly on the chart with a customizable icon, label, and color-coded line for easy identification. Users can filter events by category, select the importance level (1 for major events and 2 for less significant ones), and choose between different display formats (text only, icon only, or both). This tool aims to help traders, analysts, and historians quickly correlate major events with market data over time.
User Controls:
Category Filters: Toggle display for wars, economic events, pandemics, and other specific event types.
Importance Filter: Choose to show only major events or include all listed events.
Display Option: Adjust the view to display only icons, only text, or both.
This script can be a powerful addition to your trading toolkit, offering historical context directly on price charts.
Disclaimer:
The information provided by this script is for educational and informational purposes only. While the included data highlights several notable global events, it is not exhaustive and may omit significant occurrences. Users should not rely solely on this tool for making trading or investment decisions. The events are categorized based on subjective importance levels, which may differ from individual perspectives. Data may be updated periodically, and users are encouraged to verify any historical event before drawing conclusions. The author does not assume responsibility for any inaccuracies or omissions in the data or any decisions made based on the script.
For those who find this tool useful, contributions or feedback are welcome. Enjoy exploring market history and the impact of world events!
if you want to offer me a beer or a coffee :)
bitcoin:1Mxih4LRAAdR2Bi4s8MWgUuHM7wjgRv8Sg
ATH with Percentage DifferenceSimple ATH with difference percentage from the actual price to hit the all time high price again
ATH with Percentage DifferenceThis TradingView script is designed to help traders monitor the all-time high (ATH) of a selected asset and visualize the price distance between the current price and the ATH. The script automatically calculates the ATH for the asset on the chart, marks it with a horizontal line, and displays a dotted line between the current price and the ATH. In the center of this line, a label shows the percentage increase required for the current price to reach the ATH, providing traders with valuable insights into the asset's potential recovery percentage.
The script is suitable for use on various timeframes and asset classes, giving a consistent reference for the ATH level, which can assist in decision-making related to trend analysis, resistance levels, and long-term price targets.
Disclaimer
This script is provided for informational and educational purposes only. It is intended to support traders by providing additional insights into price movements relative to the all-time high but should not be solely relied upon for trading decisions. The accuracy of the data (such as price and ATH levels) depends on TradingView's data feed, which may vary between sources and asset classes.
While we strive to ensure the script functions as intended, we cannot guarantee that it will be free from errors or discrepancies due to technical factors, charting platform updates, or external data irregularities. Users are encouraged to verify information independently before making any trading decisions. Trading involves risks, and users should consult with financial professionals if they are unsure about any trading or investment choices.
By using this script, you acknowledge that you understand and accept these limitations and that any trading decisions are at your own risk.
For those who find this tool useful, contributions or feedback are welcome. Enjoy ! and if you want to offer me a beer or a coffee :)
bitcoin:1Mxih4LRAAdR2Bi4s8MWgUuHM7wjgRv8Sg
Thanks =)
Trend Bend"Trend Bend" Indicator - Recognizing a Change in Trend
"Trend Bend" is an indicator created for easy visualization of trends and their change through the crossover of two moving averages (Moving Averages - MAs). This indicator helps traders determine market direction and possible trend reversals using a simple yet effective method.
Basic Script Functions and Logic
Pair Moving Averages:
Fast MA with a default length of 10 and Slow MA with a length of 30.
The fast moving average follows the current price more closely, while the slow moving average smooths out the trend. Crossing between the two indicates a change in trend direction.
Lengths can be changed according to the user's preferences and trading style.
Trend Reversal Signals:
When the fast moving average crosses the slow moving average from the bottom up, an "UP" signal is displayed - indicating a possible uptrend.
When the fast moving average crosses the slow moving average from top to bottom, a "DOWN" signal is displayed - indicating a potential downtrend.
M2 Money Supply vs SPY SpreadSpread between M2 Money Supply and SPY, with Bollinger bands to see when it has become overextended in either direction.
Pine Execution MapPine Script Execution Map
Overview:
This is an educational script for Pine Script developers. The script includes data structure, functions/methods, and process to capture and print Pine Script execution map of functions called while pine script execution.
Map of execution is produced for last/latest candle execution.
The script also has example code to call execution map methods and generate Pine Execution map.
Use cases:
Pine script developers can get view of how the functions are called
This can also be used while debugging the code and know which functions are called vs what developer expect code to do
One can use this while using any of the open source published script and understand how public script is organized and how functions of the script are called.
Code components:
User defined type
type EMAP
string group
string sub_group
int level
array emap = array.new()
method called internally by other methods to generate level of function being executed
method id(string tag) =>
if(str.startswith(tag, "MAIN"))
exe_level.set(0, 0)
else if(str.startswith(tag, "END"))
exe_level.set(0, exe_level.get(0) - 1)
else
exe_level.set(0, exe_level.get(0) + 1)
exe_level.get(0)
Method called from main/global scope to record execution of main scope code. There should be only one call to this method at the start of global scope.
method main(string tag) =>
this = EMAP.new()
this.group := "MAIN"
this.sub_group := tag
this.level := "MAIN".id()
emap.push(this)
Method called from main/global scope to record end of execution of main scope code. There should be only one call to this method at the end of global scope.
method end_main(string tag) =>
this = EMAP.new()
this.group := "END_MAIN"
this.sub_group := tag
this.level := 0
emap.push(this)
Method called from start of each function to record execution of function code
method call(string tag) =>
this = EMAP.new()
this.group := "SUB"
this.sub_group := tag
this.level := "SUB".id()
emap.push(this)
Method called from end of each function to record end of execution of function code
method end_call(string tag) =>
this = EMAP.new()
this.group := "END_SUB"
this.sub_group := tag
this.level := "END_SUB".id()
emap.push(this)
Pine code which generates execution map and show it as a label tooltip.
if(barstate.islast)
for rec in emap
if(not str.startswith(rec.group, "END"))
lvl_tab = str.repeat("", rec.level+1, "\t")
txt = str.format("=> {0} {1}> {2}", lvl_tab, rec.level, rec.sub_group)
debug.log(txt)
debug.lastr()
Snapshot 1:
This is the output of the script and can be viewed by hovering mouse pointer over the blue color diamond shaped label
Snapshot 2:
How to read the Pine execution map
Hinton Map█ HINTON MAP
This script displays a Hinton Map visualization of market data for user-defined tickers and timeframes. It uses color gradients to represent the magnitude and direction of price change, RSI, and a combination of both.
This is one example. You can modify and try other values as you wish, but do keep the incoming values between -1 and 1.
In the Example Usage:
Users can input up to 5 symbols and 5 timeframes. For each ticker/timeframe combination:
The box size represents the relative magnitude of the 2-bar percentage change.
The box fill color represents the direction and magnitude of the 2-bar percentage change.
The box border color and thickness represent the RSI deviation from 50.
The inner box color represents a combination of price change magnitude and RSI deviation from 50.
Hovering over each box displays a tooltip with the ticker, timeframe, percentage change, and RSI.
Inputs:
• Unit Size (bars):
The size of each Hinton unit in bars.
Type: int
Default Value: 10
• Border Width:
The base width of the inner box border.
Type: int
Default Value: 3
• Negative Hue (0-360):
The hue value for negative price changes (0-360).
Type: float
Default Value: 100
• Positive Hue (0-360):
The hue value for positive price changes (0-360).
Type: float
Default Value: 180
• Ticker 1-5:
The tickers to display on the Hinton map.
Type: string
Default Value: AAPL
• Timeframes (comma separated):
The timeframes to display on the Hinton map (comma-separated).
Type: string
Default Value: 1, 5, 60, 1D, 1W
(Fun Note: My Home town is named `Hinton`)
DYNAMIC USD MOMENTUM INDICATOR
Hello traders,
Welcome to my script, an indicator helping you to quickly see the performance of USD in constant daily comparison to other currencies.
This script requests price data from other charts but displays overbought and oversold labels on any selected chart currency pair.
See attached images to spot high probability reversal days when USD is in extremes against multiple other currencies. The output labels represent the currency traded against USD and reaching overbought and oversold zoned on a dynamic RSI scale.
Suggested pairs with higher co relation to stronger or weaker dollar:
AUD/USD, CAD/USD, EUR/USD, GBP/USD, NZD/USD
CHF/USD and JPY/USD require more in depth analysis of individual performance of JPY AND CHF
Mars Signals - SSL Trend AnalyzerIntroduction
The "Mars Signals - Precision Trend Analyzer with SSL Baseline & Price Action Zones" is a comprehensive technical analysis tool designed for traders seeking to enhance their market analysis and trading strategies. This indicator integrates multiple advanced trading concepts, including dynamic moving averages, trend detection algorithms, momentum indicators, volume analysis, higher timeframe confirmation, candlestick pattern recognition, and precise price action zones. By combining these elements, the indicator aims to provide clear and actionable buy and sell signals, helping traders to make informed decisions in various market conditions.
Core Components and Functionality
1.Dynamic Baseline Calculation
Moving Average Types: The indicator allows users to select from a variety of moving average types for the baseline calculation, including Simple Moving Average (SMA), Exponential Moving Average (EMA), Hull Moving Average (HMA), Weighted Moving Average (WMA), Double EMA (DEMA), Triple EMA (TEMA), Least Squares Moving Average (LSMA), Triangular Moving Average (TMA), Kijun (from Ichimoku Kinko Hyo), and McGinley's Dynamic.
Baseline Length: Users can customize the length of the moving average, providing flexibility to adjust the sensitivity of the baseline to market movements.
Signal Line Generation: The indicator computes a dynamic signal line based on the relationship between the close price and the moving averages of the high and low prices. This signal line adapts to market volatility and trend changes.
2.SSL Baseline Integration
SSL Baseline: In addition to the primary baseline, the indicator incorporates an SSL (Semaphore Signal Level) Baseline, which further refines trend detection by considering the highs and lows over a specified period.
Dual Confirmation: The combination of the primary baseline and the SSL baseline enhances the reliability of the trend signals by requiring agreement between both baselines before generating a signal.
3.Momentum and Trend Filters
Relative Strength Index (RSI): The indicator uses the RSI to assess the momentum of price movements, filtering out signals that occur during overbought or oversold conditions.
Moving Average Convergence Divergence (MACD): The MACD is employed to identify the direction and strength of the trend, adding another layer of confirmation to the signals.
Average Directional Index (ADX): The ADX measures the strength of the trend, ensuring that signals are generated only when the market shows significant directional movement.
4.Volume Analysis
Volume Filter: An optional volume filter compares the current volume to its moving average, allowing traders to focus on signals that occur during periods of higher market activity.
5.Higher Timeframe Confirmation
Multi-Timeframe Analysis: The indicator can incorporate data from a higher timeframe, comparing the current price to the higher timeframe's baseline and signal line. This feature helps traders align their trades with the broader market trend.
6.Candlestick Pattern Recognition
Bullish Patterns: The indicator detects bullish patterns such as Bullish Engulfing, Piercing Line, Hammer, and Doji.
Bearish Patterns: It also identifies bearish patterns like Bearish Engulfing, Dark Cloud Cover, Shooting Star, and Doji.
Pattern Prioritization: The patterns are prioritized to highlight the most significant formations, which can serve as additional confirmation for trade entries and exits.
7.Price Action Zones
Support and Resistance Levels: The indicator automatically identifies pivot highs and lows to establish dynamic support and resistance levels.
Zone Visualization: It draws shaded rectangles on the chart to represent these zones, providing a clear visual aid for potential reversal or breakout areas.
ATR-Based Zone Width: The zones' thickness is dynamically calculated using the Average True Range (ATR), adjusting to the current market volatility.
Background Coloring: The chart background changes color when the price is above the maximum resistance or below the minimum support, alerting traders to significant price movements.
Interpreting the Signals
1.Buy Signals
Conditions:
Price crosses above the signal line.
RSI is below 70 (not overbought).
MACD line is above the signal line (indicating bullish momentum).
ADX is above the user-defined threshold (default is 20), confirming a strong trend.
(Optional) Volume is above its moving average if the volume filter is enabled.
(Optional) Price is above the higher timeframe baseline and signal line if the higher timeframe filter is enabled.
(Optional) A bullish candlestick pattern is detected if the candlestick pattern filter is enabled.
Visual Indicators:
An upward-pointing label with the text "BUY" appears below the price bar.
The baseline and SSL baseline lines turn to colors indicating bullish conditions.
2.Sell Signals
Conditions:
Price crosses below the signal line.
RSI is above 30 (not oversold).
MACD line is below the signal line (indicating bearish momentum).
ADX is above the user-defined threshold, confirming a strong trend.
(Optional) Volume is above its moving average if the volume filter is enabled.
(Optional) Price is below the higher timeframe baseline and signal line if the higher timeframe filter is enabled.
(Optional) A bearish candlestick pattern is detected if the candlestick pattern filter is enabled.
Visual Indicators:
A downward-pointing label with the text "SELL" appears above the price bar.
The baseline and SSL baseline lines turn to colors indicating bearish conditions.
3.Support and Resistance Zones
Interpretation:
Resistance Zones: Represent areas where the price may face selling pressure. A break above these zones can signal a strong bullish move.
Support Zones: Represent areas where the price may find buying interest. A break below these zones can signal a strong bearish move.
Background Color:
The background turns red when the price is above the maximum resistance, indicating potential overextension.
The background turns green when the price is below the minimum support, indicating potential undervaluation.
Effective Usage Strategies
1.Customization
Adjusting Baseline and SSL Settings: Traders should experiment with different moving average types and lengths to match their trading style and the specific characteristics of the asset being analyzed.
Filtering Parameters: Modify RSI, MACD, and ADX settings to fine-tune the sensitivity of the signals.
Volume and Higher Timeframe Filters: Enable these filters to add robustness to the signals, especially in volatile markets or when trading higher timeframes.
2.Combining with Other Analysis
Fundamental Analysis: Use the indicator in conjunction with fundamental insights to validate technical signals.
Risk Management: Always apply proper risk management techniques, such as setting stop-loss and take-profit levels based on the support and resistance zones provided by the indicator.
3.Backtesting
Historical Analysis: Utilize the indicator's settings to backtest trading strategies on historical data, helping to identify the most effective configurations before applying them in live trading.
4.Monitoring Market Conditions
Volatility Awareness: Pay attention to the ATR and ADX readings to understand market volatility and trend strength, adjusting strategies accordingly.
Event Considerations: Be cautious around major economic announcements or events that may impact market behavior beyond technical indications.
Indicator Inputs and Customization Options
Baseline Type and Length: Select from multiple moving average types and specify the period length.
ADX Settings: Adjust the length, smoothing, and threshold for trend strength confirmation.
Volume Filter: Enable or disable the volume confirmation filter.
Higher Timeframe Filter: Choose to incorporate higher timeframe analysis and specify the desired timeframe.
Candlestick Patterns: Enable or disable the detection of candlestick patterns for additional signal confirmation.
SSL Baseline Type and Length: Customize the SSL baseline settings separately from the primary baseline.
Price Action Zones Settings:
Zone Thickness: Adjust the visual thickness of the support and resistance zones.
Lookback Period: Define how far back the indicator looks for pivot points.
ATR Multiplier for Zone Width: Set the multiplier for ATR to determine the dynamic width of the zones.
Maximum Number of Zones: Limit the number of support and resistance zones displayed.
Pivot Bars: Customize the number of bars to the left and right used for identifying pivot highs and lows.
Conclusion
The "Mars Signals - Precision Trend Analyzer with SSL Baseline & Price Action Zones" is a versatile and powerful tool that amalgamates essential technical analysis techniques into a single, user-friendly indicator. By providing clear visual signals and incorporating multiple layers of confirmation, it assists traders in identifying high-probability trading opportunities. Whether you are a day trader, swing trader, or long-term investor, this indicator can be tailored to suit your trading style and enhance your decision-making process.
To maximize the benefits of this indicator:
Understand Each Component: Familiarize yourself with how each part of the indicator contributes to the overall signal generation.
Customize Thoughtfully: Adjust the settings based on the asset class, market conditions, and your risk tolerance.
Practice Diligently: Use demo accounts or paper trading to practice and refine your strategy before deploying it in live markets.
Stay Informed: Continuously educate yourself on technical analysis and market dynamics to make the most informed decisions.
Disclaimer
Trading financial markets involves risk, and past performance is not indicative of future results. This indicator is a tool to aid in analysis and should not be the sole basis for any trading decision. Always conduct your own research and consider consulting with a licensed financial advisor.
Vektorkerzen HighlightThe indicator highlights candles when:
The volume is at least twice the 20-period moving average.
The range (difference between high and low prices) is at least twice the 20-period average range.
[MAD MBS] L3 Float Operations & ML-NormalizersFirst of all:
This indicator is not a standalone tool ; it relies on other script series for its inputs.
This script is an indicator designed for multi-path float operations with integrated machine learning normalizers.
It supports up to four distinct paths, each customizable with multiple sources, factors, and operations.
Users can perform various mathematical operations on price data, including addition, subtraction, multiplication, division, and percentage changes, as well as more advanced tasks like double and triple moving averages or power operations.
The script also integrates several normalization methods (e.g., Min-Max, Z-Score, Robust) to standardize data—an important step for machine learning models.
Each path supports multiple smoothing techniques (e.g., EMA, SMA, and specialized Ehlers smoothers) to further refine the output.
Designed to handle multiple data inputs simultaneously, this tool is especially useful for traders looking to analyze and normalize data from different price sources.
The combination of advanced mathematical operations, normalization techniques, and smoothing enhances data management, aiding in more effective trading decisions.
Here you can see a single path, out of the four possible:
Details to the screenshot:
First Series
Second Series
Option to override the second series with a custom constant (or when normalizing, use the length instead)
The first selection box sets the mathematical operation or activates the normalizer.
The second selection box sets the normalization method.
The third selection box sets the final smoothing technique, followed by parameters for smoothing length.
These settings are repeated identically for Paths 2–4.
At the bottom of the setup, there's a general offset option (add the 'close' price for overlay purposes).
Additionally, there's an option to display a line at zero for centered results.
Point and Figure Displacement IndicatorThe PnF Displacement indicator is my custom script for TradingView, designed to analyze Point and Figure (PnF) charts with displacement features.
Key components of the script include:
User Inputs:
Require FVG: A boolean input to determine if a Fair Value Gap (FVG) is required for displacement calculations.
Displacement Type: Allows users to choose between "Open to Close" and "High to Low" for column range calculations.
Displacement Length: Defines how far back to look for calculating the standard deviation of the column range.
Displacement Strength: Multiplier for the standard deviation to adjust sensitivity.
Box Size: Sets the size of each box in the PnF chart.
Number of Boxes for Minimum Displacement: Specifies how many boxes to consider for calculating the minimum displacement.
Displacement Logic:
The script calculates the column range based on the selected displacement type.
It computes a standard deviation of the candle range and determines a minimum displacement based on user-defined box size and count.
The displacement condition combines the FVG check and the column range against the calculated minimum.
Visual Representation:
The bars are colored based on displacement conditions, enhancing visual analysis on the chart.
This indicator aids traders in identifying significant price movements in PnF charts while incorporating user customization options for better analysis.
PnF Fibonacci Levels with AlertsMy Pine Script indicator, "PnF Fibonacci Levels with Alerts," overlays on a trading chart to generate alerts based on Fibonacci levels in Point and Figure (PnF) charts.
Key Features:
Inputs and Initialization:
It uses a customizable Fibonacci level (set at 0.236) and initializes variables for tracking the high and low of O and X columns.
O Column Logic:
When the current column is identified as an O column (when the close is less than the open), it calculates the Fibonacci level based on the high and low of that column, drawing a line on the chart.
Buy Alert:
If the closing price of the previous bar is above the Fibonacci level of the O column, a buy alert is triggered.
X Column Logic:
If the current column is an X column and the close is above the previous O column's low, it captures the current high and low, calculates the Fibonacci level, and draws it on the chart.
Sell Alert:
A sell alert is triggered if the closing price of the X column is at or below the specified Fibonacci level.
This indicator aids traders by highlighting critical Fibonacci levels and providing timely alerts for potential buy and sell opportunities.
PnF Bullish & Bearish Trend Line Indicator with Proximity AlertThis Pine Script indicator, "PnF Bullish and Bearish Trend line Proximity Alert," overlays on a trading chart to monitor and alert users about interactions with bullish and bearish trend lines derived from Point and Figure (PnF) charting.
Key Features:
Inputs: Users can set parameters such as box size, bullish and bearish angles (in degrees), and a proximity threshold for detecting touches.
Slope Calculation: The script calculates the slopes for bullish and bearish trendlines using the tangent of the specified angles.
Trendline Management:
It initializes and updates trend lines based on price interactions, adjusting their starting points and positions as conditions change.
Proximity Detection: The indicator checks if the current price is close enough to the trend lines and sets conditions for alerts.
Alerts: Users receive alerts when both trend lines are touched, enhancing decision-making for trading strategies.
Visual Feedback: It highlights areas where both trend lines are touched and plots the trend lines in distinct colors for clarity.
This indicator provides an effective way to track key price levels and potential trend reversals in the market.
WSITEEE Imbalance/FVG (FAIR VALUE GAP)Imbalance/FVG (Fair Value Gap) refers to a price imbalance, representing a range on the chart where little liquidity was provided.
Imbalance implies a strong impulsive movement of a candle, which the price almost always returns to cover.
The best analogy would be to imagine painting a wall with a roller. If you move the roller from top to bottom, what remains on the wall? That’s right, gaps that need to be filled. How do you fill them? Exactly, by moving the roller from bottom to top. The same principle applies to imbalance.
How do you correctly mark an Imbalance?
The first thing we need to find on the chart is three candles, one of which should be impulsive. Next, using the “Fibonacci Retracement” tool, we stretch it from the wick of the first candle to the wick of the last candle.
Imbalance can be used both for determining context and as an entry model. On a higher timeframe, it acts as a point of interest (POI), within which you can look for factors to build a position.
This Pine Script is designed for Smart Money traders who work with Fair Value Gaps (FVG). FVGs are three-candle patterns where the third candle does not fully overlap the first, leaving a gap on the second candle. The script helps to automatically detect these gaps and highlight them on the chart with different colors based on their status and type.
It allows for the visualization of imbalances on the chart, highlighting key zones that can serve as important levels for decision-making. With flexible color and label settings, the script can be tailored to individual needs, enhancing data visualization on the chart.
bar_index inspectorThis is a tool for developers who are working with index based plots and find themselves adding the bar_index to their indicators on a regular basis during development and debugging.
What it does:
shows the bar_index in the status line and data window.
plots optional labels (bar index + time) into the chart every 10 bars
Crossover CounterExplanation:
Crossover Detection: We detect the crossover of the 20-period and 50-period moving averages using ta.crossover().
Tracking Price Movement: After the crossover, we start tracking the price to check if it moves up or down by 2%. If an up movement occurs before a down movement, we increment the positive counter. If a down movement occurs first, we increment the negative counter.
Reset Condition: Once either a 2% up or down move is detected, we stop tracking until the next crossover.
Table Display: A table shows the counts of positive and negative events.
Shifted Symbol Overlay with OffsetThe Shifted Symbol Overlay Indicator is a custom TradingView indicator designed to overlay the price data of one stock or asset over another, allowing for direct visual comparison. This is particularly useful for comparing the performance of two assets over different time periods. The indicator enables you to shift the data from one asset either forward or backward in time, making it easier to compare historical data from one stock with more recent data from another. The indicator supports shifting both to the right (future periods) and to the left (earlier periods), helping traders and analysts explore correlations or divergences between two financial instruments.
The indicator also includes a normalization option that adjusts the scale of the two assets, so you can compare them even if they have vastly different price levels. This is useful when you're interested in relative performance rather than the absolute price values.
Price Movement > Custom Points with Day of WeekThe code is a TradingView Pine Script indicator designed to track and visualize price movements in a financial market (like stocks or cryptocurrencies) based on a specific point threshold. Here’s a breakdown of its functionality:
Purpose of the Code:
Price Movement Calculation: It calculates the difference between the closing price and the opening price of each bar (or candle) to determine if the price has moved significantly.
Threshold Input: The user can set a threshold (e.g., 500 points) to determine what constitutes a significant movement.
Movement Conditions:
Positive Movement: If the price movement is greater than the threshold, it’s marked as a positive movement.
Negative Movement: If the price movement is less than the negative threshold (i.e., below -500 points), it’s marked as a negative movement.
Day of the Week Identification: The script identifies the day of the week for each bar (Monday through Sunday).
Visual Output:
It plots shapes (like labels) on the chart:
For positive movements, it shows "YES" in green, indicating the movement exceeded the threshold for that day.
For negative movements, it shows "YES" in red, indicating the movement fell below the negative threshold for that day.
Use Cases:
Traders: It helps traders quickly identify days where significant price movements occurred, allowing them to analyze trends and make informed trading decisions.
Market Analysis: The indicator can be used for backtesting strategies based on significant price movements.
Overall, this code serves as a visual tool for analyzing price volatility in a market based on user-defined thresholds and day-based observations. If you have any specific questions or need further clarification about any part of it, feel free to ask!
Currency Futures StatisticsThe "Currency Futures Statistics" indicator provides comprehensive insights into the performance and characteristics of various currency futures. This indicator is crucial for portfolio management as it combines multiple metrics that are instrumental in evaluating currency futures' risk and return profiles.
Metrics Included:
Historical Volatility:
Definition: Historical volatility measures the standard deviation of returns over a specified period, scaled to an annual basis.
Importance: High volatility indicates greater price fluctuations, which translates to higher risk. Investors and portfolio managers use volatility to gauge the stability of a currency future and to make informed decisions about risk management and position sizing (Hull, J. C. (2017). Options, Futures, and Other Derivatives).
Open Interest:
Definition: Open interest represents the total number of outstanding futures contracts that are held by market participants.
Importance: High open interest often signifies liquidity in the market, meaning that entering and exiting positions is less likely to impact the price significantly. It also reflects market sentiment and the degree of participation in the futures market (Black, F., & Scholes, M. (1973). The Pricing of Options and Corporate Liabilities).
Year-over-Year (YoY) Performance:
Definition: YoY performance calculates the percentage change in the futures contract's price compared to the same week from the previous year.
Importance: This metric provides insight into the long-term trend and relative performance of a currency future. Positive YoY performance suggests strengthening trends, while negative values indicate weakening trends (Fama, E. F. (1991). Efficient Capital Markets: II).
200-Day Simple Moving Average (SMA) Position:
Definition: This metric indicates whether the current price of the currency future is above or below its 200-day simple moving average.
Importance: The 200-day SMA is a widely used trend indicator. If the price is above the SMA, it suggests a bullish trend, while being below indicates a bearish trend. This information is vital for trend-following strategies and can help in making buy or sell decisions (Bollinger, J. (2001). Bollinger on Bollinger Bands).
Why These Metrics are Important for Portfolio Management:
Risk Assessment: Historical volatility and open interest provide essential information for assessing the risk associated with currency futures. Understanding the volatility helps in estimating potential price swings, which is crucial for managing risk and setting appropriate stop-loss levels.
Liquidity and Market Participation: Open interest is a critical indicator of market liquidity. Higher open interest usually means tighter bid-ask spreads and better liquidity, which facilitates smoother trading and better execution of trades.
Trend Analysis: YoY performance and the SMA position help in analyzing long-term trends. This analysis is crucial for making strategic investment decisions and adjusting the portfolio based on changing market conditions.
Informed Decision-Making: Combining these metrics allows for a holistic view of the currency futures market. This comprehensive view helps in making informed decisions, balancing risks and returns, and optimizing the portfolio to align with investment goals.
In summary, the "Currency Futures Statistics" indicator equips investors and portfolio managers with valuable data points that are essential for effective risk management, liquidity assessment, trend analysis, and overall portfolio optimization.
Pseudo-Renko Stabilized (Val)█ CALCULATE PSEUDO-RENKO VALUE
Calculates and returns the Pseudo-Renko Stabilized value (or close price) based on a given input value, along with the direction of the current Renko brick. This function adapts the traditional Renko brick size dynamically based on the volatility of the input value using a combination of SMA and EMA calculations. The calculated price represents the closing price of the most recent Pseudo-Renko brick, while the direction indicates the trend ( 1 for uptrend, -1 for downtrend).
Parameters:
* `val` :
* Type: ` float `
* Description: The input value upon which the Pseudo-Renko calculations are performed. You can use any price series or custom value as input.
* `sensitivity` :
* Type: ` float `
* Default Value: ` 1.0 `
* Description: Controls the sensitivity of the brick size to the volatility of the `val`. Higher values lead to larger bricks, resulting in a smoother Renko chart. Lower values produce smaller bricks, leading to a more reactive chart.
* Possible Values: Any positive float.
* `length` :
* Type: ` int `
* Default Value: ` 7 `
* Description: The length used for calculating the EMA and SMA in the dynamic brick size calculation. It influences how quickly the brick size adapts to changing volatility of the `val`.
* Possible Values: Any positive integer.
Return Values:
* `lastRenkoClose` :
* Type: ` float `
* Description: The closing price of the last completed Pseudo-Renko brick based on the `val`.
* `renkoDirection` :
* Type: ` int `
* Description: The direction of the current Pseudo-Renko brick based on the `val`:
* ` 1 `: Uptrend
* ` -1 `: Downtrend
* ` 0 `: No change (initially, or no brick change since the previous bar)
Example Usage:
//@version=5
indicator("Pseudo-Renko Stabilized (Val)", overlay=true)
// Get user inputs
sensitivityInput = input.float(0.1, "Sensitivity",0.01,step=0.01)
lengthInput = input.int(5, "Length",2)
// Example usage with the 'close' price as the input value
= pseudo_renko(math.avg(close,open), sensitivityInput, lengthInput)
// Plot the Renko close price
plot(renkoClose, "Renko Close", renkoDirection>0?color.aqua:color.orange,2)
// You can also use other values as input, such as:
// = pseudo_renko(high, sensitivityInput, lengthInput)
// = pseudo_renko(low, sensitivityInput, lengthInput)
This example demonstrates how to use the `pseudo_renko` function within an indicator. It takes user inputs for `sensitivity` and `length`, then calculates the Pseudo-Renko values using the average of the `close` and `open` prices as the `val`. The resulting `renkoClose` price is plotted on the chart, with a color change based on the `renkoDirection`. It also illustrates how you can use other values, like `high` and `low`, as input to the function.
Note: The Pseudo-Renko algorithm is based on adapting the Renko brick size dynamically based on the input `val`. This provides more flexibility compared to the normal, but is experimental. The `sensitivity` and `length` parameters, along with the choice of the `val`, offer further customization to tune the algorithm's behavior to your preference and trading style.