Kalman For Loop [BackQuant]Kalman For Loop
Introducing BackQuant's Kalman For Loop (Kalman FL) — a highly adaptive trading indicator that uses a Kalman filter to smooth price data and generate actionable long and short signals. This advanced indicator is designed to help traders identify trends, filter out market noise, and optimize their entry and exit points with precision. Let’s explore how this indicator works, its key features, and how it can enhance your trading strategies.
Core Concept: Kalman Filter
The Kalman Filter is a mathematical algorithm used to estimate the state of a system by filtering noisy data. It is widely used in areas such as control systems, signal processing, and time-series analysis. In the context of trading, a Kalman filter can be applied to price data to smooth out short-term fluctuations, providing a clearer view of the underlying trend.
Unlike moving averages, which use fixed weights to smooth data, the Kalman Filter adjusts its estimate dynamically based on the relationship between the process noise and the measurement noise. This makes the filter more adaptive to changing market conditions, providing more accurate trend detection without the lag associated with traditional smoothing techniques.
Please see the original Kalman Price Filter
In this script, the Kalman For Loop applies the Kalman filter to the price source (default set to the closing price) to generate a smoothed price series, which is then used to calculate signals.
Adaptive Smoothing with Process and Measurement Noise
Two key parameters govern the behavior of the Kalman filter:
Process Noise: This controls the extent to which the model allows for uncertainty in price changes. A lower process noise value will make the filter smoother but slower to react to price changes, while a higher value makes it more sensitive to recent price fluctuations.
Measurement Noise: This represents the uncertainty or "noise" in the observed price data. A higher measurement noise value gives the filter more leeway to ignore short-term fluctuations, focusing on the broader trend. Lowering the measurement noise makes the filter more responsive to minor changes in price.
These settings allow traders to fine-tune the Kalman filter’s sensitivity, adjusting it to match their preferred trading style or market conditions.
For-Loop Scoring Mechanism
The Kalman FL further enhances the effectiveness of the Kalman filter by using a for-loop scoring system. This mechanism evaluates the smoothed price over a range of periods (defined by the Calculation Start and Calculation End inputs), assigning a score based on whether the current filtered price is higher or lower than previous values.
Long Signals: A long signal is generated when the for-loop score surpasses the Long Threshold (default set at 20), indicating a strong upward trend. This helps traders identify potential buying opportunities.
Short Signals: A short signal is triggered when the score crosses below the Short Threshold (default set at -10), signaling a potential downtrend or selling opportunity.
These signals are plotted on the chart, giving traders a clear visual indication of when to enter long or short positions.
Customization and Visualization Options
The Kalman For Loop comes with a range of customization options to give traders full control over how the indicator operates and is displayed on the chart:
Kalman Price Source: Choose the price data used for the Kalman filter (default is the closing price), allowing you to apply the filter to other price points like open, high, or low.
Filter Order: Set the order of the Kalman filter (default is 5), controlling how far back the filter looks in its calculations.
Process and Measurement Noise: Fine-tune the sensitivity of the Kalman filter by adjusting these noise parameters.
Signal Line Width and Colors: Customize the appearance of the signal line and the colors used to indicate long and short conditions.
Threshold Lines: Toggle the display of the long and short threshold lines on the chart for better visual clarity.
The indicator also includes the option to color the candlesticks based on the current trend direction, allowing traders to quickly identify changes in market sentiment. In addition, a background color feature further highlights the overall trend by shading the background in green for long signals and red for short signals.
Trading Applications
The Kalman For Loop is a versatile tool that can be adapted to a variety of trading strategies and markets. Some of the primary use cases include:
Trend Following: The adaptive nature of the Kalman filter helps traders identify the start of new trends with greater precision. The for-loop scoring system quantifies the strength of the trend, making it easier to stay in trades for longer when the trend remains strong.
Mean Reversion: For traders looking to capitalize on short-term reversals, the Kalman filter's ability to smooth price data makes it easier to spot when price has deviated too far from its expected path, potentially signaling a reversal.
Noise Reduction: The Kalman filter excels at filtering out short-term price noise, allowing traders to focus on the broader market movements without being distracted by minor fluctuations.
Risk Management: By providing clear long and short signals based on filtered price data, the Kalman FL helps traders manage risk by entering positions only when the trend is well-defined, reducing the chances of false signals.
Alerts and Automation
To further assist traders, the Kalman For Loop includes built-in alert conditions that notify you when a long or short signal is generated. These alerts can be configured to trigger notifications, helping you stay on top of market movements without constantly monitoring the chart.
Final Thoughts
The Kalman For Loop is a powerful and adaptive trading indicator that combines the precision of the Kalman filter with a for-loop scoring mechanism to generate reliable long and short signals. Whether you’re a trend follower or a reversal trader, this indicator offers the flexibility and accuracy needed to navigate complex markets with confidence.
As always, it’s important to backtest the indicator and adjust the settings to fit your trading style and market conditions. No indicator is perfect, and the Kalman FL should be used alongside other tools and sound risk management practices for the best results.
Statistics
Candle Series AnalysisThis advanced indicator is designed to analyze and predict potential market movements based on historical candle series patterns. It goes beyond simple candle-by-candle analysis by examining entire series of consecutive bullish or bearish candles, providing a more comprehensive view of market trends and potential reversals.
The indicator works by identifying the current series of candles (either bullish or bearish) and calculating its percentage change from the start to the current price. It then searches through historical data to find similar candle series patterns, comparing their characteristics to the current one. The analysis includes the series type (bullish or bearish), length (number of candles), and percentage change.
One of the key features of this indicator is its ability to adjust for varying degrees of similarity. Users can set a similarity threshold, allowing them to control how closely historical patterns must match the current one to be considered in the analysis. This flexibility enables traders to fine-tune the indicator to their specific needs and market conditions.
The indicator displays its findings in a customizable table on the chart. The table provides valuable information such as the current series type, length, and percentage change. It also shows the number of similar historical patterns found and the average price change that occurred a specified number of bars after these similar patterns.
Traders can use this information to gain insights into potential future price movements. For example, if the indicator finds that similar bullish series in the past were often followed by a continued uptrend, it might suggest a higher probability of further gains. Conversely, if bearish series typically led to reversals, it could signal a potential buying opportunity.
The script offers extensive customization options. Users can adjust the analysis period, projection length, similarity threshold, table position, text size, and color scheme. This flexibility allows traders to integrate the indicator seamlessly into their existing chart setups and trading strategies.
I personally find this indicator particularly useful for analyzing market behavior in assets that tend to exhibit trending behavior or are subject to momentum effects. It can be especially valuable in markets driven by retail sentiment, such as certain cryptocurrencies or popular stocks. In these markets, the psychology behind consecutive bullish or bearish candles can often create predictable patterns that this indicator aims to identify and quantify.
For instance, in crypto markets, a series of strong bullish candles might indicate growing enthusiasm among retail investors. The indicator can help assess whether such enthusiasm typically leads to further gains or if it often precedes a reversal. This insight can be crucial for timing entries and exits or for setting appropriate stop-loss and take-profit levels.
This indicator is provided for informational and educational purposes only. It should not be considered as financial advice or a recommendation to buy, sell, or hold any financial instrument. Past performance does not guarantee future results, and all trading carries inherent risks. Users should always conduct their own research, consider their financial situation, and consult with a qualified financial advisor before making any investment decisions. The creator of this indicator is not responsible for any losses incurred from its use. Remember that financial markets can be highly unpredictable, and no indicator can guarantee accurate predictions of future price movements.
Candle % Change StrategyThis indicator is designed to analyze the percentage change of candles and provide insights into potential future price movements based on historical patterns. It calculates the percentage change of the current candle and compares it to similar candles in the past, offering a statistical view of what typically happens after such price movements.
The strategy works by identifying candles with similar percentage changes to the current one, either bullish or bearish, and then calculating the average price change that occurred a specified number of bars after these similar candles. This information can be valuable for traders looking to understand potential market reactions following significant price movements.
The indicator displays its findings in a customizable table on the chart. The table shows the current candle's percentage change, the number of similar candles found in the historical data, and the average price change that occurred after these similar candles. Users can adjust various settings such as the number of periods to analyze, the number of forward bars to look ahead, the position and text size of the table, and color schemes.
One of the key features of this indicator is its ability to adapt to both bullish and bearish scenarios. It automatically detects whether the current candle is bullish or bearish and adjusts its analysis accordingly. This makes it versatile for different market conditions and trading strategies.
The script allows for extensive customization. Users can modify the look and feel of the indicator by adjusting colors, table position, and text size to suit their preferences and chart setup. This flexibility ensures that the indicator can be integrated seamlessly into various trading environments and styles.
Personally, I find this indicator particularly useful for analyzing market reactions following large bearish candles. It can provide valuable insights into how the market typically responds to significant downward price movements, which can be crucial for timing entries or exits in a trade.
This strategy can be especially interesting for symbols that are heavily traded by retail investors, such as certain cryptocurrencies. In these markets, emotional reactions to large price movements can sometimes create predictable patterns, which this indicator aims to identify and quantify.
This indicator is for informational and educational purposes only. It should not be considered as financial advice or a recommendation to buy or sell any financial instrument. Past performance does not guarantee future results, and all trading carries risk. Users should always conduct their own research and consider their financial situation before making any investment decisions. The creator of this indicator is not responsible for any losses incurred from its use.
Portfolio SnapShot v0.3Here is a Tradingview Pinescript that I call "Portfolio Snapshot". It is based on two other separate scripts that I combined, modified and simplified - shoutout to RedKTrader (Portfolio Tracker - Table Version) and FriendOfTheTrend (Portfolio Tracker For Stocks & Crypto) for their inspiration and code. I was using both of these scripts, and decided to combine the two and increase the number of stocks to 20. I was looking for an easy way to track my entire portfolio (scattered across 5 accounts) PnL on a total and stock basis. PnL - that's it, very simple by design. The features are:
1) Track PnL across multiple accounts, from inception and current day.
2) PnL is reported in two tables, at the portfolio level and individual stock level
3) Both tables can be turned on/off and placed anywhere on the chart.
4) Input up to 20 assets (stocks, crypto, ETFs)
The user has to manually calculate total shares and average basis for stocks in multiple accounts, and then inputs this in the user input dialog. I update mine as each trade is made, or you can just update once a week or so.
I've pre-loaded it with the major indices and sector ETFs, plus URA, GLD, SLV. 100 shares of each, and prices are based on the close Jan 2 2024. So if you don't want to track your portfolio, you can use it to track other things you find interesting, such as annual performance of each sector.
Memecoin TrackerMemecoin Z-Score Tracker with Buy/Sell Table - Technical Explanation
How it Works:
This indicator calculates the Z-scores of various memecoins based on their price movements, using historical funding rates across multiple exchanges. A Z-score measures the deviation of the current price from its moving average, expressed in standard deviations. This provides insight into whether a coin is overbought (positive Z-score) or oversold (negative Z-score) relative to its recent history.
Key Components:
- Z-Score Calculation
- The lookback period is dynamically adjusted based on the chart’s timeframe to ensure consistency across different time intervals:
- For lower timeframes (e.g., minutes), the base lookback period is scaled to match approximately 240 minutes.
- For daily and higher timeframes, the base lookback period is fixed (e.g., 14 bars).
Memecoin Selection:
The indicator tracks several popular memecoins, including DOGE, SHIB, PEPE, FLOKI, and others.
Funding rates are fetched from exchanges like Binance, Bybit, and MEXC using the request.security() function, ensuring accurate real-time price data.
Thresholds for Buy/Sell Signals:
Users can set custom Z-score thresholds for buy (oversold) and sell (overbought) signals:
Default upper threshold: 2.5 (indicates overbought condition).
Default lower threshold: -2.5 (indicates oversold condition).
When a memecoin’s Z-score crosses above or below these thresholds, it signals potential buy or sell conditions.
Buy/Sell Table:
A table with two columns (BUY and SELL) is dynamically populated with memecoins that are currently oversold (buy signal) or overbought (sell signal).
Each column can hold up to 20 entries, providing a clear overview of current market opportunities.
Visual Feedback:
The Z-scores of each memecoin are plotted as a line on the chart, with color-coded feedback:
Red for overbought (Z-score > upper threshold),
Green for oversold (Z-score < lower threshold),
Other colors indicate neutral conditions.
Horizontal lines representing the upper and lower thresholds are plotted for reference.
How to Use It:
Adjust Thresholds:
You can modify the upper and lower Z-score thresholds in the settings to customize sensitivity. Lower thresholds will increase the likelihood of triggering buy/sell signals for smaller price deviations, while higher thresholds will focus on more extreme conditions.
View Real-Time Signals:
The table shows which memecoins are currently oversold (buy column) or overbought (sell column), updating dynamically as price data changes. Traders can monitor this table to identify trading opportunities quickly.
Use with Different Timeframes:
The Z-score lookback period adjusts automatically based on the chart's timeframe, making this indicator suitable for intraday and long-term traders.
Use shorter timeframes (e.g., 1-minute, 5-minute charts) for faster signals, while longer timeframes (e.g., daily, weekly) may yield more stable, trend-based signals.
Who It Is For:
Short-Term Traders: Those looking to capitalize on short-term price imbalances (e.g., day traders, scalpers) can use this indicator to identify quick buy/sell opportunities as memecoins oscillate around their moving averages.
Swing Traders: Swing traders can use the Z-score tracker to identify overbought or oversold conditions across multiple memecoins and ride the reversals back toward equilibrium.
Crypto Enthusiasts and Memecoin Investors: Anyone involved in the volatile memecoin market can use this tool to better time entries and exits based on market extremes.
This indicator is for traders seeking quantitative analysis of price extremes in memecoins. By tracking the Z-scores across multiple coins and dynamically updating buy/sell opportunities in a table, it provides a systematic approach to identifying trade setups.
Ehlers Loops [BigBeluga]The Ehlers Loops indicator is based on the concepts developed by John F. Ehlers, which provide a visual representation of the relationship between price and volume dynamics. This tool helps traders predict future market movements by observing how price and volume data interact within four distinct quadrants of the loop, each representing different combinations of price and volume directions. The unique structure of this indicator provides insights into the strength and direction of market trends, offering a clearer perspective on price behavior relative to volume.
🔵 KEY FEATURES & USAGE
● Four Price-Volume Quadrants:
The Ehlers Loops chart consists of four quadrants:
+Price & +Volume (top-right) – Typically indicates a bullish continuation in the market.
-Price & +Volume (bottom-right) – Generally shows a bearish continuation.
+Price & -Volume (top-left) – Typically indicates an exhaustion of demand with a potential reversal.
-Price & -Volume (bottom-left) – Indicates exhaustion of supply and near trend reversal.
By watching how symbols move through these quadrants over time, traders can assess shifts in momentum and volume flow.
● Price and Volume Scaling in Standard Deviations:
Both price and volume data are individually filtered using HighPass and SuperSmoother filters, which transform them into band-limited signals with zero mean. This scaling allows traders to view data in terms of its deviation from the average, making it easier to spot abnormal movements or trends in both price and volume.
● Loops Trajectories with Tails:
The loops draw a trail of price and volume dynamics over time, allowing traders to observe historical price-volume interactions and predict future movements based on the curvature and direction of the rotation.
● Price & Volume Histograms:
On the right side of the chart, histograms for each symbol provide a summary of the most recent price and volume values. These histograms allow traders to easily compare the strength and direction of multiple assets and evaluate market conditions at a glance.
● Flexible Symbol Display & Customization:
Traders can select up to five different symbols to be displayed within the Ehlers Loops. The settings also allow customization of symbol size, colors, and visibility of the histograms. Additionally, traders can adjust the LPPeriod and HPPeriod to change the smoothness and lag of the loops, with a shorter LPPeriod offering more responsiveness and a longer HPPeriod emphasizing longer-term trends.
🔵 USAGE
🔵 SETTINGS
Low pass Period: default is 10 to
obtain minimum lag with just a little smoothing.
High pass Period: default is 125 (half of the year if Daily timeframe) to capture the longer term moves.
🔵 CONCLUSION
The Ehlers Loops indicator offers a visually rich and highly customizable way to observe price and volume dynamics across multiple assets. By using band-limited signals and scaling data into standard deviations, traders gain a powerful tool for identifying market trends and predicting future movements. Whether you're tracking short-term fluctuations or long-term trends, Ehlers Loops can help you stay ahead of the market by offering key insights into the relationship between price and volume.
Japan Stock Market Indices Performance TableYou can display the performance of the Nikkei 225 Futures and major indices of the Japanese stock market for the day in a table format on your chart.
The 5-Minute Change Rate shows the change from the opening price of the most recent 5-minute candlestick.
The Daily Change Rate displays the change from the opening price at 09:00 GMT+9 on the current trading day.
Since the Japanese stock market opens at 09:00 GMT+9 , the values for Nikkei 225 Futures, USD/JPY, and EUR/JPY are also calculated based on their opening prices at that time. This script was created because, while brokerage apps allow you to see the comparison to the previous day's close for each index, they do not display the rate of change from the current day's opening price.
Notes:
All values are reset each trading day at 09:00 GMT+9.
If you have not purchased real-time market data from the Tokyo Stock Exchange and Osaka Exchange, data may be delayed by 20 minutes and may not display correctly.
The Tokyo Stock Exchange sector indices are distributed in real-time at 15-second intervals from the TSE, so this script aligns with that timing.
当日の日経225先物と日本株式市場の主要指数のパフォーマンスを表形式でチャート上に表示することができます。
5分変化率は直近の5分足の始値からの変化率、当日変化率は当日09:00の始値からの変化率を表示しています。
日本株式市場が開くのが GMT+9 09:00 のため、それに合わせて日経225先物、ドル円、ユーロ円も GMT+9 09:00 時点の始値を元に各値を算出しています。
各指数の前日比は証券会社のアプリで見れるものの、当日始値からの変化率が見れないため作成しました。
補足
各営業日の朝(GMT+9 09:00)に各値はリセットされます。
Tokyo Stock ExchangeとOsaka Exchangeのreal-time market dataを購入していない場合、データが20分遅れになるため正常に表示されない可能性があります。
東証業種別株価指数は東証から配信されるのが15秒間隔でのリアルタイムになるため、このスクリプトもそれに準ずる形となっています。
RSI Weighted Trend System I [InvestorUnknown]The RSI Weighted Trend System I is an experimental indicator designed to combine both slow-moving trend indicators for stable trend identification and fast-moving indicators to capture potential major turning points in the market. The novelty of this system lies in the dynamic weighting mechanism, where fast indicators receive weight based on the current Relative Strength Index (RSI) value, thus providing a flexible tool for traders seeking to adapt their strategies to varying market conditions.
Dynamic RSI-Based Weighting System
The core of the indicator is the dynamic weighting of fast indicators based on the value of the RSI. In essence, the higher the absolute value of the RSI (whether positive or negative), the higher the weight assigned to the fast indicators. This enables the system to capture rapid price movements around potential turning points.
Users can choose between a threshold-based or continuous weight system:
Threshold-Based Weighting: Fast indicators are activated only when the absolute RSI value exceeds a user-defined threshold. Below this threshold, fast indicators receive no weight.
Continuous Weighting: By setting the weight threshold to zero, the fast indicators always receive some weight, although this can result in more false signals in ranging markets.
// Calculate weight for Fast Indicators based on RSI (Slow Indicator weight is kept to 1 for simplicity)
f_RSI_Weight_System(series float rsi, simple float weight_thre) =>
float fast_weight = na
float slow_weight = na
if weight_thre > 0
if math.abs(rsi) <= weight_thre
fast_weight := 0
slow_weight := 1
else
fast_weight := 0 + math.sqrt(math.abs(rsi))
slow_weight := 1
else
fast_weight := 0 + math.sqrt(math.abs(rsi))
slow_weight := 1
Slow and Fast Indicators
Slow Indicators are designed to identify stable trends, remaining constant in weight. These include:
DMI (Directional Movement Index) For Loop
CCI (Commodity Channel Index) For Loop
Aroon For Loop
Fast Indicators are more responsive and designed to spot rapid trend shifts:
ZLEMA (Zero-Lag Exponential Moving Average) For Loop
IIRF (Infinite Impulse Response Filter) For Loop
Each of these indicators is calculated using a for-loop method to generate a moving average, which captures the trend of a given length range.
RSI Normalization
To facilitate the weighting system, the RSI is normalized from its usual 0-100 range to a -1 to 1 range. This allows for easy scaling when calculating weights and helps the system adjust to rapidly changing market conditions.
// Normalize RSI (1 to -1)
f_RSI(series float rsi_src, simple int rsi_len, simple string rsi_wb, simple string ma_type, simple int ma_len) =>
output = switch rsi_wb
"RAW RSI" => ta.rsi(rsi_src, rsi_len)
"RSI MA" => ma_type == "EMA" ? (ta.ema(ta.rsi(rsi_src, rsi_len), ma_len)) : (ta.sma(ta.rsi(rsi_src, rsi_len), ma_len))
Signal Calculation
The final trading signal is a weighted average of both the slow and fast indicators, depending on the calculated weights from the RSI. This ensures a balanced approach, where slow indicators maintain overall trend guidance, while fast indicators provide timely entries and exits.
// Calculate Signal (as weighted average)
sig = math.round(((DMI*slow_w) + (CCI*slow_w) + (Aroon*slow_w) + (ZLEMA*fast_w) + (IIRF*fast_w)) / (3*slow_w + 2*fast_w), 2)
Backtest Mode and Performance Metrics
This version of the RSI Weighted Trend System includes a comprehensive backtesting mode, allowing users to evaluate the performance of their selected settings against a Buy & Hold strategy. The backtesting includes:
Equity calculation based on the signals generated by the indicator.
Performance metrics table comparing Buy & Hold strategy metrics with the system’s signals, including: Mean, positive, and negative return percentages, Standard deviations (of all, positive and negative returns), Sharpe Ratio, Sortino Ratio, and Omega Ratio
f_PerformanceMetrics(series float base, int Lookback, simple float startDate, bool Annualize = true) =>
// Initialize variables for positive and negative returns
pos_sum = 0.0
neg_sum = 0.0
pos_count = 0
neg_count = 0
returns_sum = 0.0
returns_squared_sum = 0.0
pos_returns_squared_sum = 0.0
neg_returns_squared_sum = 0.0
// Loop through the past 'Lookback' bars to calculate sums and counts
if (time >= startDate)
for i = 0 to Lookback - 1
r = (base - base ) / base
returns_sum += r
returns_squared_sum += r * r
if r > 0
pos_sum += r
pos_count += 1
pos_returns_squared_sum += r * r
if r < 0
neg_sum += r
neg_count += 1
neg_returns_squared_sum += r * r
float export_array = array.new_float(12)
// Calculate means
mean_all = math.round((returns_sum / Lookback) * 100, 2)
mean_pos = math.round((pos_count != 0 ? pos_sum / pos_count : na) * 100, 2)
mean_neg = math.round((neg_count != 0 ? neg_sum / neg_count : na) * 100, 2)
// Calculate standard deviations
stddev_all = math.round((math.sqrt((returns_squared_sum - (returns_sum * returns_sum) / Lookback) / Lookback)) * 100, 2)
stddev_pos = math.round((pos_count != 0 ? math.sqrt((pos_returns_squared_sum - (pos_sum * pos_sum) / pos_count) / pos_count) : na) * 100, 2)
stddev_neg = math.round((neg_count != 0 ? math.sqrt((neg_returns_squared_sum - (neg_sum * neg_sum) / neg_count) / neg_count) : na) * 100, 2)
// Calculate probabilities
prob_pos = math.round((pos_count / Lookback) * 100, 2)
prob_neg = math.round((neg_count / Lookback) * 100, 2)
prob_neu = math.round(((Lookback - pos_count - neg_count) / Lookback) * 100, 2)
// Calculate ratios
sharpe_ratio = math.round(mean_all / stddev_all * (Annualize ? math.sqrt(Lookback) : 1), 2)
sortino_ratio = math.round(mean_all / stddev_neg * (Annualize ? math.sqrt(Lookback) : 1), 2)
omega_ratio = math.round(pos_sum / math.abs(neg_sum), 2)
// Set values in the array
array.set(export_array, 0, mean_all), array.set(export_array, 1, mean_pos), array.set(export_array, 2, mean_neg),
array.set(export_array, 3, stddev_all), array.set(export_array, 4, stddev_pos), array.set(export_array, 5, stddev_neg),
array.set(export_array, 6, prob_pos), array.set(export_array, 7, prob_neu), array.set(export_array, 8, prob_neg),
array.set(export_array, 9, sharpe_ratio), array.set(export_array, 10, sortino_ratio), array.set(export_array, 11, omega_ratio)
// Export the array
export_array
The metrics help traders assess the effectiveness of their strategy over time and can be used to optimize their settings.
Calibration Mode
A calibration mode is included to assist users in tuning the indicator to their specific needs. In this mode, traders can focus on a specific indicator (e.g., DMI, CCI, Aroon, ZLEMA, IIRF, or RSI) and fine-tune it without interference from other signals.
The calibration plot visualizes the chosen indicator's performance against a zero line, making it easy to see how changes in the indicator’s settings affect its trend detection.
Customization and Default Settings
Important Note: The default settings provided are not optimized for any particular market or asset. They serve as a starting point for experimentation. Traders are encouraged to calibrate the system to suit their own trading strategies and preferences.
The indicator allows deep customization, from selecting which indicators to use, adjusting the lengths of each indicator, smoothing parameters, and the RSI weight system.
Alerts
Traders can set alerts for both long and short signals when the indicator flips, allowing for automated monitoring of potential trading opportunities.
Similar Price ActionDescription:
The indicator tries to find an area of N candles in history that has the most similar price action to the latest N candles. The maximum search distance is limited to 5000 candles. It works by calculating a coefficient for each candle and comparing it with the coefficient of the latest candle, thus searching for two closest values. The indicator highlights the latest N candles, as well as the most similar area found in the past, and also tries to predict future price based on the latest price and price directly after the most similar area that was found in the past.
Inputs:
- Length -> the area we are searching for is comprised of this many candles
- Lookback -> maximum distance in which a similar area can be found
- Function -> the function used to compare latest and past prices
Notes:
- The indicator is intended to work on smaller timeframes where the overall price difference is not very high, but can be used on any
LPPL Critical Pulse (by BigBlueCheese) Version 1.1LPPL Critical Pulse (by BigBlueCheese)
I couldn’t locate a single script on TradingView that utilized the Log-Periodic Power Law (LPPL) and period doubling—key tools used by street professionals. Here is my first script…More to come.
Log-Periodic Power Law (LPPL)
LPPL is a mathematical framework used to model asset price bubbles that can help predict market crashes or corrections. It is based on the idea that speculative bubbles exhibit self-reinforcing, positive feedback behavior that leads to increasingly unsustainable price growth, followed by a crash or correction. But the big news is that because of the speculative behavior it can identify, it has equal application across many other instruments & timeframes.
The LPPL, has been around since the 1950’s and 1960’s where its theoretical foundation lies in the concepts of renormalized group theory and critical point behavior. Physicists Lev Landau, Vitaly Ginzburg & Kenneth Wilson contributed to how we can understand systems behave at critical points and was further developed by Benoit Mandelbrot via the concept of discrete scale invariance and log-periodicity. The concepts were popularized by Didier Sornette in Why Stock Markets Crash, where he used his model to detect when markets are experiencing extreme price movements, indicating the potential for a bubble to burst or a significant correction to occur. It is suspected that others like Jim Simons was an early adopter/adapter of this (and other) advanced mathematical concepts. LPPL is especially valuable for traders trying to anticipate rapid price movements—both upward and downward.
What is a Speculative Bubble?
A speculative bubble forms when an asset’s price skyrockets due to excitement from investors, pushing it well beyond its true value. At some point, this unsustainable growth leads to a crash, as the bubble “pops.” However, these crashes don’t need to be massive market-shaking events. They can also emerge from short-term price anomalies in any market or timeframe…..and they apply equally to upward & downward price moves. That is you can use this approach for both long and short trades.
Power Law & Log-Periodicity
The Power Law aspect describes how prices accelerate as they approach a critical point, forming a steep curve that signals instability.
The Log-Periodic component captures the oscillations that grow increasingly frequent as the price nears this tipping point, marking rising volatility.
Criticality in Trading: Feedback Loops, Attractors and Repellers
LPPL can be applied to financial markets by comparing them to natural systems prone to critical points, like avalanches or earthquakes. The key concept is criticality—the idea that, just like pressure building in an earthquake zone or snow stacking up on a mountain, there’s a feedback loop in markets where investor behavior becomes increasingly synchronized. This creates a self-reinforcing cycle, accelerating price movements until the system can no longer sustain the tension, and it collapses—similar to a critical phase shift in nature when physical systems experience sudden, catastrophic events when they reach a critical threshold.
In this context, the LPPL model aims to identify these critical points in financial markets by recognizing specific patterns in price movements, providing insight into the potential timing of major market shifts.
This is how markets can behave like attractors (drawing prices into unsustainable growth or collapses) or repellers (pushing them away through sudden corrections), depending on the balance of forces. LPPL captures this dynamic, helping traders anticipate when the market is nearing these critical moments.
Attractors are states or patterns that a system tends to gravitate towards over time, representing points of stability or equilibrium. Repellers are states that the system tends to avoid or move away from, representing instability or points of divergence.
In the context of the LPPL model, the market is seen as a dynamic system that is moving towards a critical point—often a bubble or a crash. The critical point itself can be viewed as an attractor, pulling the market toward a period of instability as prices accelerate and oscillations become more frequent. This movement reflects positive feedback loops, where investor behavior (e.g., herd mentality or speculative buying) reinforces the trend until it reaches an unsustainable level.
Conversely, once the critical point is reached, it can act as a repeller, causing the system (market) to rapidly move away from that state, often resulting in a crash or market correction. In essence, the LPPL model tries to identify these phases of movement toward or away from critical points, using attractors and repellers to describe the behavior of the system before and after major market events.
This dynamic interaction between stability and instability, or attractors and repellers, is a key feature of how Sornette’s LPPL approach models financial markets, emphasizing the market’s ability to oscillate between periods of calm and critical shifts.
Bubbles and Crashes in Any Timeframe
While people often think of bubbles and crashes as huge events like the Crash of 87, the Global Financial Crisis or COVID-19, they can also be much smaller or instrument specific. A short-term spike in a stock or a sudden currency drop can behave like a miniature bubble. LPPL helps spot these shorter-term price anomalies, making it versatile for traders looking for opportunities in all instruments and timeframes.
How Can I Use LPPL Critical Pulse?
Monitor price acceleration that signals unsustainable growth/movement .
Spot volatility, oscillations, extensions and compressions and exhaustion as the market nears critical instability and levels.
Combine with other indicators to help time entries and exits, manage risk as markets approach/consolidate/leave critical levels.
LPPL Critical Pulse (LPPLCP)
LPPLCP is based on LPPL principles that identify potential upward and downward market movements, exhaustion and consolidation periods.
Visualization
The LPPL line is smoothed using a moving average to reduce noise, and the result is scaled to fit within the price range of the past 100 bars, aligning the LPPL line with the price movements on the chart.
Dynamic LPPL Line Plot:
A smoothed and scaled LPPL line plotted directly on the price chart.
• Color-Coded Trend Analysis: The LPPL line changes color dynamically based on the conditions of slope and acceleration to reflect market behaviors such as period doubling or exhaustion.
1. White (Exhaustion/Consolidation Condition): Indicates that both the slope and the acceleration of the LPPL line are zero, suggesting a potential market flattening or exhaustion/consolidation. At the end of this period, a new trend may emerge OR the prior trend may reassert itself.
2. Purple (Period Doubling): This color appears when the LPPL model detects rapid changes in acceleration, indicating the potential for a market turning point (period doubling). The slope of the LPPL line during this period suggests whether the market is moving upward or downward.
3. Green (Positive Slope with Increasing Acceleration): A green LPPL line suggests that the market is in an upward trend, with increasing acceleration.
4. Red (Negative Slope with Decreasing Acceleration): A red LPPL line indicates a downward market trend with decreasing acceleration.
5. Yellow (Neutral): Yellow is the default color when none of the specific conditions (exhaustion, period doubling, positive/negative slope with acceleration) are met, i.e. generally a continuation of the prior condition but at a slower pace.
Customization for Any Market
LPPL Critical Pulse has application across most time frames for pretty much whatever you want to trade…stocks, commodities, currencies, futures, and more. You will have to tweak the inputs to optimize for the market(s) you choose to trade.
Inputs
1. Lookback Period for Adaptation
o Type: Integer
o Default: 1
o Description: Defines the lookback period for calculating the Simple Moving Average (SMA) and Standard Deviation (StDev) used in the LPPL model. A higher value smooths the calculations over a longer period.
2. Period Doubling Threshold
o Type: Float
o Default: 0.01
o Description: Determines the sensitivity for detecting period doubling in the LPPL line. A lower threshold increases sensitivity.
3. Flattening Threshold
o Type: Float
o Default: 0.01
o Description: This input is not actively used in the current version but can be modified for further customizations in the LPPL model.
4. Period Doubling Acceleration Threshold
o Type: Float
o Default: 0.02
o Description: This controls the threshold for detecting rapid changes in the LPPL acceleration, helping identify when period doubling occurs.
Calculation Components
The LPPL line is calculated using several components:
• SMA (A): The simple moving average of the closing prices over the selected lookback period.
• Standard Deviation (B, C): These parameters are calculated based on the standard deviation of prices and control the amplitude of the LPPL oscillations.
• Exponential Decay: The LPPL line decays as it approaches a theoretical critical time (tc), where market crashes or rapid changes may occur.
Disclaimer.
Not investment advice. Use at your own risk. Past results do not represent and are not indicative of future results
Industry Group Strength - IndiaPresenting the Industry Group Strength Indicator for India market, designed to help traders identify top-performing stocks within specific industry groups that are predefined.
⦿ Identifies Leading Stocks in Industry Groups
⦿ Analyses the following metrics
YTD Return : Measures stock performance from the start of the year.
RS Rating : Relative Strength rating for user-selected periods.
% Return : Percentage return over a user-selected lookback period.
Features
This indicator dynamically recognises the industry group of the current stock on the chart and ranks stocks within that group based on predefined data points. Traders can add this indicator to focus on top-performing stocks relative to their industry.
⦿ Color-coded for Easy Visualisation
You can choose from the following key metrics to rank stocks:
YTD Return
RS Rating
% Return
⦿ Table Format with Performance Metrics Compact mode
Vertical View
Horizontal View
All of the three metrics are shown in the compact mode and the current stock that is viewed is highlighted!
Vertical view
Horizontal view
Stock Ranking
Stocks are ranked based on their performance within industry groups, enabling traders to easily spot leaders and laggards in each sector. Color-coded gradients visually represent the stocks’ performance rankings, with higher percentile rankings indicating better performance.
Relative Strength (RS)
Relative Strength (RS) compares a stock’s performance against the benchmark index. The RS value is normalized from 1 to 99, making it easier to compare across different stocks. A rising RS value indicates that the stock is outperforming the market, helping traders quickly gauge relative performance within industry groups.
Limitations
At the time of developing this indicator, Pine requests are limited to 40 per script so the predefined symbols had to be filtered to 40 per Industry group
Stocks Filters
Filters that are used to filter the stocks in an Industry group to have maximum of 40 stocks
⦿ Auto, Chemical, Engineering, Finance, Pharma
Market Cap >= 1000 Crores and Market Cap <= 60000 Crores
Price >= 30 and Price <= 6000
50 Days Average ( Price * Volume ) >= 6 Crores
⦿ For rest of the Industry groups
Market Cap >= 1000 Crores and Market Cap <= 100000 Crores
Price >= 20 and Price <= 10000
50 Days Average ( Price * Volume ) >= 3 Crores
Credits
This indicator is forked from the Script for US market by @Amphibiantrading Thanks Brandon for the beginning of this indicator.
This indicator is built on TradingView’s new dynamic requests feature, thanks to @PineCoders for making this possible!
Williams %R StrategyThe Williams %R Strategy implemented in Pine Script™ is a trading system based on the Williams %R momentum oscillator. The Williams %R indicator, developed by Larry Williams in 1973, is designed to identify overbought and oversold conditions in a market, helping traders time their entries and exits effectively (Williams, 1979). This particular strategy aims to capitalize on short-term price reversals in the S&P 500 (SPY) by identifying extreme values in the Williams %R indicator and using them as trading signals.
Strategy Rules:
Entry Signal:
A long position is entered when the Williams %R value falls below -90, indicating an oversold condition. This threshold suggests that the market may be near a short-term bottom, and prices are likely to reverse or rebound in the short term (Murphy, 1999).
Exit Signal:
The long position is exited when:
The current close price is higher than the previous day’s high, or
The Williams %R indicator rises above -30, indicating that the market is no longer oversold and may be approaching an overbought condition (Wilder, 1978).
Technical Analysis and Rationale:
The Williams %R is a momentum oscillator that measures the level of the close relative to the high-low range over a specific period, providing insight into whether an asset is trading near its highs or lows. The indicator values range from -100 (most oversold) to 0 (most overbought). When the value falls below -90, it indicates an oversold condition where a reversal is likely (Achelis, 2000). This strategy uses this oversold threshold as a signal to initiate long positions, betting on mean reversion—an established principle in financial markets where prices tend to revert to their historical averages (Jegadeesh & Titman, 1993).
Optimization and Performance:
The strategy allows for an adjustable lookback period (between 2 and 25 days) to determine the range used in the Williams %R calculation. Empirical tests show that shorter lookback periods (e.g., 2 days) yield the most favorable outcomes, with profit factors exceeding 2. This finding aligns with studies suggesting that shorter timeframes can effectively capture short-term momentum reversals (Fama, 1970; Jegadeesh & Titman, 1993).
Scientific Context:
Mean Reversion Theory: The strategy’s core relies on mean reversion, which suggests that prices fluctuate around a mean or average value. Research shows that such strategies, particularly those using oscillators like Williams %R, can exploit these temporary deviations (Poterba & Summers, 1988).
Behavioral Finance: The overbought and oversold conditions identified by Williams %R align with psychological factors influencing trading behavior, such as herding and panic selling, which often create opportunities for price reversals (Shiller, 2003).
Conclusion:
This Williams %R-based strategy utilizes a well-established momentum oscillator to time entries and exits in the S&P 500. By targeting extreme oversold conditions and exiting when these conditions revert or exceed historical ranges, the strategy aims to capture short-term gains. Scientific evidence supports the effectiveness of short-term mean reversion strategies, particularly when using indicators sensitive to momentum shifts.
References:
Achelis, S. B. (2000). Technical Analysis from A to Z. McGraw Hill.
Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383-417.
Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65-91.
Murphy, J. J. (1999). Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications. New York Institute of Finance.
Poterba, J. M., & Summers, L. H. (1988). Mean Reversion in Stock Prices: Evidence and Implications. Journal of Financial Economics, 22(1), 27-59.
Shiller, R. J. (2003). From Efficient Markets Theory to Behavioral Finance. Journal of Economic Perspectives, 17(1), 83-104.
Williams, L. (1979). How I Made One Million Dollars… Last Year… Trading Commodities. Windsor Books.
Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research.
This explanation provides a scientific and evidence-based perspective on the Williams %R trading strategy, aligning it with fundamental principles in technical analysis and behavioral finance.
Kaufman's Adaptive Moving Average (KAMA)Another simple easy to use indicator that incorporates mean reversion and trend following.
Kaufman's Adaptive Moving Average (KAMA) is an indicator developed by Perry Kaufman that adjusts its sensitivity based on market volatility. It is designed to react more quickly during trending markets and slow down in sideways or volatile markets. The primary idea is that in a trending market, the moving average should be more sensitive to price changes, while in a non-trending market, it should be less responsive to noise.
KAMA Formula
The formula for the Kaufman Adaptive Moving Average is:
Efficiency Ratio (ER): Measures the efficiency of price movement over a given period.
ER
=
Smoothing Factor
Volatility
=
Sum of absolute price change
Sum of absolute price movement
ER=
Volatility
Smoothing Factor
=
Sum of absolute price movement
Sum of absolute price change
The Efficiency Ratio is calculated by taking the price change over a defined period and dividing it by the total price movement (which is the sum of absolute price changes).
Smoothing Constant (SC): This is a factor used to adjust the moving average's responsiveness:
SC
=
ER
×
(
2
/
(
𝑛
+
1
)
)
+
(
1
−
ER
)
×
(
2
/
(
𝑛
+
1
)
)
SC=ER×(2/(n+1))+(1−ER)×(2/(n+1))
where n is the length of the moving average period.
Steps to Calculate KAMA:
Efficiency Ratio (ER):
Calculate the sum of absolute price changes over the chosen period.
Calculate the sum of absolute price movements over the same period.
Smoothing Constant (SC):
Use the Efficiency Ratio to adjust the smoothing factor.
KAMA Calculation:
The initial KAMA is the simple moving average (SMA) of the first n periods.
For subsequent periods, KAMA is calculated using a formula based on the smoothing constant and previous KAMA values.
experiment with the variables as you like!!
Fourier Smoothed Volume Zone Oscillator ( FSVZO )Overview 🔎
The fourier smoothed Volume Zone Oscillator (FSVZO) is a versatile tool designed to provide traders with a detailed understanding of market conditions by examining volume dynamics. FSVZO applies a series of advanced regularization techniques aimed at trying to reduce market noise, making signals potentially more readable and actionable. This indicator combines traditional technical analysis tools with a unique set of smoothing functions, aimed at creating a more balanced and reliable oscillator that can assist traders in their decision-making process.
A Combination of Technical Elements for a Unique Edge 🔀
FSVZO integrates a variety of technical elements to offer a comprehensive perspective on the market. These elements can be used individually or in combination, depending on user preferences. Here are the main components:
Volume Zone Oscillator (VZO): This foundational element leverages volume data to identify trends and shifts in buying or selling pressure. Unlike a standalone VZO, the FSVZO incorporates a Fourier-based regularization technique to reduce false signals, allowing traders to focus on meaningful volume-driven movements.
Ehler's White Noise Filter: This component is a sophisticated filter that helps distinguish genuine market signals from white noise. By isolating the meaningful movements in price and volume, the white noise filter contributes to the clarity and reliability of the signals generated.
Divergences Detection: FSVZO also provides divergence signals (both hidden and regular) based on the oscillator and price action. Divergences can be used to anticipate possible market reversals or confirmations, enhancing the trader's ability to recognize significant market shifts.
Money Flow Index (MFI) Smoothing: The MFI is calculated and then smoothed using wavelet and whitenoise techniques, providing a cleaner view of money flow within the market. This helps reduce erratic fluctuations and focuses on more consistent trends.
Trendshift Visualization: The FSVZO features an optional trendshift indicator, highlighting shifts between bullish and bearish conditions. These visual cues make it easier to identify trend reversals, aiding traders in timely decision-making.
Flexible Display Options 📊
FSVZO offers a variety of display modes to cater to different trading styles and visual preferences:
Neon Style Plot: The oscillator is presented with neon-style plots primarily for aesthetic purposes.
Color Blindness Modes 🌈: FSVZO includes several color palettes to accommodate traders affected by different types of color blindness (Protanopia, Deuteranopia, Tritanopia, Achromatopsia). These options ensure that everyone can easily interpret the signals, regardless of visual impairments.
Take Profit Areas & Alerts: The indicator can display take profit areas based on overbought or oversold conditions of the smoothed oscillator, marked by background hues to provide a clear visual signal. Alerts for high and low thresholds can also be enabled to identify moments of increased buying or selling interest.
Divergences and Trend Analysis 🔍
FSVZO also aims to identify bullish and bearish divergences:
Regular Bullish/Bearish Divergence: These occur when the oscillator diverges from the price action, indicating a possible reversal.
Hidden Bullish/Bearish Divergence: These occur within a trend, signaling continuation opportunities that help traders capitalize on ongoing trends.
FSVZO also supports additional filtering for divergences, allowing users to refine the detection of divergences to better suit their trading preferences.
Enhanced Noise Filtering 🔄
One of the unique features of FSVZO is its Fourier Regularization and Ehler's White Noise Filter, which help improve signal reliability by reducing the impact of market noise. These filtering methods are beneficial for traders seeking to avoid whipsaws and focus on more meaningful market movements.
Why FSVZO Stands Out 🔑
Noise Reduction: By combining multiple filtering techniques, FSVZO is designed to react to price changes as quickly as possible while offering various smoothing options to reduce noise, which may make it less responsive but more stable.
Flexible Visualization: The option to use different display modes and the inclusion of color blindness-friendly palettes make FSVZO versatile and accessible to all traders.
Detailed Divergence Analysis: The integration of both regular and hidden divergence detection helps improve the potential for identifying trading opportunities.
Advanced Regularization Techniques: The use of Fourier transformation and white noise filters adds a unique aspect to volume analysis, differentiating FSVZO from other traditional volume oscillators.
Conclusion 🔒
The Regularized Volume Zone Oscillator (FSVZO) is a unique tool that brings together multiple advanced techniques to help traders better understand market conditions and volume dynamics. The indicator is designed to react to price changes as quickly as possible, which may lead to false signals; however, it also offers smoothing options to help reduce noise at the cost of reduced reaction speed. This balance between responsiveness and stability provides traders with flexibility in adapting the indicator to different market conditions. However, as with all indicators, it is crucial to combine FSVZO with other tools and maintain sound risk management practices.
FSVZO is primarily designed for more experienced traders due the number of different signals it provides. It offers enhanced insights into volume trends and market movement, and should be used alongside other indicators to reduce risk and false signals
Gauss KenJi Robot
Gauss KenJi Trading Robot: Precision and Automation for Traders
The Gauss KenJi robot is a cutting-edge trading solution designed for experienced traders seeking to enhance their decision-making through advanced statistical models and automation. Unlike traditional trading tools that rely on generic indicators prone to false signals, the Gauss KenJi robot offers an innovative approach by utilizing two unique indicators: the Kenji Indicator v.2.0 and the Gauss Indicator .
Kenji Indicator v.2.0
Traditional moving averages and related indicators often fail in flat market conditions, where frequent crossovers lead to confusing signals and false trends. The Kenji Indicator addresses this issue by using a combination of correlation analysis and moving averages to more accurately identify the market’s state. This real-time insight allows for better navigation of local trends, reducing noise and increasing the precision of trade signals.
Gauss Indicator
The Gauss Indicator brings the power of statistical analysis into trading by applying the 3 sigmas rule. It calculates and predicts the likely price ranges for specific time frames (hourly, daily, weekly) with probabilities of 68%, 95%, and 99%. This offers traders an actionable framework for setting stop-loss, take-profit, and identifying key support and resistance levels. By providing a clearer view of potential price movements, the Gauss Indicator improves decision-making, ensuring that traders enter and exit the market at optimal points.
Gauss KenJi Robot: How it Works
The Gauss KenJi robot operates on a statistical algorithm based on the Gaussian function, which uses market volatility as a core indicator of price movements. The robot opens positions in the direction of the trend when the price reaches the predetermined Gauss border. Position sizes are calculated according to the “Initial_lot” parameter, with stop-loss and take-profit levels defined by the “Pips” parameter. Trades are automatically closed either when profit targets or stop-loss limits are reached, or if local trend reversals are detected by the Kenji Indicator.
This highly adaptable algorithm can be applied to any asset class (stocks, forex, crypto, commodities) and any time frame, providing traders with a versatile tool to navigate various markets.
Why Gauss KenJi is Essential for Traders
1. Time Efficiency: The robot operates autonomously, allowing traders to step away from constant chart monitoring while still capitalizing on market movements.
2. Profit Maximization: By leveraging machine learning and advanced statistical models, the robot identifies opportunities faster than human traders, ensuring more profitable trades.
3. Risk Management: The robot strictly adheres to predefined rules, helping traders minimize losses and protect their capital in volatile market conditions.
4. Cross-market Versatility: Whether you’re trading forex, stocks, crypto, or commodities, Gauss KenJi adapts to different markets and time frames, making it a versatile tool for professional traders.
The Gauss KenJi robot is a comprehensive, scientifically driven trading solution designed to eliminate common pitfalls associated with traditional indicators. Its combination of the Kenji Indicator’s trend identification and the Gauss Indicator’s price prediction capabilities makes it an indispensable tool for traders looking to enhance both the precision of their trades and the automation of their strategies. Whether you are aiming for consistent daily profits or optimizing long-term trading strategies, Gauss KenJi offers the efficiency and accuracy required to stay ahead in today’s competitive markets.
Spazz MSiThis innovative adaptation of the Enhanced McClellan Summation Index (MSI) incorporates advanced statistical analysis to refine its market interpretation capabilities. The core enhancement involves the integration of a Z-score calculation, which is applied to a user-selectable price data series (open, high, low, close, or their derivatives).
Key modifications and improvements include:
1. Flexible Data Input: The indicator now allows for the selection of various price points or their combinations (e.g., OHLC4, HLC3) as the basis for the MSI calculation, enhancing its adaptability to different trading strategies and market conditions.
2. Z-Score Integration: By incorporating a Z-score metric, the indicator provides a standardized measure of the price series' deviation from its mean. This statistical approach offers a more nuanced view of market extremes.
3. Dynamic Overbought/Oversold Identification: The Z-score implementation enables a more sophisticated method for identifying overbought and oversold conditions. These states are now determined relative to the asset's own historical volatility, rather than fixed thresholds.
4. Automated Signal Generation: The indicator now features an algorithmic approach to generate buy and sell signals. These signals are triggered when specific Z-score thresholds are breached, offering traders clear, statistically-backed entry and exit points.
5. Visual Enhancements: The addition of graphical elements, such as color-coded plots and shape markers, improves the indicator's visual interpretability, allowing for quicker and more intuitive market analysis.
This enhanced version of the McClellan Summation Index combines the robust trend-following capabilities of the original MSI with the precision of statistical analysis. By doing so, it provides traders with a more refined tool for market timing and trend identification, particularly useful in volatile or transitioning market conditions.
ATR Movement Percentage from Daily (Bal)Script Description: ATR Movement Percentage from Daily
The script titled "ATR Movement Percentage from Daily" is designed to help traders analyze the price movement of an asset in relation to its daily volatility, as represented by the Average True Range (ATR). Here's a breakdown of how the script works:
Key Features of the Script:
ATR Calculation:
The script allows the user to input the length of the ATR calculation (default is 14 periods).
It retrieves the daily ATR value using the request.security function, ensuring that the ATR is based on the daily timeframe, regardless of the current chart's timeframe.
Price Movement Calculation:
It calculates the opening price of the current day using request.security to ensure it is aligned with the daily timeframe.
It retrieves the current closing price and computes the price change from the opening price.
Movement Percentage:
The percentage of price movement relative to the daily ATR is calculated. This value helps traders understand how significant the current price movement is compared to the expected volatility for the day.
Direction of Movement:
The script determines the direction of the price movement (upward or downward) based on whether the price change is positive or negative.
Dynamic Label Display:
A label is created and updated to show the movement percentage and direction on the chart.
If the price movement is upward, the label is displayed in green; if downward, it is shown in red.
The label position updates with each new bar, keeping it relevant to the current price action.
Plotting Daily ATR:
The daily ATR value is plotted on the chart as a blue line, providing a visual reference for traders to see the volatility levels in relation to price movements.
Conclusion:
This script is particularly useful for traders who want to assess market conditions based on volatility. By understanding how much the price has moved in relation to the daily ATR, traders can make informed decisions about entry and exit points, and adjust their risk management strategies accordingly. The dynamic labeling feature enhances the usability of the script, allowing for quick visual assessments of market behavior.
High and Low in Selected Time Window (Chart's Timezone)Simple indicator for finding the high and low in any selected time period. to use enter the start time by selecting the hour and minute and enter the end time the same.
a line will be drawn along with the price and a timestamp of when it occurred. shows multiple days of the same time period. Useful for observing ICT Macros, 6VS10 etc.
Multi-Assets Monthly/Weekly/Daily/ Rate Multi-Assets Rate Indicator
This indicator provides a comprehensive view of performance across multiple asset classes, including Forex pairs, Indices, Commodities, and Cryptocurrencies. It offers the following features:
1. Asset Type Selection: Users can choose between "FOREX" and "Other Assets" to view different sets of instruments.
2. Timeframe Flexibility: Performance can be analyzed on Weekly, Daily, or Monthly timeframes.
3. Performance Metrics:
- Current Period Performance: Percentage change in the selected timeframe.
- Previous Period Performance: Percentage change in the previous period.
- Rate of Change: Difference between current and previous period performances.
4. Visual Representation: Results are displayed in a color-coded table for easy interpretation.
- Green indicates positive performance
- Red indicates negative performance
5. Customizable Symbols: Users can input their preferred symbols for each category.
6. Categorized View: When "Other Assets" is selected, the table is organized into Indices, Commodities, and Cryptocurrencies for better clarity.
This indicator is designed to help traders and investors quickly assess and compare performance across various financial instruments and asset classes. It's particularly useful for identifying trends, comparing relative strengths, and making informed decisions based on multi-timeframe analysis.
Note: This indicator relies on data provided by TradingView. Ensure that you have access to the required data feeds for accurate results.
Disclaimer: This indicator is for informational purposes only and should not be considered as financial advice. Always conduct your own research and consider your financial situation before making investment decisions.
VKPEDIA Trading ZoneDesigned with the help of Traders and with inspiration from the ICT Everything indicator by coldbrewrosh, the purpose of this script is to identify Potential "Trade Entry Zone" while also storing their highs and lows for future reference, until traded through.
There are One session whose times and labels can all be changed to one's liking. Some prefer slight alterations to traditional ICT Killzones, or use different time windows altogether. Either way, the session are fully customizable. The sessions will auto fit to keep track of the highs and lows made during their respective times, and these pivots will be extended until they are invalidated.
What can you learn and understand from this indicator is
1. You can clearly see where high potential trade and reversal of the market are happening and this general sessions are included with london and new york session are refered as "TEZ".
2. Once you apply this indicator on your chart High and low are automatically mentioned in charts for your future reference.
Given the amount of interest I've received about this indicator, I intend to leave it open to suggestions for further improvements. Let me know what you think & what you want to see added
PRINT_DROVINGLibrary "PRINT_DROVING"
method print_droving(foot_bar, sup)
printing all footprint objects
Namespace types: footprint_type.Footprint_bar
Parameters:
foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
Returns: Void.
PRINT_LOGICLibrary "PRINT_LOGIC"
method fill_imba_line(imba_line, foot_bar, sup)
fill imbalance line
Namespace types: footprint_type.Imbalance_line
Parameters:
imba_line (Imbalance_line type from Alesetup/PRINT_TYPE/1) : instance of Imbalance_line type
foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
Returns: Void
method fill_footprint_type(foot_bar, sup)
Namespace types: footprint_type.Footprint_bar
Parameters:
foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
Returns: Void
method fill_footprint_object(foot_bar, sup)
fill all footprint objects
Namespace types: footprint_type.Footprint_bar
Parameters:
foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
Returns: Void
PRINT_TYPELibrary "PRINT_TYPE"
Inputs
Inputs objects
Fields:
inbalance_percent (series int) : percentage coefficient to determine the Imbalance of price levels
stacked_input (series int) : minimum number of consecutive Imbalance levels required to draw extended lines
show_summary_footprint (series bool)
procent_volume_area (series int) : definition size Value area
new_imbalance_cond (series bool) : bool input for setup alert on new imbalance buy and sell
new_imbalance_line_cond (series bool) : bool input for setup alert on new imbalance line buy and sell
stop_past_imbalance_line_cond (series bool) : bool input for setup alert on stop past imbalance line buy and sell
Constants
Constants all Constants objects
Fields:
imbalance_high_char (series string) : char for printing buy imbalance
imbalance_low_char (series string) : char for printing sell imbalance
color_title_sell (series color) : color for footprint sell
color_title_buy (series color) : color for footprint buy
color_line_sell (series color) : color for sell line
color_line_buy (series color) : color for buy line
color_title_none (series color) : color None
Calculation_data
Calculation_data data for calculating
Fields:
detail_open (array) : array open from calculation timeframe
detail_high (array) : array high from calculation timeframe
detail_low (array) : array low from calculation timeframe
detail_close (array) : array close from calculation timeframe
detail_vol (array) : array volume from calculation timeframe
previos_detail_close (array) : array close from calculation timeframe
isBuyVolume (series bool) : attribute previosly bar buy or sell
Footprint_row
Footprint_row objects one footprint row
Fields:
price (series float) : row price
buy_vol (series float) : buy volume
sell_vol (series float) : sell volume
imbalance_buy (series bool) : attribute buy inbalance
imbalance_sell (series bool) : attribute sell imbalance
buy_vol_box (series box) : for ptinting buy volume
sell_vol_box (series box) : for printing sell volume
buy_vp_box (series box) : for ptinting volume profile buy
sell_vp_box (series box) : for ptinting volume profile sell
row_line (series label) : for ptinting row price
empty (series bool) : = true attribute row with zero volume buy and zero volume sell
Imbalance_line_var_object
Imbalance_line_var_object var objects printing and calculation imbalance line
Fields:
cum_buy_line (array) : line array for saving all history buy imbalance line
cum_sell_line (array) : line array for saving all history sell imbalance line
Imbalance_line
Imbalance_line objects printing and calculation imbalance line
Fields:
buy_price_line (array) : float array for saving buy imbalance price level
sell_price_line (array) : float array for saving sell imbalance price level
var_imba_line (Imbalance_line_var_object) : var objects this type
Footprint_bar
Footprint_bar all objects one bar with footprint
Fields:
foot_rows (array) : objects one row footprint
imba_line (Imbalance_line) : objects imbalance line
row_size (series float) : size rows
total_vol (series float) : total volume one footprint bar
foot_buy_vol (series float) : buy volume one footprint bar
foot_sell_vol (series float) : sell volume one footprint bar
foot_max_price_vol (map) : map with one value - price row with max volume buy + sell
calc_data (Calculation_data) : objects with detail data from calculation resolution
Support_objects
Support_objects support object for footprint calculation
Fields:
consts (Constants) : all consts objects
inp (Inputs) : all input objects
bar_index_show_condition (series bool) : calculation bool value for show all objects footprint
row_line_color (series color) : calculation value - color for row price
dop_info (series string)
show_table_cond (series bool)