AutoCorrelation Test [OmegaTools]Overview
The AutoCorrelation Test indicator is designed to analyze the correlation patterns of a financial asset over a specified period. This tool can help traders identify potential predictive patterns by measuring the relationship between sequential returns, effectively assessing the autocorrelation of price movements.
Autocorrelation analysis is useful in identifying the consistency of directional trends (upward or downward) and potential cyclical behavior. This indicator provides an insight into whether recent price movements are likely to continue in a similar direction (positive correlation) or reverse (negative correlation).
Key Features
Multi-Period Autocorrelation: The indicator calculates autocorrelation across three periods, offering a granular view of price movement consistency over time.
Customizable Length & Sensitivity: Adjustable parameters allow users to tailor the length of analysis and sensitivity for detecting correlation.
Visual Aids: Three separate autocorrelation plots are displayed, along with an average correlation line. Dotted horizontal lines mark the thresholds for positive and negative correlation, helping users quickly assess potential trend continuation or reversal.
Interpretive Table: A table summarizing correlation status for each period helps traders make quick, informed decisions without needing to interpret the plot details directly.
Parameters
Source: Defines the price source (default: close) for calculating autocorrelation.
Length: Sets the analysis period, ranging from 10 to 2000 (default: 200).
Sensitivity: Adjusts the threshold sensitivity for defining correlation as positive or negative (default: 2.5).
Interpretation
Above 50 + Sensitivity: Indicates Positive Correlation. The price movements over the selected period are likely to continue in the same direction, potentially signaling a trend continuation.
Below 50 - Sensitivity: Indicates Negative Correlation. The price movements show a likelihood of reversing, which could signal an upcoming trend reversal.
Between 50 ± Sensitivity: Indicates No Correlation. Price movements are less predictable in direction, with no clear trend continuation or reversal tendency.
How It Works
The indicator calculates the logarithmic returns of the selected source price over each length period.
It then compares returns over consecutive periods, categorizing them as either "winning" (consistent direction) or "losing" (inconsistent direction) movements.
The result for each period is displayed as a percentage, with values above 50% indicating a higher degree of directional consistency (positive or negative).
A table updates with descriptive labels (Positive Correlation, Negative Correlation, No Correlation) for each tested period, providing a quick overview.
Visual Elements
Plots:
AutoCorrelation Test : Displays autocorrelation for the closest period (lag 1).
AutoCorrelation Test : Displays autocorrelation for the second period (lag 2).
AutoCorrelation Test : Displays autocorrelation for the third period (lag 3).
Average: Displays the simple moving average of the three test periods for a smoothed view of overall correlation trends.
Horizontal Lines:
No Correlation (50%): A baseline indicating neutral correlation.
Positive/Negative Correlation Thresholds: Dotted lines set at 50 ± Sensitivity, marking the thresholds for significant correlation.
Usage Guide
Adjust Parameters:
Select the Source to define which price metric (e.g., close, open) will be analyzed.
Set the Length based on your preferred analysis window (e.g., shorter for intraday trends, longer for swing trading).
Modify Sensitivity to fine-tune the thresholds based on market volatility and personal trading preference.
Interpret Table and Plots:
Use the table to quickly check the correlation status of each lag period.
Analyze the plots for changes in correlation. If multiple lags show positive correlation above the sensitivity threshold, a trend continuation may be expected. Conversely, negative values suggest a potential reversal.
Integrate with Other Indicators:
For enhanced insights, consider using the AutoCorrelation Test indicator in conjunction with other trend or momentum indicators.
This indicator offers a powerful method to assess market conditions, identify potential trend continuations or reversals, and better inform trading decisions. Its customization options provide flexibility for various trading styles and timeframes.
Statistics
RBF Kijun Trend System [InvestorUnknown]The RBF Kijun Trend System utilizes advanced mathematical techniques, including the Radial Basis Function (RBF) kernel and Kijun-Sen calculations, to provide traders with a smoother trend-following experience and reduce the impact of noise in price data. This indicator also incorporates ATR to dynamically adjust smoothing and further minimize false signals.
Radial Basis Function (RBF) Kernel Smoothing
The RBF kernel is a mathematical method used to smooth the price series. By calculating weights based on the distance between data points, the RBF kernel ensures smoother transitions and a more refined representation of the price trend.
The RBF Kernel Weighted Moving Average is computed using the formula:
f_rbf_kernel(x, xi, sigma) =>
math.exp(-(math.pow(x - xi, 2)) / (2 * math.pow(sigma, 2)))
The smoothed price is then calculated as a weighted sum of past prices, using the RBF kernel weights:
f_rbf_weighted_average(src, kernel_len, sigma) =>
float total_weight = 0.0
float weighted_sum = 0.0
// Compute weights and sum for the weighted average
for i = 0 to kernel_len - 1
weight = f_rbf_kernel(kernel_len - 1, i, sigma)
total_weight := total_weight + weight
weighted_sum := weighted_sum + (src * weight)
// Check to avoid division by zero
total_weight != 0 ? weighted_sum / total_weight : na
Kijun-Sen Calculation
The Kijun-Sen, a component of Ichimoku analysis, is used here to further establish trends. The Kijun-Sen is computed as the average of the highest high and the lowest low over a specified period (default: 14 periods).
This Kijun-Sen calculation is based on the RBF-smoothed price to ensure smoother and more accurate trend detection.
f_kijun_sen(len, source) =>
math.avg(ta.lowest(source, len), ta.highest(source, len))
ATR-Adjusted RBF and Kijun-Sen
To mitigate false signals caused by price volatility, the indicator features ATR-adjusted versions of both the RBF smoothed price and Kijun-Sen.
The ATR multiplier is used to create upper and lower bounds around these lines, providing dynamic thresholds that account for market volatility.
Neutral State and Trend Continuation
This indicator can interpret a neutral state, where the signal is neither bullish nor bearish. By default, the indicator is set to interpret a neutral state as a continuation of the previous trend, though this can be adjusted to treat it as a truly neutral state.
Users can configure this setting using the signal_str input:
simple string signal_str = input.string("Continuation of Previous Trend", "Treat 0 State As", options = , group = G1)
Visual difference between "Neutral" (Bottom) and "Continuation of Previous Trend" (Top). Click on the picture to see it in full size.
Customizable Inputs and Settings:
Source Selection: Choose the input source for calculations (open, high, low, close, etc.).
Kernel Length and Sigma: Adjust the RBF kernel parameters to change the smoothing effect.
Kijun Length: Customize the lookback period for Kijun-Sen.
ATR Length and Multiplier: Modify these settings to adapt to market volatility.
Backtesting and Performance Metrics
The indicator includes a Backtest Mode, allowing users to evaluate the performance of the strategy using historical data. In Backtest Mode, a performance metrics table is generated, comparing the strategy's results to a simple buy-and-hold approach. Key metrics include mean returns, standard deviation, Sharpe ratio, and more.
Equity Calculation: The indicator calculates equity performance based on signals, comparing it against the buy-and-hold strategy.
Performance Metrics Table: Detailed performance analysis, including probabilities of positive, neutral, and negative returns.
Alerts
To keep traders informed, the indicator supports alerts for significant trend shifts:
// - - - - - ALERTS - - - - - //{
alert_source = sig
bool long_alert = ta.crossover (intrabar ? alert_source : alert_source , 0)
bool short_alert = ta.crossunder(intrabar ? alert_source : alert_source , 0)
alertcondition(long_alert, "LONG (RBF Kijun Trend System)", "RBF Kijun Trend System flipped ⬆LONG⬆")
alertcondition(short_alert, "SHORT (RBF Kijun Trend System)", "RBF Kijun Trend System flipped ⬇Short⬇")
//}
Important Notes
Calibration Needed: The default settings provided are not optimized and are intended for demonstration purposes only. Traders should adjust parameters to fit their trading style and market conditions.
Neutral State Interpretation: Users should carefully choose whether to treat the neutral state as a continuation or a separate signal.
Backtest Results: Historical performance is not indicative of future results. Market conditions change, and past trends may not recur.
Dual Momentum StrategyThis Pine Script™ strategy implements the "Dual Momentum" approach developed by Gary Antonacci, as presented in his book Dual Momentum Investing: An Innovative Strategy for Higher Returns with Lower Risk (McGraw Hill Professional, 2014). Dual momentum investing combines relative momentum and absolute momentum to maximize returns while minimizing risk. Relative momentum involves selecting the asset with the highest recent performance between two options (a risky asset and a safe asset), while absolute momentum considers whether the chosen asset has a positive return over a specified lookback period.
In this strategy:
Risky Asset (SPY): Represents a stock index fund, typically more volatile but with higher potential returns.
Safe Asset (TLT): Represents a bond index fund, which generally has lower volatility and acts as a hedge during market downturns.
Monthly Momentum Calculation: The momentum for each asset is calculated based on its price change over the last 12 months. Only assets with a positive momentum (absolute momentum) are considered for investment.
Decision Rules:
Invest in the risky asset if its momentum is positive and greater than that of the safe asset.
If the risky asset’s momentum is negative or lower than the safe asset's, the strategy shifts the allocation to the safe asset.
Scientific Reference
Antonacci's work on dual momentum investing has shown the strategy's ability to outperform traditional buy-and-hold methods while reducing downside risk. This approach has been reviewed and discussed in both academic and investment publications, highlighting its strong risk-adjusted returns (Antonacci, 2014).
Reference: Antonacci, G. (2014). Dual Momentum Investing: An Innovative Strategy for Higher Returns with Lower Risk. McGraw Hill Professional.
MAPE of Expected Value and Percent ResidualsOverview
This indicator calculates and visualizes the Mean Absolute Percentage Error (MAPE) and the percent residuals of the expected value compared to the actual closing price. The purpose of this indicator is to provide insights into the accuracy of price forecasts by comparing predicted values to actual market outcomes. The expected values are derived from the transform model, which uses the mean line from the mean and standard deviation lines as an indicator for expected price movement. Users can customize the number of periods over which calculations are averaged.
Inputs
Mean Period (Bars) : Specifies the number of bars used to calculate the moving average of the change between closing prices. This value should match the value used in the mean and standard deviation lines indicator.
MAPE Period (Bars) : Specifies the number of bars used to calculate the moving average of the absolute percentage error.
Outputs
Percent Residuals Histogram : Displays the percentage error between the predicted (expected) value and the actual closing price. The bars are color-coded, with green indicating positive residuals (i.e., the actual value is higher than the predicted value) and red indicating negative residuals (i.e., the actual value is lower than the predicted value).
Reference Line : A horizontal line at zero is added to the chart to indicate the baseline for percent residuals.
Mean Absolute Percentage Error (MAPE) Line : Plots the moving average of the absolute percentage error over the specified period, helping users gauge the average accuracy of their predictions over time.
Methodology
Calculation of Individual Bar Normalized Residuals: The normalized residuals for each bar are computed by taking the difference between the actual closing price and the predicted (expected) value, divided by the closing price. If the actual closing price is above the expected value, the residual is considered positive and is represented in green; otherwise, it is negative and represented in red. This normalization provides a standardized measure of deviation that allows for consistent comparison across different bars.
Mean Absolute Percentage Error (MAPE) Calculation: Over the user-defined period, the absolute values of the normalized residuals are computed and subsequently averaged to determine the Mean Absolute Percentage Error (MAPE). This metric quantifies the average magnitude of the forecast errors, providing a clear indication of the model's predictive accuracy over time.
How to Use
Add Indicators to Chart : First, apply the mean and standard deviation lines indicator to the chart, then add the MAPE of Expected Value and Percent Residuals indicator to evaluate the accuracy of price forecasts.
Set Parameters : Set the `Mean Period (Bars)` to be the same value in both the mean and standard deviation lines indicator and the MAPE indicator to ensure accuracy. Adjust the `MAPE Period (Bars)` to fine-tune the length of historical data used in calculating the MAPE.
Interpret Residuals and MAPE : Use the percent residuals histogram to understand how the actual closing price deviates from predictions. The MAPE line helps track the average prediction accuracy over time.
This tool is particularly useful for traders who want to evaluate the performance of their price prediction models based on the transform model and track how well their expected values, derived from mean and standard deviation lines , align with actual market movements.
XRP Comparative Price Action Indicator - Final VersionXRP Comparative Price Action Indicator - Final Version
The XRP Comparative Price Action Indicator provides a comprehensive visual analysis of XRP’s price movements relative to key cryptocurrencies and market indices. This indicator normalises price data across various assets, allowing traders and investors to assess XRP’s performance against its peers and major market influences at a glance.
Key Features:
• Normalised Price Data: Prices are scaled between 0.00 and 1.00,
enabling straightforward comparisons between different assets.
• Key Comparisons: Includes normalised prices for:
• XRP/USD (Bitstamp)
• XRP Dominance (CryptoCap)
• XRP/BTC (Bitstamp)
• BTC/USD (Bitstamp)
• BTC Dominance (CryptoCap)
• USDT Dominance (CryptoCap)
• S&P 500 (SPY)
• DXY (Dollar Index)
• ETH/USD (Bitstamp)
• ETH Dominance (CryptoCap)
• XRP/ETH (Binance)
• Visual Clarity: Each asset is plotted with distinct colors for easy identification,
with thicker lines enhancing visibility on the chart.
• Reference Lines: Optional horizontal lines indicate the minimum (0) and maximum (1) normalised values, providing clear reference points for analysis.
This indicator is ideal for traders looking to understand XRP’s relative performance, gauge market sentiment, and make informed trading decisions based on comparative price action.
Autocorrelogram (YavuzAkbay)The Autocorrelogram (ACF) is a statistical tool designed for traders and analysts to evaluate the autocorrelation of price movements over time. Autocorrelation measures the correlation of a signal with a delayed version of itself, providing insights into the degree to which past price movements influence future price movements. This indicator is particularly useful for identifying trends and patterns in time series data, helping traders make informed decisions based on historical price behavior.
Key Components and Functionality
1. Input Parameters:
Sample Size: This parameter defines the number of data points used in the calculation of the autocorrelation function. A minimum value of 9 ensures statistical relevance. The default value is set to 100, which provides a broad view of the price behavior.
Data Source: Users can select the price data they wish to analyze (e.g., closing prices). This flexibility allows traders to apply the ACF to various price types, depending on their trading strategy.
Significance Level: This parameter determines the threshold for statistical significance in the autocorrelation values. The default value is set at 1.96, corresponding to a 95% confidence level, but users can adjust it to their preferences.
Calculate Change: This boolean option allows users to choose whether to calculate the change in the selected data source (e.g., daily price changes) rather than using the raw data. Analyzing changes can highlight momentum shifts that may be obscured in absolute price levels.
2. Core Calculations:
Simple Moving Average (SMA): The indicator computes the SMA of the selected data source over the defined sample size. This average serves as a baseline for assessing deviations in price behavior.
Variance Calculation: The variance of the price changes is calculated to understand the spread of the data. The variance is scaled by the sample size to ensure that the autocorrelation values are appropriately normalized.
Lag Value: The indicator calculates a lag value based on the sample size to determine how many periods back the autocorrelation will be calculated. This helps in assessing correlations at different time intervals.
3. Autocorrelation Calculation:
The script calculates the autocorrelation for lags ranging from 0 to 53. For each lag, it computes the autocovariance (the correlation of the signal with itself at different time intervals) and normalizes this by the variance. The result is a set of autocorrelation values that indicate the strength and direction of the relationship between current and past price movements.
4. Visualization:
The autocorrelation values are plotted as lines on the chart, with different colors indicating positive and negative correlations. Lines are dynamically drawn for each lag, providing a visual representation of how past prices influence current prices. A maximum of 54 lines (for lags 0 to 53) is maintained, with the oldest line being removed when the limit is exceeded.
Significance Levels: Horizontal lines are drawn at the defined significance levels, helping traders quickly identify when the autocorrelation values exceed the statistically significant threshold. These lines serve as benchmarks for interpreting the relevance of the autocorrelation values.
How to Use the ACF Indicator
Identifying Trends: Traders can use the ACF indicator to spot trends in the data. Strong positive autocorrelation at a given lag indicates that past price movements have a lasting influence on future movements, suggesting a potential continuation of the current trend. Conversely, significant negative autocorrelation may indicate reversals or mean reversion.
Decision Making: By comparing the autocorrelation values against the significance levels, traders can make informed decisions. For example, if the autocorrelation at lag 1 is significantly positive, it may suggest that a trend is likely to persist in the immediate future, prompting traders to consider long positions.
Setting Parameters: Adjusting the sample size and significance level allows traders to tailor the indicator to their specific market conditions and trading style. A larger sample size may provide more stable estimates but could obscure short-term fluctuations, while a smaller size may capture quick changes but with higher variability.
Combining with Other Indicators: The ACF can be used in conjunction with other technical indicators (like Moving Averages or RSI) to enhance trading strategies. Confirming signals from multiple indicators can provide stronger trade confirmations.
Vertical Line on Custom DateThis Pine Script code creates a custom indicator for TradingView that draws a vertical line on the chart at a specific date and time defined by the user.
User Input: Allows the user to specify the day, hour, and minute when the vertical line should appear.
Vertical Line Drawing: When the current date and time match the user’s inputs, a vertical line is drawn on the chart at the corresponding bar, offset by one bar to align properly.
Customizable Color and Width: The vertical line is displayed in purple with a customizable width.
Overall, this indicator helps traders visually mark important dates and times on their price charts.
Power Root SuperTrend [AlgoAlpha]📈🚀 Power Root SuperTrend by AlgoAlpha - Elevate Your Trading Strategy! 🌟
Introducing the Power Root SuperTrend by AlgoAlpha, an advanced trading indicator that enhances the traditional SuperTrend by incorporating Root-Mean-Square (RMS) calculations for a more responsive and adaptive trend detection. This innovative tool is designed to help traders identify trend directions, potential take-profit levels, and optimize entry and exit points with greater accuracy, making it an excellent addition to your trading arsenal.
Key Features:
🔹 Root-Mean-Square SuperTrend Calculation : Utilizes the RMS of closing prices to create a smoother and more sensitive SuperTrend line that adapts quickly to market changes.
🔸 Multiple Take-Profit Levels : Automatically calculates and plots up to seven take-profit levels (TP1 to TP7) based on market volatility and the change in SuperTrend values.
🟢 Dynamic Trend Coloring : Visually distinguish between bullish and bearish trends with customizable colors for clearer market visualization.
📊 RSI-Based Take-Profit Signals : Incorporates the Relative Strength Index (RSI) of the distance between the price and the SuperTrend line to generate additional take-profit signals.
🔔 Customizable Alerts : Set alerts for trend direction changes, achievement of take-profit levels, and RSI-based take-profit conditions to stay informed without constant chart monitoring.
How to Use:
Add the Indicator : Add the indicator to favorites by pressing the ⭐ icon or search for "Power Root SuperTrend " in the TradingView indicators library and add it to your chart. Adjust parameters such as the ATR multiplier, ATR length, RMS length, and RSI take-profit length to suit your trading style and the specific asset you are analyzing.
Analyze the Chart : Observe the SuperTrend line and the plotted take-profit levels. The color changes indicate trend directions—green for bullish and red for bearish trends.
Set Alerts : Utilize the built-in alert conditions to receive notifications when the trend direction changes, when each TP level is drawn, or when RSI-based take-profit conditions are met.
How It Works:
The Power Root SuperTrend indicator enhances traditional SuperTrend calculations by applying a Root-Mean-Square (RMS) function to the closing prices, resulting in a more responsive trend line that better reflects recent price movements. It calculates the Average True Range (ATR) to determine the volatility and sets the upper and lower SuperTrend bands accordingly. When a trend direction change is detected—signified by the SuperTrend line switching from above to below the price or vice versa—the indicator calculates the change in the SuperTrend value. This change is then used to establish multiple take-profit levels (TP1 to TP7), each representing incremental targets based on market volatility. Additionally, the indicator computes the RSI of the distance between the current price and the SuperTrend line to generate extra take-profit signals when the RSI crosses under a specific threshold. The combination of RMS calculations, multiple TP levels, dynamic coloring, and RSI signals provides traders with a comprehensive tool for identifying trends and optimizing trade exits. Customizable alerts ensure that traders can stay updated on important market developments without needing to constantly watch the charts.
Elevate your trading strategy with the Power Root SuperTrend indicator and gain a smarter edge in the markets! 🚀✨
S&P 100 Option Expiration Week StrategyThe Option Expiration Week Strategy aims to capitalize on increased volatility and trading volume that often occur during the week leading up to the expiration of options on stocks in the S&P 100 index. This period, known as the option expiration week, culminates on the third Friday of each month when stock options typically expire in the U.S. During this week, investors in this strategy take a long position in S&P 100 stocks or an equivalent ETF from the Monday preceding the third Friday, holding until Friday. The strategy capitalizes on potential upward price pressures caused by increased option-related trading activity, rebalancing, and hedging practices.
The phenomenon leveraged by this strategy is well-documented in finance literature. Studies demonstrate that options expiration dates have a significant impact on stock returns, trading volume, and volatility. This effect is driven by various market dynamics, including portfolio rebalancing, delta hedging by option market makers, and the unwinding of positions by institutional investors (Stoll & Whaley, 1987; Ni, Pearson, & Poteshman, 2005). These market activities intensify near option expiration, causing price adjustments that may create short-term profitable opportunities for those aware of these patterns (Roll, Schwartz, & Subrahmanyam, 2009).
The paper by Johnson and So (2013), Returns and Option Activity over the Option-Expiration Week for S&P 100 Stocks, provides empirical evidence supporting this strategy. The study analyzes the impact of option expiration on S&P 100 stocks, showing that these stocks tend to exhibit abnormal returns and increased volume during the expiration week. The authors attribute these patterns to intensified option trading activity, where demand for hedging and arbitrage around options expiration causes temporary price adjustments.
Scientific Explanation
Research has found that option expiration weeks are marked by predictable increases in stock returns and volatility, largely due to the role of options market makers and institutional investors. Option market makers often use delta hedging to manage exposure, which requires frequent buying or selling of the underlying stock to maintain a hedged position. As expiration approaches, their activity can amplify price fluctuations. Additionally, institutional investors often roll over or unwind positions during expiration weeks, creating further demand for underlying stocks (Stoll & Whaley, 1987). This increased demand around expiration week typically leads to temporary stock price increases, offering profitable opportunities for short-term strategies.
Key Research and Bibliography
Johnson, T. C., & So, E. C. (2013). Returns and Option Activity over the Option-Expiration Week for S&P 100 Stocks. Journal of Banking and Finance, 37(11), 4226-4240.
This study specifically examines the S&P 100 stocks and demonstrates that option expiration weeks are associated with abnormal returns and trading volume due to increased activity in the options market.
Stoll, H. R., & Whaley, R. E. (1987). Program Trading and Expiration-Day Effects. Financial Analysts Journal, 43(2), 16-28.
Stoll and Whaley analyze how program trading and portfolio insurance strategies around expiration days impact stock prices, leading to temporary volatility and increased trading volume.
Ni, S. X., Pearson, N. D., & Poteshman, A. M. (2005). Stock Price Clustering on Option Expiration Dates. Journal of Financial Economics, 78(1), 49-87.
This paper investigates how option expiration dates affect stock price clustering and volume, driven by delta hedging and other option-related trading activities.
Roll, R., Schwartz, E., & Subrahmanyam, A. (2009). Options Trading Activity and Firm Valuation. Journal of Financial Markets, 12(3), 519-534.
The authors explore how options trading activity influences firm valuation, finding that higher options volume around expiration dates can lead to temporary price movements in underlying stocks.
Cao, C., & Wei, J. (2010). Option Market Liquidity and Stock Return Volatility. Journal of Financial and Quantitative Analysis, 45(2), 481-507.
This study examines the relationship between options market liquidity and stock return volatility, finding that increased liquidity needs during expiration weeks can heighten volatility, impacting stock returns.
Summary
The Option Expiration Week Strategy utilizes well-researched financial market phenomena related to option expiration. By positioning long in S&P 100 stocks or ETFs during this period, traders can potentially capture abnormal returns driven by option market dynamics. The literature suggests that options-related activities—such as delta hedging, position rollovers, and portfolio adjustments—intensify demand for underlying assets, creating short-term profit opportunities around these key dates.
Payday Anomaly StrategyThe "Payday Effect" refers to a predictable anomaly in financial markets where stock returns exhibit significant fluctuations around specific pay periods. Typically, these are associated with the beginning, middle, or end of the month when many investors receive wages and salaries. This influx of funds, often directed automatically into retirement accounts or investment portfolios (such as 401(k) plans in the United States), temporarily increases the demand for equities. This phenomenon has been linked to a cycle where stock prices rise disproportionately on and around payday periods due to increased buy-side liquidity.
Academic research on the payday effect suggests that this pattern is tied to systematic cash flows into financial markets, primarily driven by employee retirement and savings plans. The regularity of these cash infusions creates a calendar-based pattern that can be exploited in trading strategies. Studies show that returns on days around typical payroll dates tend to be above average, and this pattern remains observable across various time periods and regions.
The rationale behind the payday effect is rooted in the behavioral tendencies of investors, specifically the automatic reinvestment mechanisms used in retirement funds, which align with monthly or semi-monthly salary payments. This regular injection of funds can cause market microstructure effects where stock prices temporarily increase, only to stabilize or reverse after the funds have been invested. Consequently, the payday effect provides traders with a potentially profitable opportunity by predicting these inflows.
Scientific Bibliography on the Payday Effect
Ma, A., & Pratt, W. R. (2017). Payday Anomaly: The Market Impact of Semi-Monthly Pay Periods. Social Science Research Network (SSRN).
This study provides a comprehensive analysis of the payday effect, exploring how returns tend to peak around payroll periods due to semi-monthly cash flows. The paper discusses how systematic inflows impact returns, leading to predictable stock performance patterns on specific days of the month.
Lakonishok, J., & Smidt, S. (1988). Are Seasonal Anomalies Real? A Ninety-Year Perspective. The Review of Financial Studies, 1(4), 403-425.
This foundational study explores calendar anomalies, including the payday effect. By examining data over nearly a century, the authors establish a framework for understanding seasonal and monthly patterns in stock returns, which provides historical support for the payday effect.
Owen, S., & Rabinovitch, R. (1983). On the Predictability of Common Stock Returns: A Step Beyond the Random Walk Hypothesis. Journal of Business Finance & Accounting, 10(3), 379-396.
This paper investigates predictability in stock returns beyond random fluctuations. It considers payday effects among various calendar anomalies, arguing that certain dates yield predictable returns due to regular cash inflows.
Loughran, T., & Schultz, P. (2005). Liquidity: Urban versus Rural Firms. Journal of Financial Economics, 78(2), 341-374.
While primarily focused on liquidity, this study provides insight into how cash flows, such as those from semi-monthly paychecks, influence liquidity levels and consequently impact stock prices around predictable pay dates.
Ariel, R. A. (1990). High Stock Returns Before Holidays: Existence and Evidence on Possible Causes. The Journal of Finance, 45(5), 1611-1626.
Ariel’s work highlights stock return patterns tied to certain dates, including paydays. Although the study focuses on pre-holiday returns, it suggests broader implications of predictable investment timing, reinforcing the calendar-based effects seen with payday anomalies.
Summary
Research on the payday effect highlights a repeating pattern in stock market returns driven by scheduled payroll investments. This cyclical increase in stock demand aligns with behavioral finance insights and market microstructure theories, offering a valuable basis for trading strategies focused on the beginning, middle, and end of each month.
Economic Profit (YavuzAkbay)The Economic Profit Indicator is a Pine Script™ tool for assessing a company’s economic profit based on key financial metrics like Return on Invested Capital (ROIC) and Weighted Average Cost of Capital (WACC). This indicator is designed to give traders a more accurate understanding of risk-adjusted returns.
Features
Customizable inputs for Risk-Free Rate and Corporate Tax Rate assets for people who are trading in other countries.
Calculates Economic Profit based on ROIC and WACC, with values shown as both plots and in an on-screen table.
Provides detailed breakdowns of all key calculations, enabling deeper insights into financial performance.
How to Use
Open the stock to be analyzed. In the settings, enter the risk-free asset (usually a 10-year bond) of the country where the company to be analyzed is located. Then enter the corporate tax of the country (USCTR for the USA, DECTR for Germany). Then enter the average return of the index the stock is in. I prefer 10% (0.10) for the SP500, different rates can be entered for different indices. Finally, the beta of the stock is entered. In future versions I will automatically pull beta and index returns, but in order to publish the indicator a bit earlier, I have left it entirely up to the investor.
How to Interpret
We see 3 pieces of data on the indicator. The dark blue one is ROIC, the dark orange one is WACC and the light blue line represents the difference between WACC and ROIC.
In a scenario where both ROIC and WACC are negative, if ROIC is lower than WACC, the share is at a complete economic loss.
In a scenario where both ROIC and WACC are negative, if ROIC has started to rise above WACC and is moving towards positive, the share is still in an economic loss but tending towards profit.
A scenario where ROIC is positive and WACC is negative is the most natural scenario for a company. In this scenario, we know that the company is doing well by a gradually increasing ROIC and a stable WACC.
In addition, if the ROIC and WACC difference line goes above 0, the company is now economically in net profit. This is the best scenario for a company.
My own investment strategy as a developer of the code is to look for the moment when ROIC is greater than WACC when ROIC and WACC are negative. At that point the stock is the best time to invest.
Trading is risky, and most traders lose money. The indicators Yavuz Akbay offers are for informational and educational purposes only. All content should be considered hypothetical, selected after the facts to demonstrate my product, and not constructed as financial advice. Decisions to buy, sell, hold, or trade in securities, commodities, and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
This indicator is experimental and will always remain experimental. The indicator will be updated by Yavuz Akbay according to market conditions.
Customizable BTC Seasonality StrategyThis strategy leverages intraday seasonality effects in Bitcoin, specifically targeting hours of statistically significant returns during periods when traditional financial markets are closed. Padysak and Vojtko (2022) demonstrate that Bitcoin exhibits higher-than-average returns from 21:00 UTC to 23:00 UTC, a period in which all major global exchanges, such as the New York Stock Exchange (NYSE), Tokyo Stock Exchange, and London Stock Exchange, are closed. The absence of competing trading activity from traditional markets during these hours appears to contribute to these statistically significant returns.
The strategy proceeds as follows:
Entry Time: A long position in Bitcoin is opened at a user-specified time, which defaults to 21:00 UTC, aligning with the beginning of the identified high-return window.
Holding Period: The position is held for two hours, capturing the positive returns typically observed during this period.
Exit Time: The position is closed at a user-defined time, defaulting to 23:00 UTC, allowing the strategy to exit as the favorable period concludes.
This simple seasonality strategy aims to achieve a 33% annualized return with a notably reduced volatility of 20.93% and maximum drawdown of -22.45%. The results suggest that investing only during these high-return hours is more stable and less risky than a passive holding strategy (Padysak & Vojtko, 2022).
References
Padysak, M., & Vojtko, R. (2022). Seasonality, Trend-following, and Mean reversion in Bitcoin.
Mean Trend OscillatorMean Trend Oscillator
The Mean Trend Oscillator offers an original approach to trend analysis by integrating multiple technical indicators, using statistic to get a probable signal, and dynamically adapting to market volatility.
This tool aggregates signals from four popular indicators—Relative Strength Index (RSI), Simple Moving Average (SMA), Exponential Moving Average (EMA), and Relative Moving Average (RMA)—and adjusts thresholds using the Average True Range (ATR). By using this, we can use Statistics to aggregate or take the average of each indicators signal. Mathematically, Taking an average of these indicators gives us a better probability on entering a trending state.
By consolidating these distinct perspectives, the Mean Trend Oscillator provides a comprehensive view of market direction, helping traders make informed decisions based on a broad, data-driven trend assessment. Traders can use this indicator to enter long spot or leveraged positions. The Mean Trend Oscillator is intended to be use in long term trending markets. Scalping MUST NOT be used with this indicator. (This indicator will give false signals when the Timeframe is too low. The best intended use for high-quality signals are longer timeframes).
The current price of a beginning trend series may tell us something about the next move. Thus, the Mean Trend Oscillator allows us to spot a high probability trending market and potentially exploit this information enter long or shorts strategy. (again, this indicator will give false signals when the Timeframe is too low. The best intended use for high-quality signals are longer timeframes).
Concept and Calculation and Inputs
The Mean Trend Oscillator calculates a “net trend” score as follows:
RSI evaluates market momentum, identifying overbought and oversold conditions, essential for confirming trend direction.
SMA, EMA, and RMA introduce varied smoothing methods to capture short- to medium-term trends, balancing quick price changes with smoothed averages.
ATR-Enhanced Thresholds: ATR is used as a dynamic multiplier, adjusting each indicator’s thresholds to current volatility levels, which helps reduce noise in low-volatility conditions and emphasizes significant signals when volatility spikes.
Length could be used to adjust how quickly each indicator can more or how slower each indicator can be.
Time Coherency for Inputs: Each indicator must be calculated where each signal is relatively around the same area.
For example:
Simply:
SMA, RMA, EMA, and RSI enters long around each intended trend period. Doesn't have to be perfect, but the indicators all enter long around there.
Each indicator contributes a score (+1 for bullish and -1 for bearish), and these scores are averaged to generate the final trend score:
A positive score, shown as a green line, suggests bullish conditions.
A negative score, indicated by a red line, signifies bearish conditions.
Thus, giving us a signal to long or short.
How to Use the Mean Trend Oscillator
This indicator’s output is straightforward and can fit into various trading strategies:
Bullish Signal: A green line shows that the trend is bullish, based on a positive average score across the indicators, signaling a consideration of longing an asset.
Bearish Signal: A red line indicates bearish conditions, with an overall negative trend score, signaling a consideration to shorting an asset.
By aggregating these indicators, the Mean Trend Oscillator helps traders identify strong trends while filtering out minor fluctuations, making it a versatile tool for both short- and long-term analysis. This multi-layered, adaptive approach to trend detection sets it apart from traditional single-indicator trend tools.
Performance Summary and Shading (Offset Version)Modified "Recession and Crisis Shading" Indicator by @haribotagada (Original Link: )
The updated indicator accepts a days offset (positive or negative) to calculate performance between the offset date and the input date.
Potential uses include identifying performance one week after company earnings or an FOMC meeting.
This feature simplifies input by enabling standardized offset dates, while still allowing flexibility to adjust ranges by overriding inputs as needed.
Summary of added features and indicator notes:
Inputs both positive and negative offset.
By default, the script calculates performance from the close of the input date to the close of the date at (input date + offset) for positive offsets, and from the close of (input date - offset) to the close of the input date for negative offsets. For example, with an input date of November 1, 2024, an offset of 7 calculates performance from the close on November 1 to the close on November 8, while an offset of -7 calculates from the close on October 25 to the close on November 1.
Allows user to perform the calculation using the open price on the input date instead of close price
The input format has been modified to allow overrides for the default duration, while retaining the original capabilities of the indicator.
The calculation shows both the average change and the average annualized change. For bar-wise calculations, annualization assumes 252 trading days per year. For date-wise calculations, it assumes 365 days for annualization.
Carries over all previous inputs to retain functionality of the previous script. Changes a few small settings:
Calculates start to end date performance by default instead of peak to trough performance.
Updates visuals of label text to make it easier to read and less transparent.
Changed stat box color scheme to make the text easier to read
Updated default input data to new format of input with offsets
Changed default duration statistic to number of days instead of number of bars with an option to select number of bars.
Potential Features to Add:
Import dataset from CSV files or by plugging into TradingView calendar
Example Input Datasets:
Recessions:
2020-02-01,COVID-19,59
2007-12-01,Subprime mortgages,547
2001-03-01,Dot-com,243
1990-07-01,Oil shock,243
1981-07-01,US unemployment,788
1980-01-01,Volker,182
1973-11-01,OPEC,485
Japan Revolving Door Elections
2006-09-26, Shinzo Abe
2007-09-26, Yasuo Fukuda
2008-09-24, Taro Aso
2009-09-16, Yukio Hatoyama
2010-07-08, Naoto Kan
2011-09-02, Yoshihiko Noda
Hope you find the modified indicator useful and let me know if you would like any features to be added!
Volume StatsDescription:
Volume Stats displays volume data and statistics for every day of the year, and is designed to work on "1D" timeframe. The data is displayed in a table with columns being months of the year, and rows being days of each month. By default, latest data is displayed, but you have an option to switch to data of the previous year as well.
The statistics displayed for each day is:
- volume
- % of total yearly volume
- % of total monthly volume
The statistics displayed for each column (month) is:
- monthly volume
- % of total yearly volume
- sentiment (was there more bullish or bearish volume?)
- min volume (on which day of the month was the min volume)
- max volume (on which day of the month was the max volume)
The cells change their colors depending on whether the volume is bullish or bearish, and what % of total volume the current cell has (either yearly or monthly). The header cells also change their color (based either on sentiment or what % of yearly volume the current month has).
This is the first (and free) version of the indicator, and I'm planning to create a "PRO" version of this indicator in future.
Parameters:
- Timezone
- Cell data -> which data to display in the cells (no data, volume or percentage)
- Highlight min and max volume -> if checked, cells with min and max volume (either monthly or yearly) will be highlighted with a dot or letter (depending on the "Cell data" input)
- Cell stats mode -> which data to use for color and % calculation (All data = yearly, Column = monthly)
- Display data from previous year -> if checked, the data from previous year will be used
- Header color is calculated from -> either sentiment or % of the yearly volume
- Reverse theme -> the table colors are automatically changed based on the "Dark mode" of Tradingview, this checkbox reverses the logic (so that darker colors will be used when "Dark mode" is off, and lighter colors when it's on)
- Hide logo -> hides the cat logo (PLEASE DO NOT HIDE THE CAT)
Conclusion:
Let me know what you think of the indicator. As I said, I'm planning to make a PRO version with more features, for which I already have some ideas, but if you have any suggestions, please let me know.
Presidential Election Day Projection
This indicator analyzes historical price movements during US Presidential elections from 1972-2020. It provides projected price levels based on normalized percentage moves from the daily open, helping traders understand potential price action on the election day.
Features
Analyzes election day candles from 1972-2020
Filters by Democratic or Republican victories
Shows both average and median projections
Projects high, low, and close levels
Comprehensive statistics table with party-specific analysis
The indicator works exclusively on the daily timeframe and projects price levels based on the current day's open price. It normalizes historical moves as percentages to maintain relevance across different price ranges and time periods.
Key Components
Average projections
Median projections
Election Day High, Low and Close
All data presented in the table, lines filtered according to user input.
Notes
Works only on daily timeframe
Updates projections based on each day's opening price
Historical data covers 13 presidential elections
All projections are based on normalized percentage moves
Trade Manager 2Hi Traders,
this manager will make it easier for you to enter lots into your trading platform. Just go to the indicator settings, set your trading account amount, RRR, % risk and then give ok. If you then know where you want to put the stop loss then reopen, enter the value and hit ok again. The chart will show you exactly the stop loss and take profit as you wanted. The stop loss will always stay where you enter it and the take profit will move with the lot size as the price goes further or closer to the stop loss.
This should help when entering the number of lots, TP, SL into the platform.
Up/Down Volume with Normal DistributionThis indicator analyzes the relationship between price movements and trading volume by distinguishing between "up" and "down" volume. Up volume refers to trading volume occurring during price increases, while down volume refers to trading volume during price decreases. The indicator calculates the mean and standard deviation for both up and down volume over a specified length. This statistical approach enables traders to visualize volume deviations from the average, highlighting potential market anomalies that could signal trading opportunities.
Relationship Between Price and Volume
Volume is a critical metric in technical analysis, often considered a leading indicator of price movements. According to studies in financial economics, significant price changes accompanied by high volume tend to indicate strong market conviction (Wyart et al., 2008). Conversely, price changes on low volume may suggest a lack of interest or conviction, making those moves less reliable.
The relationship between price and volume can be summarized as follows:
Confirmation of Trends: High volume accompanying a price increase often confirms an upward trend. Similarly, high volume during price declines indicates bearish sentiment.
Reversals and Exhaustion: Decreases in volume during price increases may suggest a potential reversal or exhaustion of buying pressure, while increased volume during declines can indicate capitulation.
Breakouts: Price movements that break through significant resistance or support levels accompanied by high volume are typically more significant and suggest stronger follow-through in the new direction.
Developing a Trading Strategy
Traders can leverage the insights gained from this relationship to formulate a trading strategy based on volume analysis:
Entry Signals: Traders can enter long positions when the up volume significantly exceeds the mean by a predefined number of standard deviations. This situation indicates strong buying interest. Conversely, short positions can be initiated when down volume exceeds the mean by a specified standard deviation.
Exit Signals: Exiting positions can be based on changes in volume patterns. If the volume starts to decrease significantly after a price increase, this may signal a potential reversal or the need to lock in profits.
Risk Management: Integrating volume analysis with other technical indicators, such as moving averages or RSI, can provide a more comprehensive risk management framework, enhancing the overall effectiveness of the strategy.
In conclusion, understanding the relationship between price and volume, alongside employing statistical measures like the mean and standard deviation, enables traders to create more robust trading strategies that capitalize on market movements.
References
Wyart, M., Bouchaud, J.-P., & Dacorogna, M. (2008). "Self-organized volatility in a complicated market." European Physical Journal B, 61(2), 195-203. doi:10.1140
TradingIQ - Reversal IQIntroducing "Reversal IQ" by TradingIQ
Reversal IQ is an exclusive trading algorithm developed by TradingIQ, designed to trade trend reversals in the market. By integrating artificial intelligence and IQ Technology, Reversal IQ analyzes historical and real-time price data to construct a dynamic trading system adaptable to various asset and timeframe combinations.
Philosophy of Reversal IQ
Reversal IQ integrates IQ Technology (AI) with the timeless concept of reversal trading. Markets follow trends that inevitably reverse at some point. Rather than relying on rigid settings or manual judgment to capture these reversals, Reversal IQ dynamically designs, creates, and executes reversal-based trading strategies.
Reversal IQ is designed to work straight out of the box. In fact, its simplicity requires just one user setting, making it incredibly straightforward to manage.
AI Aggressiveness is the only setting that controls how Reversal IQ works.
Traders don’t have to spend hours adjusting settings and trying to find what works best - Reversal IQ handles this on its own.
Key Features of Reversal IQ
Self-Learning Reversal Detection
Employs AI and IQ Technology to identify trend reversals in real-time.
AI-Generated Trading Signals
Provides reversal trading signals derived from self-learning algorithms.
Comprehensive Trading System
Offers clear entry and exit labels.
AI-Determined Profit Target and Stop Loss
Position exit levels are clearly defined and calculated by the AI once the trade is entered.
Performance Tracking
Records and presents trading performance data, easily accessible for user analysis.
Configurable AI Aggressiveness
Allows users to adjust the AI's aggressiveness to match their trading style and risk tolerance.
Long and Short Trading Capabilities
Supports both long and short positions to trade various market conditions.
IQ Channel
The IQ Channel represents what Reversal IQ considers a tradable long opportunity or a tradable short opportunity. The channel is dynamic and adjusts from chart to chart.
IQMA – Proprietary Moving Average
Introduces the IQ Moving Average (IQMA), designed to classify overarching market trends.
IQCandles – Trend Classification Tool
Complements IQMA with candlestick colors designed for trend identification and analysis.
How It Works
Reversal IQ operates on a straightforward heuristic: go long during an extended downside move and go short during an extended upside move.
What defines an "extended move" is determined by IQ Technology, TradingIQ's exclusive AI algorithm. For Reversal IQ, the algorithm assesses the extent to which historical high and low prices are breached. By learning from these price level violations, Reversal IQ adapts to trade future, similar violations in a recurring manner. It calculates a price area, distant from the current price, where a reversal is anticipated.
In simple terms, price peaks (tops) and troughs (bottoms) are stored for Reversal IQ to learn from. The degree to which these levels are violated by subsequent price movements is also recorded. Reversal IQ continuously evaluates this stored data, adapting to market volatility and raw price fluctuations to better capture price reversals.
What classifies as a price top or price bottom?
For Reversal IQ, price tops are considered the highest price attained before a significant downside reversal. Price bottoms are considered the lowest price attained before a significant upside reversal. The highest price achieved is continuously calculated before a significant counter trend price move renders the high price as a swing high. The lowest price achieved is continuously calculated before a significant counter trend price move renders the low price as a swing low.
The image above illustrates the IQ channel and explains the corresponding prices and levels
The blue lower line represents the Long Reversal Level, with the price highlighted in blue showing the Long Reversal Price.
The red upper line represents the Short Reversal Level, with the price highlighted in red showing the Short Reversal Price.
Limit orders are placed at both of these levels. As soon as either level is touched, a trade is immediately executed.
The image above shows a long position being entered after the Long Reversal Level was reached. The profit target and stop loss are calculated by Reversal IQ
The blue line indicates where the profit target is placed (acting as a limit order).
The red line shows where the stop loss is placed (acting as a stop loss order).
Green arrows indicate that the strategy entered a long position at the highlighted price level.
You can also hover over the trade labels to get more information about the trade—such as the entry price, profit target, and stop loss.
The image above demonstrates the profit target being hit for the trade. All profitable trades are marked by a blue arrow and blue line. Hover over the blue arrow to obtain more details about the trade exit.
The image above depicts a short position being entered after the Short Reversal Level was touched. The profit target and stop loss are calculated by the AI
The blue line indicates where the profit target is placed (acting as a limit order).
The red line shows where the stop loss is placed (acting as a stop loss order).
The image above shows the profit target being hit for the short trade. Profitable trades are indicated by a blue arrow and blue line. Hover over the blue arrow to access more information about the trade exit.
Long Entry: Green Arrow
Short Entry: Red Arrow
Profitable Trades: Blue Arrow
Losing Trades: Red Arrow
IQMA
The IQMA implements a dynamic moving average that adapts to market conditions by adjusting its smoothing factor based on its own slope. This makes it more responsive in volatile conditions (steeper slopes) and smoother in less volatile conditions.
The IQMA is not used by Reversal IQ as a trade condition; however, the IQMA can be used by traders to characterize the overarching trend and elect to trade only long positions during bullish conditions and only short positions during bearish conditions.
The IQMA is an adaptive smoothing function that applies a combination of multiple moving averages to reduce lag and noise in the data. The adaptiveness is achieved by dynamically adjusting the Volatility Factor (VF) based on the slope (derivative) of the price trend, making it more responsive to strong trends and smoother in consolidating markets.
This process effectively makes the moving average a self-adjusting filter, the IQMA attempts to track both trending and ranging market conditions by dynamically changing its sensitivity in response to price movements.
When IQMA is blue, an overarching uptrend is in place. When IQMA is red, an overarching downtrend is in place.
IQ Candles
IQ Candles are price candles color-coordinated with IQMA. IQ Candles help visualize the overarching trend and are not used by Reversal IQ to determine trade entries and trade exits.
AI Aggressiveness
Reversal IQ has only one setting that controls its functionality.
AI Aggressiveness controls the aggressiveness of the AI. This setting has three options: Sniper, Aggressive, and Very Aggressive.
Sniper Mode
In Sniper Mode, Reversal IQ will prioritize trading large deviations from established reversal levels and extracting the largest countertrend move possible from them.
Aggressive Mode
In Aggressive Mode, Reversal IQ still prioritizes quality but allows for strong, quantity-based signals. More trades will be executed in this mode with tighter stops and profit targets. Aggressive mode forces Reversal IQ to learn from narrower raw-dollar violations of historical levels.
Very Aggressive Mode
In Very Aggressive Mode, Reversal IQ still prioritizes the strongest quantity-based signals. Stop and target distances aren't inherently affected, but entries will be aggressive while prioritizing performance. Very Aggressive mode forces Reversal IQ to learn from narrower raw-dollar violations of historical levels and also forces it to embrace volatility more aggressively.
AI Direction
The AI Direction setting controls the trade direction Reversal IQ is allowed to take.
“Both” allows for both long and short trades.
“Long” allows for only long trades.
“Short” allows for only short trades.
Verifying Reversal IQ’s Effectiveness
Reversal IQ automatically tracks its performance and displays the profit factor for the long strategy and the short strategy it uses. This information can be found in a table located in the top-right corner of your chart.
The image above shows the long strategy profit factor and the short strategy profit factor for Reversal IQ.
A profit factor greater than 1 indicates a strategy profitably traded historical price data.
A profit factor less than 1 indicates a strategy unprofitably traded historical price data.
A profit factor equal to 1 indicates a strategy did not lose or gain money when trading historical price data.
Using Reversal IQ
While Reversal IQ is a full-fledged trading system with entries and exits, it was designed for the manual trader to take its trading signals and analysis indications to greater heights - offering numerous applications beyond its built-in trading system.
The hallmark feature of Reversal IQ is its sniper-like reversal signals. While exits are dynamically calculated as well, Reversal IQ simply has a knack for "sniping" price reversals.
When performing live analysis, you can use the IQ Channel to evaluate price reversal areas, whether price has extended too far in one direction, and whether price is likely to reverse soon.
Of course, in times of exuberance or panic, price may push through the reversal levels. While infrequent, it can happen to any indicator.
The deeper price moves into the bullish reversal area (blue) the better chance that price has extended too far and will reverse to the upside soon. The deeper price moves into the bearish reversal area (red) the better chance that price has extended too far and will reverse to the downside soon.
Of course, you can set alerts for all Reversal IQ entry and exit signals, effectively following along its systematic conquest of price movement.
TradingIQ - Impulse IQIntroducing "Impulse IQ" by TradingIQ
Impulse IQ is an exclusive trading algorithm developed by TradingIQ, designed to trade breakouts and established trends. By integrating artificial intelligence and IQ Technology, Impulse IQ analyzes historical and real-time price data to construct a dynamic trading system adaptable to various asset and timeframe combinations.
Philosophy of Impulse IQ
Impulse IQ combines IQ Technology (AI) with the classic principles of trend and breakout trading. Recognizing that markets inherently follow trends that need to persist for significant price movements to unfold, Impulse IQ eliminates the need for rigid settings or manual intervention.
Instead, it dynamically develops, adapts, and executes trend-based trading strategies, enabling a more responsive approach to capturing meaningful market opportunities.
Impulse IQ is designed to work straight out of the box. In fact, its simplicity requires just one user setting, making it incredibly straightforward to manage.
Strategy type is the only setting that controls Impulse IQ’s functionality.
Traders don’t have to spend hours adjusting settings and trying to find what works best - Impulse IQ handles this on its own.
Key Features of Impulse IQ
Self-Learning Breakout Detection
Employs IQ Technology to identify breakouts.
AI-Generated Trading Signals
Provides breakout trading signals derived from self-learning algorithms.
Comprehensive Trading System
Offers clear entry and exit labels.
AI-Determined Trailing Profit Target and Stop Loss
Position exit levels are clearly defined and calculated by the AI once the trade is entered.
Performance Tracking
Records and presents trading performance data, easily accessible for user analysis.
Long and Short Trading Capabilities
Supports both long and short positions to trade various market conditions.
IQ Meter
The IQ Meter details where price is trading relative to a higher timeframe trend and lower timeframe trend. Fibonacci levels are interlaced along the meter, offering unique insights on trend retracement opportunities.
Self Learning, Multi Timeframe IQ Zig Zags
The Zig Zag IQ is a self-learning, multi-timeframe indicator that adapts to market volatility, providing a clearer representation of market movements than traditional zig zag indicators.
Dual Strategy Execution
Impulse IQ integrates two distinct strategy types: Breakout and Cheap (details explained later).
How It Works
Before diving deeper into Impulse IQ, it's essential to understand the core terminology:
Zig Zag IQ : A self-learning trend and breakout identification mechanism that serves as the foundation for Impulse IQ. Although it belongs to the “Zig Zag” class of technical indicators, it's powered by IQ Technology.
Impulse IQ : A self-learning trading strategy that executes trades based on Zig Zag IQ. Zig Zag IQ identifies market trends, while Impulse IQ adapts, learns, and executes trades based on these trend characterizations.
Impulse IQ operates on a simple heuristic: go long during upside volatility and go short during downside volatility, essentially capturing price breakouts.
The definition of a “price breakout” is determined by IQ Technology, TradingIQ's exclusive AI algorithm. In Impulse IQ, the algorithm utilizes two IQ Zig Zags (self-learning, multi-timeframe zig zags) to analyze and learn from market trends.
It identifies breakout opportunities by recognizing violations of established price levels marked by the IQ Zig Zags. Impulse IQ then adapts and evolves to trade similar future violations in a recurring and dynamic manner.
Put simply, IQ Zig Zags continuously learn from both historical and real-time price updates to adjust themselves for an "optimal fit" to price data. The aim is to adapt so that the marked price tops and bottoms, when violated, reveal potential breakout opportunities.
The strategy layer of IQ Zig Zags, known as Impulse IQ, incorporates an additional level of self-learning with IQ Technology. It learns from breakout signals generated by the IQ Zig Zags, enabling it to dynamically identify and signal tradable breakouts. Moreover, Impulse IQ learns from historical price data to manage trade exits.
All positions start with an initial fixed stop loss and a trailing stop target. Once the trailing stop target is reached, the fixed stop loss converts into a trailing stop, allowing Impulse IQ to remain in the breakout/trend until the trailing stop is triggered.
What Classifies as a Breakout, Price Top, and Price Bottom?
For Impulse IQ:
Price tops are considered the highest price achieved before a price bottom forms.
Price bottoms are the lowest price reached before a price top forms.
For price tops, the highest price continues to be calculated until a significant downside price move occurs. Similarly, for price bottoms, the lowest price is calculated until a significant upside price move happens.
What distinguishes Zig Zag IQ from other zig zag indicators is its unique mechanism for determining a "significant counter-trend price move." Zig Zag IQ evaluates multiple fits to identify what best suits the current market conditions. Consequently, a "significant counter-trend price move" in one market might differ in magnitude from what’s considered "significant" in another, allowing it to adapt to varying market dynamics.
For example, a 1% price move in the opposite direction might be substantial in one market but not in another, and Zig Zag IQ figures this out internally.
The image above illustrates the IQ Zig Zags in action. The solid Zig Zag IQ lines represent the most recent price move being calculated, while the dotted, shaded lines display historical price moves previously analyzed by IQ Zig Zag.
Notice how the green zig zag aligns with a larger trend, while the purple zig zag follows a smaller trend. This mechanism is crucial for generating breakout signals in Impulse IQ: for a position to be entered, the breakout of the smaller trend must occur in the same direction as the larger trend.
The image above depicts the IQ Meters—an exclusive TradingIQ tool designed to help traders evaluate trend strength and retracement opportunities.
When the lower timeframe Zig Zag IQ and the higher timeframe Zig Zag IQ are out of sync (i.e., one is uptrending while the other is downtrending, with no active positions), the meters display a neutral color, as shown in the image.
The key to using these meters is to identify trend unison and pinpoint key trend retracement entry opportunities. Fibonacci retracement levels for the current trend are interlaced along each meter, and the current price is converted to a retracement ratio of the trend.
These meters can mathematically determine where price stands relative to the larger and smaller trends, aiding in identifying entry opportunities.
The top of each meter indicates the highest price achieved during the current price move.
The bottom of each meter indicates the lowest price achieved during the current price move.
When both the larger and smaller trends are in sync and uptrending, or when a long position is active, the IQ meters turn green, indicating uptrend strength.
When both trends are in sync and downtrending, or when a short position is active, the IQ meters turn red, indicating downtrend strength.
The image above shows the Point of Change for both the larger and smaller Zig Zag IQ trends. A distinctive feature of Zig Zag IQ is its ability to calculate these turning points in advance—unlike most traditional zig zag indicators that lack predetermined turning points and often lag behind price movements. In contrast, Zig Zag IQ offers a minimal-lag trend detection capability, providing a more responsive representation of market trends.
Simply put, once the market Zig Zag anchors are touched, the corresponding Zig Zag IQ will change direction.
Trade Signals
Impulse IQ can trade in one of two ways: Entering breakouts as soon as they happen (Breakout Strategy Type) or entering the pullback of a price breakout (Cheap Strategy Type).
Generally, the Breakout Strategy type will take a greater number of trades and enter a breakout quicker. The Cheap Strategy type will usually take less trades, but potentially enter at a better time/price point, prior to the next leg up of a break up, or the next leg down of a break down.
Entry signals are given when price breaks out to the upside or downside for the "Breakout" strategy type, or for the "Cheap" strategy type, when price retraces to the level it broke out from!
Breakout Strategy Example
The image above demonstrates a long position entered and exited using the Breakout strategy. The price breakout level is marked by the dotted, horizontal green line, representing a previously established price high identified by IQ Zig Zag. Once the price breaks and closes above this level, a long position is initiated.
After entering a long position, Impulse IQ immediately displays the initial fixed stop price. As the price moves favorably for the long position, the trailing stop conversion level is reached, and the indicator switches to a trailing stop, as shown in the image. Impulse IQ continues to "ride the trend" for as long as it persists, exiting only when the trailing stop is triggered.
Cheap Strategy Example
The image above shows a short entry executed using the Cheap strategy. The aim of the Cheap strategy is to enter on a pullback before the breakout occurs. While this results in fewer trades if price doesn’t pull back before the breakout, it typically allows for a better entry time and price point when a pullback does happen.
The image above illustrates the remainder of the trade until the trailing stop was hit.
Green Arrow = Long Entry
Red Arrow = Short Entry
Blue Arrow = Trade Exit
Impulse IQ calculates the initial stop price and trailing stop distance before any entry signals are triggered. This means users don’t need to constantly tweak these settings to improve performance—Impulse IQ handles this process internally.
Verifying Impulse IQ’s Effectiveness
Impulse IQ automatically tracks its performance and displays the profit factor for both its long and short strategies, visible in a table located in the top-right corner of your chart.
The image above shows the profit factor for both the long and short strategies used by Impulse IQ.
A profit factor greater than 1 indicates that the strategy was profitable when trading historical price data.
A profit factor less than 1 indicates that the strategy was unprofitable when trading historical price data.
A profit factor equal to 1 indicates that the strategy neither gained nor lost money on historical price data.
Using Impulse IQ
While Impulse IQ functions as a comprehensive trading system with its own entry and exit signals, it was designed for the manual trader to take its trading signals and analysis indications to greater heights - offering numerous applications beyond its built-in trading system.
The standout feature of Impulse IQ is its ability to characterize and capitalize on trends. Keeping a close eye on “Breakout” labels and making use of the IQ meter is the best way to use Impulse IQ.
The IQ Meters can be used to:
Find entry points during trend retracements
Assess trend alignment across higher and lower timeframes
Evaluate overall trend strength, indicating where the price lies on both IQ Meters.
Additionally, "Break Up" and "Break Down" labels can be identified for anticipating breakouts. Impulse IQ self-learns to capture breakouts optimally, making these labels dynamic signals for predicting a breakout.
The Zig Zag IQ indicators are instrumental in characterizing the market's current state. As a self-learning tool, Zig Zag IQ constantly adapts to improve the representation of current price action. The price tops and bottoms identified by Zig Zag IQ can be treated as support/resistance and breakout levels.
Of course, you can set alerts for all Impulse IQ entry and exit signals, effectively following along its systematic conquest of price movement.
TradingIQ - Nova IQIntroducing "Nova IQ" by TradingIQ
Nova IQ is an exclusive Trading IQ algorithm designed for extended price move scalping. It spots overextended micro price moves and bets against them. In this way, Nova IQ functions similarly to a reversion strategy.
Nova IQ analyzes historical and real-time price data to construct a dynamic trading system adaptable to various asset and timeframe combinations.
Philosophy of Nova IQ
Nova IQ integrates AI with the concept of central-value reversion scalping. On lower timeframes, prices may overextend for small periods of time - which Nova IQ looks to bet against. In this sense, Nova IQ scalps against small, extended price moves on lower timeframes.
Nova IQ is designed to work straight out of the box. In fact, its simplicity requires just one user setting, making it incredibly straightforward to manage.
Use HTF (used to apply a higher timeframe trade filter) is the only setting that controls how Nova IQ works.
Traders don’t have to spend hours adjusting settings and trying to find what works best - Nova IQ handles this on its own.
Key Features of Nova IQ
Self-Learning Market Scalping
Employs AI and IQ Technology to scalp micro price overextensions.
AI-Generated Trading Signals
Provides scalping signals derived from self-learning algorithms.
Comprehensive Trading System
Offers clear entry and exit labels.
Performance Tracking
Records and presents trading performance data, easily accessible for user analysis.
Higher Timeframe Filter
Allows users to implement a higher timeframe trading filter.
Long and Short Trading Capabilities
Supports both long and short positions to trade various market conditions.
Nova Oscillator (NOSC)
The Nova IQ Oscillator (NOSC) is an exclusive self-learning oscillator developed by Trading IQ. Using IQ Technology, the NOSC functions as an all-in-one oscillator for evaluating price overextensions.
Nova Bands (NBANDS)
The Nova Bands (NBANDS) are based on a proprietary calculation and serve as a custom two-layer smoothing filter that uses exponential decay. These bands adaptively smooth prices to identify potential trend retracement opportunities.
How It Works
Nova IQ operates on a simple heuristic: scalp long during micro downside overextensions and short during micro upside overextensions.
What constitutes an "overextension" is defined by IQ Technology, TradingIQ's proprietary AI algorithm. For Nova IQ, this algorithm evaluates the typical extent of micro overextensions before a reversal occurs. By learning from these patterns, Nova IQ adapts to identify and trade future overextensions in a consistent manner.
In essence, Nova IQ learns from price movements within scalping timeframes to pinpoint price areas for capitalizing on the reversal of an overextension.
As a trading system, Nova IQ enters all positions using market orders at the bar’s close. Each trade is exited with a profit-taking limit order and a stop-loss order. Thanks to its self-learning capability, Nova IQ determines the most suitable profit target and stop-loss levels, eliminating the need for the user to adjust any settings.
What classifies as a tradable overextension?
For Nova IQ, tradable overextensions are not manually set but are learned by the system. Nova IQ utilizes NOSC to identify and classify micro overextensions. By analyzing multiple variations of NOSC, along with its consistency in signaling overextensions and its tendency to remain in extreme zones, Nova IQ dynamically adjusts NOSC to determine what constitutes overextension territory for the indicator.
When NOSC reaches the downside overextension zone, long trades become eligible for entry. Conversely, when NOSC reaches the upside overextension zone, short trades become eligible for entry.
The image above illustrates NOSC and explains the corresponding overextension zones
The blue lower line represents the Downside Overextension Zone.
The red upper line represents the Upside Overextension Zone.
Any area between the two deviation points is not considered a tradable price overextension.
When either of the overextension zones are breached, Nova IQ will get to work at determining a trade opportunity.
The image above shows a long position being entered after the Downside Overextension Zone was reached.
The blue line on the price scale shows the AI-calculated profit target for the scalp position. The redline shows the AI-calculated stop loss for the scalp position.
Blue arrows indicate that the strategy entered a long position at the highlighted price level.
Yellow arrows indicate a position was closed.
You can also hover over the trade labels to get more information about the trade—such as the entry price and exit price.
The image above depicts a short position being entered after the Upside Overextension Zone was breached.
The blue line on the price scale shows the AI-calculated profit target for the scalp position. The redline shows the AI-calculated stop loss for the scalp position.
Red arrows indicate that the strategy entered a short position at the highlighted price level.
Yellow arrows indicate that NOVA IQ exited a position.
Long Entry: Blue Arrow
Short Entry: Red Arrow
Closed Trade: Yellow Arrow
Nova Bands
The Nova Bands (NBANDS) are based on a proprietary calculation and serve as a custom two-layer smoothing filter that uses exponential decay and cosine factors.
These bands adaptively smooth the price to identify potential trend retracement opportunities.
The image above illustrates how to interpret NBANDS. While NOSC focuses on identifying micro overextensions, NBANDS is designed to capture larger price overextensions. As a result, the two indicators complement each other well and can be effectively used together to identify a broader range of price overextensions in the market.
While the Nova Bands are not part of the core heuristic and do not use IQ technology, they provide valuable insights for discretionary traders looking to refine their strategies.
Use HTF (Use Higher Timeframe) Setting
Nova IQ has only one setting that controls its functionality.
“Use HTF” controls whether the AI uses a higher timeframe trading filter. This setting can be true or false. If true, the trader must select the higher timeframe to implement.
No Higher TF Filter
Nova IQ operates with standard aggression when the higher timeframe setting is turned off. In this mode, it exclusively learns from the price data of the current chart, allowing it to trade more aggressively without the influence of a higher timeframe filter.
Higher TF Filter
Nova IQ demonstrates reduced aggression when the "Use HTF" (Higher Timeframe) setting is enabled. In this mode, Nova IQ learns from both the current chart's data and the selected higher timeframe data, factoring in the higher timeframe trend when seeking scalping opportunities. As a result, trading opportunities only arise when both the higher timeframe and the chart's timeframe simultaneously display overextensions, making this mode more selective in its entries.
In this mode, Nova IQ calculates NOSC on the higher timeframe, learns from the corresponding price data, and applies the same rules to NOSC as it does for the current chart's timeframe. This ensures that Nova IQ consistently evaluates overextensions across both timeframes, maintaining its trading logic while incorporating higher timeframe insights.
AI Direction
The AI Direction setting controls the trade direction Nova IQ is allowed to take.
“Trade Longs” allows for long trades.
“Trade Shorts” allows for short trades.
Verifying Nova IQ’s Effectiveness
Nova IQ automatically tracks its performance and displays the profit factor for the long strategy and the short strategy it uses. This information can be found in a table located in the top-right corner of your chart showing the long strategy profit factor and the short strategy profit factor.
The image above shows the long strategy profit factor and the short strategy profit factor for Nova IQ.
A profit factor greater than 1 indicates a strategy profitably traded historical price data.
A profit factor less than 1 indicates a strategy unprofitably traded historical price data.
A profit factor equal to 1 indicates a strategy did not lose or gain money when trading historical price data.
Using Nova IQ
While Nova IQ is a full-fledged trading system with entries and exits - it was designed for the manual trader to take its trading signals and analysis indications to greater heights, offering numerous applications beyond its built-in trading system.
The hallmark feature of Nova IQ is its to ignore noise and only generate signals during tradable overextensions.
The best way to identify overextensions with Nova IQ is with NOSC.
NOSC is naturally adept at identifying micro overextensions. While it can be interpreted in a manner similar to traditional oscillators like RSI or Stochastic, NOSC’s underlying calculation and self-learning capabilities make it significantly more advanced and useful than conventional oscillators.
Additionally, manual traders can benefit from using NBANDS. Although NBANDS aren't a core component of Nova IQ's guiding heuristic, they can be valuable for manual trading. Prices rarely extend beyond these bands, and it's uncommon for prices to consistently trade outside of them.
NBANDS do not incorporate IQ Technology; however, when combined with NOSC, traders can identify strong double-confluence opportunities.
ShuffleOverview
This TV script is designed to assist traders by visually marking key price levels and identifying potential trading opportunities on their charts. The script highlights the previous day's, week's, and month's highs and lows, as well as hourly fair value gaps. By providing clear visual indicators, traders can make more informed decisions based on significant price movements and gaps in the market.
Features
1. Previous Day Highs and Lows
Highs and Lows: Automatically plots the highest and lowest price points from the previous trading day.
Visual Indicators: Uses distinct colors and lines to differentiate between highs and lows for easy identification.
Alerts: Optional alerts when current price approaches these levels.
2. Weekly Highs and Lows
Weekly Range: Marks the highest and lowest prices of the current week.
Trend Analysis: Helps in identifying the overall trend direction based on weekly extremes.
Support and Resistance: Acts as dynamic support and resistance levels for potential trade setups.
3. Monthly Highs and Lows
Monthly Extremes: Highlights the highest and lowest prices recorded in the current month.
Long-Term Perspective: Provides insights into long-term market sentiment and potential major support/resistance zones.
Investment Decisions: Aids in making strategic investment decisions based on significant monthly price movements.
4. Hourly Fair Value Gaps
Fair Value Gaps (FVG): Identifies gaps between the high of one hour and the low of the next hour where no trading has occurred.
Price Retracement: Marks areas where price is likely to retrace to fill these gaps, offering potential entry points.
Gap Analysis: Assists in understanding market inefficiencies and potential price corrections.
Z-Score Weighted Trend System I [InvestorUnknown]The Z-Score Weighted Trend System I is an advanced and experimental trading indicator designed to utilize a combination of slow and fast indicators for a comprehensive analysis of market trends. The system is designed to identify stable trends using slower indicators while capturing rapid market shifts through dynamically weighted fast indicators. The core of this indicator is the dynamic weighting mechanism that utilizes the Z-score of price , allowing the system to respond effectively to significant market movements.
Dynamic Z-Score-Based Weighting System
The Z-Score Weighted Trend System I utilizes the Z-score of price to assign weights dynamically to fast indicators. This mechanism is designed to capture rapid market shifts at potential turning points, providing timely entry and exit signals.
Traders can choose from two primary weighting mechanisms:
Threshold-Based Weighting: The fast indicators are given weight only when the absolute Z-score exceeds a user-defined threshold. Below this threshold, fast indicators have no impact on the final signal.
Continuous Weighting: By setting the threshold to zero, fast indicators always contribute to the final signal, regardless of Z-score levels. However, this increases the likelihood of false signals during ranging or low-volatility markets
// Calculate weight for Fast Indicators based on Z-Score (Slow Indicator weight is kept to 1 for simplicity)
f_zscore_weights(series float z, simple float weight_thre) =>
float fast_weight = na
float slow_weight = na
if weight_thre > 0
if math.abs(z) <= weight_thre
fast_weight := 0
slow_weight := 1
else
fast_weight := 0 + math.sqrt(math.abs(z))
slow_weight := 1
else
fast_weight := 0 + math.sqrt(math.abs(z))
slow_weight := 1
Choice of Z-Score Normalization
Traders have the flexibility to select different Z-score processing methods to better suit their trading preferences:
Raw Z-Score or Moving Average: Traders can opt for either the raw Z-score or a moving average of the Z-score to smooth out fluctuations.
Normalized Z-Score (ranging from -1 to 1) or Z-Score Percentile: The normalized Z-score is simply the raw Z-score divided by 3, while the Z-score percentile utilizes a normal distribution for transformation.
f_zscore_perc(series float zscore_src, simple int zscore_len, simple string zscore_a, simple string zscore_b, simple string ma_type, simple int ma_len) =>
z = (zscore_src - ta.sma(zscore_src, zscore_len)) / ta.stdev(zscore_src, zscore_len)
zscore = switch zscore_a
"Z-Score" => z
"Z-Score MA" => ma_type == "EMA" ? (ta.ema(z, ma_len)) : (ta.sma(z, ma_len))
output = switch zscore_b
"Normalized Z-Score" => (zscore / 3) > 1 ? 1 : (zscore / 3) < -1 ? -1 : (zscore / 3)
"Z-Score Percentile" => (f_percentileFromZScore(zscore) - 0.5) * 2
output
Slow and Fast Indicators
The indicator uses a combination of slow and fast indicators:
Slow Indicators (constant weight) for stable trend identification: DMI (Directional Movement Index), CCI (Commodity Channel Index), Aroon
Fast Indicators (dynamic weight) to identify rapid trend shifts: ZLEMA (Zero-Lag Exponential Moving Average), IIRF (Infinite Impulse Response Filter)
Each indicator is calculated using for-loop methods to provide a smoothed and averaged view of price data over varying lengths, ensuring stability for slow indicators and responsiveness for fast indicators.
Signal Calculation
The final trading signal is determined by a weighted combination of both slow and fast indicators. The slow indicators provide a stable view of the trend, while the fast indicators offer agile responses to rapid market movements. The signal calculation takes into account the dynamic weighting of fast indicators based on the Z-score:
// Calculate Signal (as weighted average)
float 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
The indicator features a detailed backtesting mode, allowing traders to compare the effectiveness of their selected settings against a traditional Buy & Hold strategy. The backtesting provides:
Equity calculation based on signals generated by the indicator.
Performance metrics comparing Buy & Hold metrics with the system’s signals, including: Mean, positive, and negative return percentages, Standard deviations, Sharpe, Sortino, and Omega Ratios
// Calculate Performance Metrics
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), 4)
mean_pos = math.round((pos_count != 0 ? pos_sum / pos_count : na), 4)
mean_neg = math.round((neg_count != 0 ? neg_sum / neg_count : na), 4)
// 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))* 100, 2)
sortino_ratio = math.round((mean_all / stddev_neg * (Annualize ? math.sqrt(Lookback) : 1))* 100, 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
//}
Calibration Mode
A Calibration Mode is included for traders to focus on individual indicators, helping them fine-tune their settings without the influence of other components. In Calibration Mode, the user can visualize each indicator separately, making it easier to adjust parameters.
Alerts
The indicator includes alerts for long and short signals when the indicator changes direction, allowing traders to set automated notifications for key market events.
// Alert Conditions
alertcondition(long_alert, "LONG (Z-Score Weighted Trend System)", "Z-Score Weighted Trend System flipped ⬆LONG⬆")
alertcondition(short_alert, "SHORT (Z-Score Weighted Trend System)", "Z-Score Weighted Trend System flipped ⬇Short⬇")
Important Note:
The default settings of this indicator are not optimized for any particular market condition. They are generic starting points for experimentation. Traders are encouraged to use the calibration tools and backtesting features to adjust the system to their specific trading needs.
The results generated from the backtest are purely historical and are not indicative of future results. Market conditions can change, and the performance of this system may differ under different circumstances. Traders and investors should exercise caution and conduct their own research before using this indicator for any trading decisions.