Global OECD CLI Diffusion Index YoY vs MoMThe Global OECD Composite Leading Indicators (CLI) Diffusion Index is used to gauge the health and directional momentum of the global economy and anticipate changes in economic conditions. It usually leads turning points in the economy by 6 - 9 months.
How to read: Above 50% signals economic expansion across the included countries. Below 50% signals economic contraction.
The diffusion index component specifically shows the proportion of countries with positive economic growth signals compared to those with negative or neutral signals.
The OECD CLI aggregates data from several leading economic indicators including order books, building permits, and consumer and business sentiment. It tracks the economic momentum and turning points in the business cycle across 38 OECD member countries and several other Non-OECD member countries.
Cycles
Trend Continuation RatioThis TradingView indicator calculates the likelihood of consecutive bullish or bearish days over a specified period, giving insights into day-to-day continuation patterns within the market.
How It Works
Period Length Input:
The user sets the period length (e.g., 20 days) to analyze.
After each period, the counts reset, allowing fresh data for each new interval.
Bullish and Bearish Day Definitions:
A day is considered bullish if the closing price is higher than the opening price.
A day is considered bearish if the closing price is lower than the opening price.
Count Tracking:
Within each specified period, the indicator tracks:
Total Bullish Days: The number of days where the close is greater than the open.
Total Bearish Days: The number of days where the close is less than the open.
Bullish to Bullish Continuations: Counts each instance where a bullish day is followed by another bullish day.
Bearish to Bearish Continuations: Counts each instance where a bearish day is followed by another bearish day.
Calculating Continuation Ratios:
The Bullish Continuation Ratio is calculated as the percentage of bullish days that were followed by another bullish day:
Bullish Continuation Ratio = (Bullish to Bullish Continuations /Total Bullish Days)×100
Bullish Continuation Ratio=( Total Bullish Days/Bullish to Bullish Continuations )×100
The Bearish Continuation Ratio is the percentage of bearish days followed by another bearish day:
Bearish Continuation Ratio = (Bearish to Bearish Continuations/Total Bearish Days)×100
Bearish Continuation Ratio=( Total Bearish Days/Bearish to Bearish Continuations )×100
Display on Chart:
The indicator displays a table in the top-right corner of the chart with:
Bullish Continuation Ratio (%): Percentage of bullish days that led to another bullish day within the period.
Bearish Continuation Ratio (%): Percentage of bearish days that led to another bearish day within the period.
Usage Insights
High Ratios: If the bullish or bearish continuation ratio is high, it suggests a trend where bullish/bearish days often lead to similar days, indicating possible momentum.
Low Ratios: Low continuation ratios indicate frequent reversals, which could suggest a range-bound or volatile market.
This indicator is helpful for assessing short-term trend continuation tendencies, allowing traders to gauge whether they are more likely to see follow-through on bullish or bearish days within a chosen timeframe.
Average Up and Down Candles Streak with Predicted Next CandleThis indicator is designed to analyze price trends by examining the patterns of up and down streaks (consecutive bullish or bearish candles) over a defined period. It uses this data to provide insights on whether the next candle is likely to be bullish or bearish, and it visually displays relevant information on the chart.
Here’s a breakdown of what the indicator does:
1. Inputs and Parameters
Period (Candles): Defines the number of candles used to calculate the average length of bullish and bearish streaks. For example, if the period is set to 20, the indicator will analyze the past 20 candles to determine average up and down streak lengths.
Bullish/Bearish Bias Signal Toggle: These options allow users to show or hide visual signals (green or red circles) when there’s a bullish or bearish bias in the trend based on the indicator’s calculations.
2. Streak Calculation
The indicator looks at each candle within the period to identify if it closed up (bullish) or down (bearish).
Up Streak: The indicator counts consecutive bullish candles. When there’s a bearish candle, it resets the up streak count.
Down Streak: Similarly, it counts consecutive bearish candles and resets when a bullish candle appears.
Averages: Over the defined period, the indicator calculates the average length of up streaks and average length of down streaks. This provides a baseline to assess whether the current streak is typical or extended.
3. Current and Average Streak Display
The indicator displays the current up and down streak lengths alongside the average streak lengths for comparison. This data appears in a table on the chart, allowing you to see at a glance:
The current streak length (for both up and down trends)
The average streak length for up and down trends over the chosen period
4. Trend Prediction for the Next Candle
Next Candle Prediction: Based on the current streak and its comparison to the average, the indicator predicts the likely direction of the next candle:
Bullish: If the current up streak is shorter than the average up streak, suggesting that the bullish trend could continue.
Bearish: If the current down streak is shorter than the average down streak, indicating that the bearish trend may continue.
Neutral: If the current streak length is near the average, which could signal an upcoming reversal.
This prediction appears in a table on the chart, labeled as “Next Candle.”
5. Previous Candle Analysis
The Previous Candle entry in the table reflects the last completed candle (directly before the current candle) to show whether it was bullish, bearish, or neutral.
This data gives a reference point for recent price action and helps validate the next candle prediction.
6. Visual Signals and Reversal Zones
Bullish/Bearish Bias Signals: The indicator can plot green circles on bullish bias and red circles on bearish bias to highlight points where the trend is likely to continue.
Reversal Zones: If the current streak length reaches or exceeds the average, it suggests the trend may be overextended, indicating a potential reversal zone. The indicator highlights these zones with shaded backgrounds (green for possible bullish reversal, red for bearish) on the chart.
Summary of What You See on the Chart
Bullish and Bearish Bias Signals: Green or red circles mark areas of expected continuation in the trend.
Reversal Zones: Shaded areas in red or green suggest that the trend might be about to reverse.
Tables:
The Next Candle prediction table displays the trend direction of the previous candle and the likely trend of the next candle.
The Streak Information table shows the current up and down streak lengths, along with their averages for easy comparison.
Practical Use
This indicator is helpful for traders aiming to understand trend momentum and potential reversals based on historical patterns. It’s particularly useful for swing trading, where knowing the typical length of bullish or bearish trends can help in timing entries and exits.
Price Move Exceed % Threshold & BE Evaluation1Handy to see history or quick back test of moves. Enter a decimal for percentage wanted and choose the time frame wanted . The occurrences of the up or down threshold are plotted in the panel as maroon or green squares and can be read as red or green text in the panel data and on the right hand scale . The last number in the panel is the average move for the chosen period.
My usage is mostly to see what % has been exceeded for break even prices of option trades. Example: in SPY a spread has a break even of 567 when the price is 570; I get the percentage of the $3 move by dividing 3/570 to get 0.0526 ; the results show as described above.
Globex Trap ZoneGlobex Trap Indicator
A powerful tool designed to identify potential trading opportunities by analyzing the relationship between Globex session ranges and Supply & Demand zones during regular trading hours.
Key Features
Tracks and visualizes Globex session price ranges
Identifies key Supply & Demand zones during regular trading hours
Highlights potential trap areas where price might experience significant reactions
Fully customizable time ranges and visual settings
Clear labeling of Globex highs and lows
How It Works
The indicator tracks two key periods:
Globex Session (Default: 6:00 PM - 9:30 AM)
Monitors overnight price action
Marks session high and low
Helps identify potential range breakouts
Supply & Demand Zone (Default: 8:00 AM - 11:00 AM)
Tracks price action during key market hours
Identifies potential reaction zones
Helps spot institutional trading areas
Best Practices for Using This Indicator
Use on 1-hour timeframe or lower for optimal visualization
Best suited for futures and other instruments traded during Globex sessions
Pay attention to areas where Globex range and Supply/Demand zones overlap
Use in conjunction with your existing trading strategy for confirmation
Recommended minimum of 10 days of historical data for context
Settings Explanation
Globex Session: Customizable time range for overnight trading session
Supply & Demand Zone: Adjustable time range for regular trading hours
Days to Look Back: Number of historical days to display (default: 10)
Visual Settings: Customizable colors and transparency for both zones
Important Notes
All times are based on exchange timezone
The indicator respects overnight sessions and properly handles timezone transitions
Historical data requirements: Minimum 10 days recommended
Performance impact: Optimized for smooth operation with minimal resource usage
Disclaimer
Past performance is not indicative of future results. This indicator is designed to be used as part of a comprehensive trading strategy and should not be relied upon as the sole basis for trading decisions.
Updates and Support
I actively maintain this indicator and welcome feedback from the trading community. Please feel free to leave comments or suggestions for improvements.
Ido strategy RSI Oversold with MACD Buy Signal Indicator
This indicator combines the Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD) to help identify potential buy signals based on oversold conditions and trend reversals. This script is designed for traders looking to identify entry points when an asset is likely undervalued (oversold) and showing bullish momentum.
How It Works
RSI Oversold Detection: The RSI measures the speed and change of price movements. This indicator flags when the RSI falls below 30, signaling that the asset may be oversold. The user can customize the RSI lookback period and the timeframe within which oversold conditions are considered relevant.
MACD Crossover: The MACD line crossing above the Signal line often indicates a shift to bullish momentum. In this script, a buy signal is generated when a MACD bullish crossover occurs after an RSI oversold condition has been met within a user-defined lookback window.
Buy Signal: A green triangle appears below the price chart each time both conditions are met—when the RSI has recently been in oversold territory and the MACD line crosses above the Signal line. This signal suggests that the asset may be positioned for a potential upward trend, providing a visual cue for entry points.
Customizable Settings
RSI Settings: Adjust the RSI source and period length.
MACD Settings: Customize the fast, slow, and signal lengths of the MACD to suit different market conditions.
Lookback Period: Define how many bars back to check for an RSI oversold condition before confirming a MACD crossover.
Visual Elements
Oversold Background Color: The background on the price chart is shaded red whenever the RSI is below 30.
Buy Signal: A green triangle is displayed on the chart to indicate a potential entry point when both conditions are met.
Alerts
This indicator includes optional alerts, allowing traders to receive notifications whenever the conditions for a buy signal are met, making it easier to monitor multiple assets and stay informed of trading opportunities.
This indicator is ideal for traders using a combination of momentum and trend reversal strategies, especially in volatile markets where oversold conditions often precede a trend change.
Williams %R - Multi TimeframeThis indicator implements the William %R multi-timeframe. On the 1H chart, the curves for 1H (with signal), 4H, and 1D are displayed. On the 4H chart, the curves for 4H (with signal) and 1D are shown. On all other timeframes, only the %R and signal are displayed. The indicator is useful to use on 1H and 4H charts to find confluence among the different curves and identify better entries based on their alignment across all timeframes. Signals above 80 often indicate a potential bearish reversal in price, while signals below 20 often suggest a bullish price reversal.
Zig Zag with Adaptive ProjectionThe "Zig Zag with Adaptive Projection" is an advanced technical analysis tool designed for TradingView's Pine Script platform. This indicator builds upon the traditional ZigZag concept by incorporating adaptive projection capabilities, offering traders a more sophisticated approach to identifying significant price movements and forecasting potential future price levels.
At its core, the indicator utilizes a user-defined period to calculate and display the ZigZag pattern on the chart. This pattern connects significant highs and lows, effectively filtering out minor price fluctuations and highlighting the overall trend structure. Users can customize the appearance of the ZigZag lines, including their color, style (solid, dashed, or dotted), and width, allowing for easy visual integration with other chart elements.
What sets this indicator apart is its adaptive projection feature. By analyzing historical ZigZag patterns, the indicator calculates average lengths and slopes of both bullish and bearish trends. This data is then used to project potential future price movements, adapting to the current market context. The projection lines extend from the most recent ZigZag point, offering traders a visual representation of possible price targets based on historical behavior.
The adaptive nature of the projections is particularly noteworthy. The indicator considers the current trend direction, the length of the most recent ZigZag segment, and compares it to historical averages. This approach allows for more nuanced projections that account for recent market dynamics. If the current trend is stronger than average, the projection will extend further, and vice versa.
From a technical standpoint, the indicator leverages Pine Script v5's capabilities, utilizing arrays for efficient data management and implementing dynamic line drawing for both the ZigZag and projection lines. This ensures smooth performance even when analyzing large datasets.
Traders can fine-tune the indicator to their preferences with several customization options. The ZigZag period can be adjusted from 10 to 100, allowing for sensitivity adjustments to match different trading timeframes. The projection lines can be toggled on or off and their appearance customized, providing flexibility in how the forecast is displayed.
In essence, the "Zig Zag with Adaptive Projection" indicator combines traditional trend analysis with forward-looking projections. It offers traders a tool to not only identify significant price levels but also to anticipate potential future movements based on historical patterns. This blend of retrospective analysis and adaptive forecasting makes it a valuable addition to a trader's technical analysis toolkit, particularly for those interested in trend-following strategies or looking for potential reversal points.
Polygonal Pivot Bands [FXSMARTLAB]The Polygonal Pivot Bands highlights key price pivots, dynamic support and resistance levels, and recent price action on a trading chart. This indicator connects pivot highs and lows with a zigzag line, extends a real-time dashed line to the latest price point, and plots diagonal support/resistance levels that adapt to price movement. These elements together provide traders with a view of significant price zones and potential trend shifts.
Key Components of the Indicator
Pivots are calculated based on user-defined lengths, specifying how many bars on either side of a high or low are required to validate it as a pivot.
Adjustable left and right pivot lengths allow traders to control the sensitivity of pivot detection, with higher values resulting in fewer, more prominent pivots, and lower values increasing sensitivity to price changes.
Zigzag Line
The zigzag line connects consecutive pivot points, filtering out smaller fluctuations and emphasizing the broader direction of price movement.
Users can customize the line's color and thickness to match their preferences, helping them focus on larger trends and potential reversal points.
By linking pivot highs and lows, the zigzag pattern highlights the overall trend and potential points of reversal.
Real-Time Connector Line
A dashed line extends from the last confirmed pivot to the latest price point, providing a real-time, bar-by-bar update of the current price relative to the previous pivot.
This line does not project future price direction but maintains an up-to-date connection with the current price, showing the distance from the last pivot.
Its color and thickness are customizable for improved visibility on the chart.
Dynamic Support and Resistance Levels
The indicator plots dynamic support and resistanc e levels by connecting recent pivot highs and lows, resulting in lines that may appear diagonal rather than strictly horizontal.
These levels move in line with price action, adapting to the natural direction of trends, and offer visual cues where price may encounter support or resistance.
Colors and thickness of these lines can be set individually, allowing traders to adjust visibility according to their preferences.
Enabling these lines gives traders an ongoing reference for critical price boundaries that align more closely with the overall trend.
US 30 Daily Breakout Strategy The US 30 Daily Breakout Strategy (Single Trade Per Breakout/Breakdown) is a trading approach for the US 30 (Dow Jones Industrial Average) that aims to capture breakout or breakdown moves based on the previous day’s high and low levels. The strategy includes mechanisms to take only one trade per breakout (or breakdown) each day and ensures that each trade is executed only when no other trade is open.
Entry Conditions:
Long Trade (Breakout): The strategy initiates a long position if the current candle closes above the previous day's high, indicating an upward breakout. Only one breakout trade can occur per day, regardless of whether the price remains above the previous high.
Short Trade (Breakdown): The strategy initiates a short position if the current candle closes below the previous day's low, indicating a downward breakdown. Similarly, only one breakdown trade can occur per day.
Risk Management:
Take Profit and Stop Loss: Each trade has a take profit and stop loss of 50 points, aiming to cap profit and limit loss effectively for each position.
Daily Reset Mechanism:
At the start of each new day (based on New York time), the strategy resets its flags, allowing it to look for new breakout or breakdown trades. This reset ensures that only one trade can be taken per breakout or breakdown level each day.
Execution Logic
Flags for Trade Limitation: Flags (breakout_traded and breakdown_traded) are used to ensure only one breakout or breakdown trade is taken per day. These flags reset daily.
Dynamic Plotting: The previous day’s high and low are plotted on the chart, providing a visual reference for potential breakout or breakdown levels.
Overall Objective
This strategy is designed to capture single-directional daily moves by identifying significant breakouts or breakdowns beyond the previous day’s range. The fixed profit and loss limits ensure the trades are managed with controlled risk, while the daily reset feature prevents overtrading and limits each trade opportunity to one breakout and one breakdown attempt per day.
Gradient color Candlesthis is a simple candle colouring script that sets the colour of the candles to a gradient and the length of the gradient can be set by a user defined number of bars
SW Gann Pressure time from tops and bottomsW.D. Gann's trading techniques often emphasized the significance of time in the markets, believing that specific time intervals could influence price movements. Here’s how the 30, 60, 90, 120, 180, and 270 bar intervals relate to Gann's rules:
1. **30 Bars**:
- Gann often viewed shorter time frames as critical for identifying short-term trends. A 30-bar interval can signify minor cycles or potential turning points in price.
2. **60 Bars**:
- This interval is significant as Gann believed in the importance of quarterly cycles. A 60-bar mark could indicate a completion of a two-month cycle, often leading to retracements or reversals.
3. **90 Bars**:
- Gann considered 90 days (or bars) to represent a quarter. This interval can signify a substantial shift in market sentiment or a pivotal point in a longer trend.
4. **120 Bars**:
- The 120-bar mark corresponds to about four months. Gann viewed longer intervals as more significant, often leading to major shifts in market trends.
5. **180 Bars**:
- A 180-bar period relates to a semi-annual cycle, which Gann regarded as critical for major support and resistance levels. Price action around this interval can reveal potential long-term trend reversals.
6. **270 Bars**:
- Gann believed that longer cycles, such as 270 bars (approximately nine months), could indicate significant market phases. This interval may represent major turning points and help identify long-term trends.
### Application in Trading:
- **Identifying Trends**: Traders can use these intervals to spot potential trend reversals or continuations based on Gann’s principles of market cycles.
- **Setting Targets and Stops**: Knowing where these key bars fall can help in setting profit targets and stop-loss orders.
- **Analyzing Market Sentiment**: Price reactions at these intervals can provide insights into market psychology and sentiment shifts.
By marking these intervals on a chart, traders can visually assess when price action aligns with Gann's theories, helping them make more informed trading decisions based on historical patterns and cycles.
SW Gann DaysGann pressure days, named after the famous trader W.D. Gann, refer to specific days in a trading month that are believed to have significant market influence. These days are identified based on Gann's theories of astrology, geometry, and market cycles. Here’s a general outline of how they might be understood:
1. **Market Cycles**: Gann believed that markets move in cycles and that certain days can have heightened volatility or trend changes. Traders look for specific dates based on historical price movements.
2. **Timing Indicators**: Pressure days often align with key economic reports, earnings announcements, or geopolitical events that can cause price swings.
3. **Mathematical Patterns**: Gann used angles and geometric patterns to predict price movements, with pressure days potentially aligning with these calculations.
4. **Historical Patterns**: Traders analyze past data to identify dates that historically show strong price reactions, using this to predict future behavior.
5. **Astrological Influences**: Some practitioners incorporate astrological elements, believing that celestial events (like full moons or planetary alignments) can impact market psychology.
Traders might use these concepts to make decisions about entering or exiting positions, but it’s important to note that Gann's methods can be complex and are not universally accepted in trading communities.
Forex Relative Strength MatrixTraders often feel uncertain about which Forex pair to open a position with. This indicator is designed to help in that regard.
This indicator was created as described in the book Swing Trading with Heiken Ashi and Stochastics. In the original, the author suggests using it for swing trading. The author recommends applying it to a monthly chart with an 8-period moving average to analyze the context.
The logic of the indicator is to measure the relative strength of each currency by checking if the price of each Forex pair is above or below a chosen moving average. If the price is above the moving average, the base currency is awarded 1 point, indicating strength. If below, it scores 0, indicating weakness. By accumulating points across multiple pairs, the indicator ranks currencies from strongest to weakest, helping traders identify potential pairs for trading.
Trend Identification:
After identifying relative strength, the trader should observe the general trend using a 100-period SMA on 4-hour charts. If the price is above the SMA, the trend is bullish; if below, it is bearish.
Buy Logic:
A buy is triggered when the base currency is strong (price is above the moving average) and the quote currency is weak (price is below the moving average). After identifying the trend direction, the entry is confirmed by a color change in Heiken Ashi candles (from red to green in an uptrend) and a stochastic crossover in the trend’s direction.
Sell Logic:
A sell is triggered when the base currency is weak (price is below the moving average) and the quote currency is strong (price is above the moving average). The sell entry is confirmed by a color change in Heiken Ashi candles (from green to red in a downtrend) and a stochastic crossover aligned with the trend.
Entry Chart:
The entry chart used is the 4-hour chart. The trader should look for entry signals following a pullback in the trend direction, using Heiken Ashi candles. Entry is made when the Heiken Ashi candles change color (from red to green in an uptrend) and there is a smooth crossover of the stochastic indicator in the trend’s direction.
It would also be possible to adapt the indicator for day trading strategies with targets of 1 to 2 days. Here is a recommended setup:
Relative Strength Identification (1-Hour Chart):
Instead of monthly charts, use a 1-hour chart to identify currency strength with a 20-period moving average.
The 20-period moving average on the 1-hour chart captures a balanced view of short- to medium-term direction, covering nearly a day’s worth of trading but with enough sensitivity for day trading.
General Trend (5-Minute Chart with 100 SMA):
On the 5-minute chart, observe the 100-period SMA to identify the general trend direction throughout the day.
Price above the 100 SMA indicates an uptrend, and below indicates a downtrend, confirming the movement in shorter timeframes.
Entry Chart and Signals (5-Minute Chart):
Use the 15-minute chart to look for entry opportunities, focusing on pullbacks in the main trend direction.
Entry Signals: Enter the position when Heiken Ashi candles change color in the trend direction (from red to green in an uptrend) and the stochastic indicator makes a smooth crossover in the trend’s direction.
Hodrick-Prescott Cycle Component (YavuzAkbay)The Hodrick-Prescott Cycle Component indicator in Pine Script™ is an advanced tool that helps traders isolate and analyze the cyclical deviations in asset prices from their underlying trend. This script calculates the cycle component of the price series using the Hodrick-Prescott (HP) filter, allowing traders to observe and interpret the short-term price movements around the long-term trend. By providing two views—Percentage and Price Difference—this indicator gives flexibility in how these cyclical movements are visualized and interpreted.
What This Script Does
This indicator focuses exclusively on the cycle component of the price, which is the deviation of the current price from the long-term trend calculated by the HP filter. This deviation (or "cycle") is what traders analyze for mean-reversion opportunities and overbought/oversold conditions. The script allows users to see this deviation in two ways:
Percentage Difference: Shows the deviation as a percentage of the trend, giving a normalized view of the price’s distance from its trend component.
Price Difference: Shows the deviation in absolute price terms, reflecting how many price units the price is above or below the trend.
How It Works
Trend Component Calculation with the HP Filter: Using the HP filter, the script isolates the trend component of the price. The smoothness of this trend is controlled by the smoothness parameter (λ), which can be adjusted by the user. A higher λ value results in a smoother trend, while a lower λ value makes it more responsive to short-term changes.
Cycle Component Calculation: Percentage Deviation (cycle_pct) calculated as the difference between the current price and the trend, divided by the trend, and then multiplied by 100. This metric shows how far the price deviates from the trend in relative terms. Price Difference (cycle_price) simply the difference between the current price and the trend component, displaying the deviation in absolute price units.
Conditional Plotting: The user can choose to view the cycle component as either a percentage or a price difference by selecting the Display Mode input. The indicator will plot the chosen mode in a separate pane, helping traders focus on the preferred measure of deviation.
How to Use This Indicator
Identify Overbought/Oversold Conditions: When the cycle component deviates significantly from the zero line (shown with a dashed horizontal line), it may indicate overbought or oversold conditions. For instance, a high positive cycle component suggests the price may be overbought relative to the trend, while a large negative cycle suggests potential oversold conditions.
Mean-Reversion Strategy: In mean-reverting markets, traders can use this indicator to spot potential reversal points. For example, if the cycle component shows an extreme deviation from zero, it could signal that the price is likely to revert to the trend. This can help traders with entry and exit points when the asset is expected to correct back toward its trend.
Trend Strength and Cycle Analysis: By comparing the magnitude and duration of deviations, traders can gauge the strength of cycles and assess if a new trend might be forming. If the cycle component remains consistently positive or negative, it may indicate a persistent market bias, even as prices fluctuate around the trend.
Percentage vs. Price Difference Views: Use the Percentage Difference mode to standardize deviations and compare across assets or different timeframes. This is especially helpful when analyzing assets with varying price levels. Use the Price Difference mode when an absolute deviation (price units) is more intuitive for spotting overbought/oversold levels based on the asset’s actual price.
Using with Hodrick-Prescott: You can also use Hodrick-Prescott, another indicator that I have adapted to the Tradingview platform, to see the trend on the chart, and you can also use this indicator to see how far the price is deviating from the trend. This gives you a multifaceted perspective on your trades.
Practical Tips for Traders
Set the Smoothness Parameter (λ): Adjust the λ parameter to match your trading timeframe and asset characteristics. Lower values make the trend more sensitive, which might suit short-term trading, while higher values smooth out the trend for long-term analysis.
Cycle Component as Confirmation: Combine this indicator with other momentum or trend indicators for confirmation of overbought/oversold signals. For example, use the cycle component with RSI or MACD to validate the likelihood of mean-reversion.
Observe Divergences: Divergences between price movements and the cycle component can indicate potential reversals. If the price hits a new high, but the cycle component shows a smaller deviation than previous highs, it could signal a weakening trend.
Dual price forecast with Projection Zone [FXSMARTLAB]The Dual Price Forecast with Projection Zone indicator is built to simulate potential future price paths based on historical price movements over two defined lookback periods. By running multiple trials (or simulations) on these historical price movements, the indicator achieves a more robust forecast, incorporating the inherent variability of price behavior.
Key Components and Calculation Details
1. Lookback Periods and Historical Price Movements
Lookback Period 1 and Lookback Period 2 specify the range of past data used to generate each projection. For each period, the indicator calculates the price variations (differences between the closing and opening prices) and stores these in arrays.
These historical price variations capture the volatility and price patterns within each period, serving as templates for future price behavior.
2. Trials: Purpose and Function
The trials are a critical element in the projection calculation. Each trial represents a single simulation of possible future price movements, derived from a random reordering of the historical price variations in each lookback period.
By running multiple trials , the indicator explores various sequences of historical movements, simulating different possible future paths. Each trial adds to the projection’s robustness by capturing a unique potential price path based on past behavior.
Running these multiple trials allows the indicator to account for randomness in price behavior, making the projections more comprehensive by covering a range of scenarios rather than relying on a single deterministic forecast.
3. Reverse Option
The reverse option allows the indicator to invert the direction of price movements within each lookback period. When enabled, historical uptrends are treated as downtrends, and vice versa.
This feature is particularly valuable in scenarios where traders expect a potential reversal in market direction. By enabling the reverse option, the indicator can simulate what might happen if past trends inverted, providing an alternative forecast path that considers possible market reversals.
This allows traders to assess both continuation and reversal scenarios, giving them a more balanced view of potential future price paths and helping them prepare for either market direction.
4. Generating the Average Projection Path
Once the trials are complete, the indicator calculates an average projected price path for each lookback period by averaging the results of all trials. This average represents the most likely price trend based on historical data and provides a smoothed projection that mitigates extreme outliers.
By averaging across all trial paths, the indicator generates a more reliable and balanced forecast line, smoothing out the fluctuations that might appear if only one trial or a small number of trials were used.
5. Projection Zone Visualization
The indicator plots the two average projection paths (one for each lookback period) as Projection 1 and Projection 2, each in a user-defined color.
The Projection Zone is the area between these two lines, filled with a semi-transparent color. This zone visually represents the potential range of future price movement, highlighting where prices are likely to oscillate if historical trends persist.
The Projection Zone effectively functions as a potential support and resistance boundary, providing traders with a visual reference for possible price fluctuations within a specific range.
6. Display of Lookback Zones
To give context to the projections, the indicator can also display colored lookback zones on the chart. These zones correspond to Lookback Period 1 and Lookback Period 2 and are color-coded to match their respective projection lines.
These zones allow traders to see the sections of historical data used in the calculation, helping them understand which past price behaviors influenced the current projections.
Benefits of the Indicator
The "Dual Price Forecast with Projection Zone" indicator provides a multi-scenario forecast based on past price dynamics. Its use of trials ensures that projections are not based on a single deterministic path but on a range of possible scenarios that better reflect the inherent randomness in financial markets.
By generating a probabilistic forecast within a defined zone, the indicator helps traders to:
Anticipate potential price ranges and areas of support/resistance based on historical trends.
Understand the influence of different timeframes (short-term and long-term lookbacks) on future price behavior.
Make informed decisions by visualizing the likely variability of future prices within a controlled projection zone.
Prepare for both continuation and reversal scenarios, thanks to the reverse option. This feature is especially useful in markets where trends may change direction, as it allows traders to explore what might happen
MMRI Chart (Primary)The **Mannarino Market Risk Indicator (MMRI)** is a financial risk measurement tool created by financial strategist Gregory Mannarino. It’s designed to assess the risk level in the stock market and economy based on current bond market conditions and the strength of the U.S. dollar. The MMRI considers factors like the U.S. 10-Year Treasury Yield and the Dollar Index (DXY), which indicate investor confidence in government debt and the dollar's purchasing power, respectively.
The formula for MMRI uses the 10-Year Treasury Yield multiplied by the Dollar Index, divided by a constant (1.61) to normalize the risk measure. A higher MMRI score suggests increased market risk, while a lower score indicates more stability. Mannarino has set certain thresholds to interpret the MMRI score:
- **Below 100**: Low risk.
- **100–200**: Moderate risk.
- **200–300**: High risk.
- **Above 300**: Extreme risk, indicating market instability and potential downturns.
This tool aims to provide insight into economic conditions that may affect asset classes like stocks, bonds, and precious metals. Mannarino often updates MMRI scores and risk analyses in his public market updates.
Quick scan for cycles🙏🏻
The followup for
As I told before, ML based algorading is all about detecting any kind of non-randomness & exploiting it (cuz allegedly u cant trade randomness), and cycles are legit patterns that can be leveraged
But bro would u really apply Fourier / Wavelets / 'whatever else heavy' on every update of thousands of datasets, esp in real time on HFT / nearly HFT data? That's why this metric. It works much faster & eats hell of a less electicity, will do initial rough filtering of time series that might contain any kind of cyclic behaviour. And then, only on these filtered datasets u gonna put Periodograms / Autocorrelograms and see what's going there for real. Better to do it 10x times less a day on 10x less datasets, right?
I ended up with 2 methods / formulas, I called em 'type 0' and 'type 1':
- type 0: takes sum of abs deviations from drift line, scales it by max abs deviation from the same drift line;
- type 1: takes sum of abs deviations from drift line, scales it by range of non-abs deviations from the same drift line.
Finnaly I've chosen type 0 , both logically (sum of abs dev divided by max abs dev makes more sense) and experimentally. About that actually, here are both formulas put on sine waves with uniform noise:
^^ generated sine wave with uniform noise
^^ both formulas on that wave
^^ both formulas on real data
As you can see type 0 is less affected by noise and shows higher values on synthetic data, but I decided to put type 1 inside as well, in case my analysis was not complete and on real data type 1 can actually be better since it has a lil higher info gain / info content (still not sure). But I can assure u that out of all other ways I've designed & tested for quite a time I tell you, these 2 are really the only ones who got there.
Now about dem thresholds and how to use it.
Both type 0 and type 1 can be modelled with Beta distribution, and based on it and on some obvious & tho non mainstream statistical modelling techniques, I got these thresholds, so these are not optimized overfitted values, but natural ones. Each type has 3 thresholds (from lowest to highest):
- typical value (turned off by default). aka basis ;
- typical deviation from typical value, aka deviation ;
- maximum modelled deviation from typical value (idk whow to call it properly for now, this is my own R&D), aka extension .
So when the metric is above one of these thresholds (which one is up to you, you'll read about it in a sec), it means that there might be a strong enough periodic signal inside the data, and the data got to be put through proper spectral analysis tools to confirm / deny it.
If you look at the pictures above again, you'll see gray signal, that's uniform noise. Take a look at it and see where does it sit comparing to the thresholds. Now you just undertand that picking up a threshold is all about the amount of false positives you care to withstand.
If you take basis as threshold, you'll get tons of false positives (that's why it's even turned off by default), but you'll almost never miss a true positive. If you take deviation as threshold, it's gonna be kinda balanced approach. If you take extension as threshold, you gonna miss some cycles, and gonna get only the strongest ones.
More true positives -> more false positives, less false positives -> less true positives, can't go around that mane
Just to be clear again, I am not completely sure yet, but I def lean towards type 0 as metric, and deviation as threshold.
Live Long and Prosper
P.S.: That was actually the main R&D of the last month, that script I've released earlier came out as derivative.
P.S.: These 2 are the first R&Ds made completely in " art-space", St. Petersburg. Come and see me, say wassup🤘🏻
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.
Asian Session ShadingDescription
The "Asian Session Shading" indicator is designed to highlight the trading hours of the Asian market session on TradingView charts. This script shades the background of the chart in a pale blue color to visually distinguish the time period of the Asian trading session. By using this indicator, traders can easily identify when the Asian session is active, helping them to analyze and make informed trading decisions based on time-specific market behavior.
Features
Customizable Timing: The session start and end times can be adjusted to fit different Asian market hours.
Visual Clarity: The pale blue shading helps to visually separate the Asian session from other trading sessions.
Easy to Use: Simple implementation with clear visual cues on the chart.
Best Use Cases
Market Analysis: Traders can use this indicator to analyze market movements and trends specific to the Asian trading session.
Trading Strategies: This tool can assist in developing and implementing trading strategies that take into account the unique characteristics of the Asian market.
Time Management: Helps traders to manage their trading schedule by clearly marking the start and end of the Asian session.
How to Use
Apply to Chart: Save and apply the indicator to your chart to see the shaded Asian session.
This indicator is particularly useful for forex traders, stock traders, and anyone looking to incorporate the Asian market's influence into their trading strategy.
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.
FS Scorpion TailKey Features & Components:
1. Custom Date & Chart-Based Controls
The software allows users to define whether they want signals to start on a specific date (useSpecificDate) or base calculations on the visible chart’s range (useRelativeScreenSumLeft and useRelativeScreenSumRight).
Users can input the number of stocks to buy/sell per signal and decide whether to sell only for profit.
2. Technical Indicators Used
EMA (Exponential Moving Average): Users can define the length of the EMA and specify if buy/sell signals should occur when the EMA is rising or falling.
MACD (Moving Average Convergence Divergence): MACD crossovers, slopes of the MACD line, signal line, and histogram are used for generating buy/sell signals.
ATR (Average True Range): Signals are generated based on rising or falling ATR.
Aroon Indicator: Buy and sell signals are based on the behavior of the Aroon upper and lower lines.
RSI (Relative Strength Index): Tracks whether the RSI and its moving average are rising or falling to generate signals.
Bollinger Bands: Buy/sell signals depend on the basis, upper, and lower band behavior (rising or falling).
3. Signal Detection
The software creates arrays for each indicator to store conditions for buy/sell signals.
The allTrue() function checks whether all conditions for buy/sell signals are true, ensuring that only valid signals are plotted.
Signals are differentiated between buy-only, sell-only, and both buy and sell (dual signal).
4. Visual Indicators
Vertical Lines: When buy, sell, or dual signals are detected, vertical lines are drawn at the corresponding bar with configurable colors (green for buy, red for sell, silver for dual).
Buy/Sell Labels: Visual labels are plotted directly on the chart to denote buy or sell signals, allowing for clear interpretation of the strategy.
5. Cash Flow & Metrics Display
The software maintains an internal ledger of how many stocks are bought/sold, their prices, and whether a profit is being made.
A table is displayed at the bottom right of the chart, showing:
Initial investment
Current stocks owned
Last buy price
Market stake
Net profit
The table background turns green for profit and red for loss.
6. Dynamic Decision Making
Buy Condition: If a valid buy signal is generated, the software decrements the cash balance and adds stocks to the inventory.
Sell Condition: If the sell signal is valid (and meets the profit requirement), stocks are sold, and cash is incremented.
A fallback check ensures the sell logic prevents selling more stocks than are available and adjusts stock holding appropriately (e.g., sell half).
Customization and Usage
Indicator Adjustments: The user can choose which indicators to activate (e.g., EMA, MACD, RSI) via input controls. Each indicator has specific customizable parameters such as lengths, slopes, and conditions.
Signal Flexibility: The user can adjust conditions for buying and selling based on various technical indicators, which adds flexibility in implementing trading strategies. For example, users may require the RSI to be higher than its moving average or trigger sales only when MACD crosses under the signal line.
Profit Sensitivity: The software allows the option to sell only when a profit is assured by checking if the current price is higher than the last buy price.
Summary of Usage:
Indicator Selection: Enable or disable technical indicators like EMA, MACD, RSI, Aroon, ATR, and Bollinger Bands to fit your trading strategy.
Custom Date/Chart Settings: Choose whether to calculate based on specific time ranges or visible portions of the chart.
Dynamic Signal Plotting: Once buy or sell conditions are met, the software will visually plot signals on your chart, giving clear entry and exit points.
Investment Tracking: Real-time tracking of stock quantities, investments, and profit ensures a clear view of your trading performance.
Backtesting: Use this software for backtesting your strategy by analyzing how buy and sell signals would have performed historically based on the chosen indicators.
Conclusion
The FS Scorpion Tail software is a robust and flexible trading tool, allowing traders to develop custom strategies based on multiple well-known technical indicators. Its visual aid, coupled with real-time investment tracking, makes it valuable for systematic traders looking to automate or refine their trading approach.