Adaptive Smooth EMA [MacroGlide]Adaptive Smooth EMA is a powerful indicator designed to track and smooth market prices using Adaptive Exponential Moving Averages (EMAs) with dynamic phase adjustment. This tool helps traders analyze price trends and identify shifts in market momentum, making it easier to recognize potential reversals and trend continuations.
Key Features:
• Adaptive EMA Calculation: The indicator calculates multiple EMAs with adaptive smoothing based on volatility, allowing traders to capture the market's movement more accurately. These smoothed values adjust dynamically with the market, making trend detection more precise.
• Dynamic Phase Adjustment: The phase of the EMA is adjusted in real-time according to the market's volatility, ensuring that the smoothing remains responsive to changes in market conditions, reducing lag and enhancing signal clarity.
• Customizable Color Gradients: The indicator uses color gradients to visually distinguish between uptrends and downtrends, making it easier to spot shifts in market direction. Users can customize the color scheme for better visual representation and interpretation.
How to Use:
• Add the indicator to your chart and adjust the EMA length and phase adjustment settings according to your trading strategy.
• Monitor the color shifts to quickly identify potential changes in trend direction. The transition between the uptrend and downtrend colors can signal momentum shifts.
• Utilize the different EMA lengths to analyze short-term and long-term trends. The smaller EMAs will react quicker to price changes, while the longer ones provide a smoother view of the overall trend.
Methodology:
The Adaptive Smooth EMA indicator computes multiple EMAs with lengths ranging from 3 to 90 periods, dynamically adjusting the phase based on market volatility. This adaptive approach allows the indicator to respond effectively to both calm and volatile market conditions, providing a more accurate reflection of current trends. By smoothing the price data while maintaining responsiveness to market changes, the indicator helps traders avoid false signals and make more informed decisions.
Originality and Usefulness:
Adaptive Smooth EMA stands out due to its ability to dynamically adjust to market conditions, offering an adaptive smoothing approach that reduces noise while capturing essential price movements. This makes it particularly useful for identifying trends, reversals, and optimizing entry and exit points in a trading strategy.
Charts:
The indicator plots a series of smoothed EMA lines, each with a unique color gradient reflecting market sentiment. These lines help visualize price trends across different timeframes, providing a comprehensive view of the market's directional strength and momentum. The gradient color transitions further enhance the clarity of trend shifts, offering an easy-to-interpret chart for traders.
Enjoy the game!
Indicators and strategies
KAMA CloudDescription:
The KAMA Cloud indicator is a sophisticated trading tool designed to provide traders with insights into market trends and their intensity. This indicator is built on the Kaufman Adaptive Moving Average (KAMA), which dynamically adjusts its sensitivity to filter out market noise and respond to significant price movements. The KAMA Cloud leverages multiple KAMAs to gauge trend direction and strength, offering a visual representation that is easy to interpret.
How It Works:
The KAMA Cloud uses twenty different KAMA calculations, each set to a distinct lookback period ranging from 5 to 100. These KAMAs are calculated using the average of the open, high, low, and close prices (OHLC4), ensuring a balanced view of price action. The relative positioning of these KAMAs helps determine the direction of the market trend and its momentum.
By measuring the cumulative relative distance between these KAMAs, the indicator effectively assesses the overall trend strength, akin to how the Average True Range (ATR) measures market volatility. This cumulative measure helps in identifying the trend’s robustness and potential sustainability.
The visualization component of the KAMA Cloud is particularly insightful. It plots a 'cloud' formed between the base KAMA (set at a 100-period lookback) and an adjusted KAMA that incorporates the cumulative relative distance scaled up. This cloud changes color based on the trend direction — green for upward trends and red for downward trends, providing a clear, visual representation of market conditions.
Benefits:
Dynamic Sensitivity: By adapting to the market's volatility, KAMA provides more reliable signals than traditional moving averages.
Trend Clarity: The color-coded cloud visually enhances the perception of the trend’s direction and strength, making it easier for traders to decide on their trading strategy.
Versatility: Suitable for various asset classes, including stocks, forex, commodities, and cryptocurrencies, across different timeframes.
Decision Support: Helps traders understand not just the direction but the strength of trends, aiding in more informed decision-making regarding entries, exits, and risk management.
Usage:
The KAMA Cloud is ideal for traders who need a robust trend-following tool that adjusts according to market dynamics. It can be used as a standalone indicator or in conjunction with other technical analysis tools to enhance trading strategies. Look for the cloud’s color shifts as potential signals for trend reversals or continuations, and consider the cloud’s thickness as an indication of trend strength.
Whether you are a day trader, swing trader, or long-term investor, the KAMA Cloud offers a unique approach to understanding market trends, helping you navigate the complexities of various market conditions with confidence.
ADX + Volume Strategy### Strategy Description: ADX and Volume-Based Trading Strategy
This strategy is designed to identify strong market trends using the **Average Directional Index (ADX)** and confirm trading signals with **Volume**. The idea behind the strategy is to enter trades only when the market shows a strong trend (as indicated by ADX) and when the price movement is supported by high trading volume. This combination helps filter out weaker signals and provides more reliable entries into positions.
### Key Indicators:
1. **ADX (Average Directional Index)**:
- **Purpose**: ADX is a technical indicator that measures the strength of a trend, regardless of its direction (up or down).
- **Usage**: The strategy uses ADX to determine whether the market is trending strongly. If ADX is above a certain threshold (default is 25), it indicates that a strong trend is present.
- **Directional Indicators**:
- **DI+ (Directional Indicator Plus)**: Indicates the strength of the upward price movement.
- **DI- (Directional Indicator Minus)**: Indicates the strength of the downward price movement.
- ADX does not indicate the direction of the trend but confirms that a trend exists. DI+ and DI- are used to determine the direction.
2. **Volume**:
- **Purpose**: Volume is a key indicator for confirming the strength of a price movement. High volume suggests that a large number of market participants are supporting the movement, making it more likely to continue.
- **Usage**: The strategy compares the current volume to the 20-period moving average of the volume. The trade signal is confirmed if the current volume is greater than the average volume by a specified **Volume Multiplier** (default multiplier is 1.5). This ensures that the trade is supported by strong market participation.
### Strategy Logic:
#### **Entry Conditions:**
1. **Long Position** (Buy):
- **ADX** is above the threshold (default is 25), indicating a strong trend.
- **DI+ > DI-**, signaling that the market is trending upward.
- The **current volume** is greater than the 20-period average volume multiplied by the **Volume Multiplier** (e.g., 1.5), indicating that the upward price movement is backed by sufficient market activity.
2. **Short Position** (Sell):
- **ADX** is above the threshold (default is 25), indicating a strong trend.
- **DI- > DI+**, signaling that the market is trending downward.
- The **current volume** is greater than the 20-period average volume multiplied by the **Volume Multiplier** (e.g., 1.5), indicating that the downward price movement is backed by strong selling activity.
#### **Exit Conditions**:
- Positions are closed when the opposite signal appears:
- **For long positions**: Close when the short conditions are met (ADX still above the threshold, DI- > DI+, and the volume condition holds).
- **For short positions**: Close when the long conditions are met (ADX still above the threshold, DI+ > DI-, and the volume condition holds).
### Parameters:
- **ADX Period**: The period used to calculate ADX (default is 14). This controls how sensitive the ADX is to price movements.
- **ADX Threshold**: The minimum ADX value required for the strategy to consider the market trend as strong (default is 25). Higher values focus on stronger trends.
- **Volume Multiplier**: This parameter adjusts how much higher the current volume needs to be compared to the 20-period moving average for the signal to be valid. A value of 1.5 means the current volume must be 50% higher than the average volume.
### Example Trade Flow:
1. **Long Trade Example**:
- ADX > 25, confirming a strong trend.
- DI+ > DI-, confirming that the trend direction is upward.
- The current volume is 50% higher than the 20-period average volume (multiplied by 1.5).
- **Action**: Enter a long position.
2. **Short Trade Example**:
- ADX > 25, confirming a strong trend.
- DI- > DI+, confirming that the trend direction is downward.
- The current volume is 50% higher than the 20-period average volume.
- **Action**: Enter a short position.
### Strengths of the Strategy:
- **Trend Filtering**: The strategy ensures that trades are only taken when the market is trending strongly (confirmed by ADX) and that the price movement is supported by high volume, reducing the likelihood of false signals.
- **Volume Confirmation**: Using volume as confirmation provides an additional layer of reliability, as volume spikes often accompany sustained price moves.
- **Dual Signal Confirmation**: Both trend strength (ADX) and volume conditions must be met for a trade, making the strategy more robust.
### Weaknesses of the Strategy:
- **Limited Effectiveness in Range-Bound Markets**: Since the strategy relies on strong trends, it may underperform in sideways or non-trending markets where ADX stays below the threshold.
- **Lagging Nature of ADX**: ADX is a lagging indicator, which means that it may confirm the trend after it has already begun, potentially leading to late entries.
- **Volume Requirement**: In low-volume markets, the volume multiplier condition may not be met often, leading to fewer trade opportunities.
### Customization:
- **Adjust the ADX Threshold**: You can raise the threshold if you want to focus only on very strong trends, or lower it to capture moderate trends.
- **Adjust the Volume Multiplier**: You can change the multiplier to be more or less strict. A higher multiplier (e.g., 2.0) will require a stronger volume spike to confirm the signal, while a lower multiplier (e.g., 1.2) will allow more trades with weaker volume confirmation.
### Summary:
This ADX and Volume strategy is ideal for traders who want to follow strong trends while ensuring that the trend is supported by high trading volume. By combining a trend strength filter (ADX) and volume confirmation, the strategy aims to increase the probability of entering profitable trades while reducing the number of false signals. However, it may underperform in range-bound markets or in markets with low volume.
Previous Day Close (PVC)Indicator Description: Previous Day Close
This indicator visually represents the previous day's closing price, providing traders with a clear reference point on the chart. By marking this key level, it enhances your ability to analyze stock price movements and make informed trading decisions.
Key Features:
Visual Clarity: The previous day's close is prominently displayed, making it easy to spot significant price levels at a glance.
Enhanced Analysis: Use this indicator to identify potential support and resistance levels based on historical closing prices.
User-Friendly: Designed for simplicity, this indicator integrates seamlessly into your trading workflow.
Leverage the power of the previous day’s close to improve your trading strategy and gain a competitive edge in the market!
Options Series - NonOverlay_Technical
⭐ 1. Purpose:
The script is designed to show technical indicators in a non-overlay form using candlestick representations. It combines multiple popular technical analysis tools to gauge the market's bullish or bearish conditions.
⭐ 2. Indicators:
The script uses several indicators across different timeframes: Exponential Moving Averages (EMA) for 5, 20, 50 periods. Simple Moving Average (SMA) for 200 periods. RSI (Relative Strength Index) for momentum. VWAP (Volume Weighted Average Price) for average price evaluation. PSAR (Parabolic SAR) for trend direction. Daily and multi-day (2-day and 3-day) data for broader market context.
⭐ 3. Candlestick Representation:
The script uses color-coded candlesticks to visually represent various indicators and their bullish/bearish states: Green candlesticks for bullish conditions. Red candlesticks for bearish conditions. Neutral/transparent for non-significant conditions.
⭐ 4. Important Conditions:
It calculates bullish and bearish conditions for each indicator: MA20: When the price is above or below the 20-period EMA. RSI: When RSI is above or below 50. VWAP: When the price is above or below the VWAP. PSAR: When the price is above or below the PSAR. 2-day and 3-day Moving Averages: Evaluating the broader trend.
⭐ 5. Bullish vs. Bearish Calculation:
The script sums up bullish and bearish signals to determine the overall market condition: Current_logical_bull: Counts the number of bullish indicators. Current_logical_bear: Counts the number of bearish indicators. The script compares these values to conclude whether the market is more bullish or bearish.
⭐ 6. Visual Plotting:
The script uses plotcandle to display the non-overlay signals at different levels for each condition, stacked vertically from MA20 to PSAR. Additionally, a master candle combines all indicators to show an overall market trend.
⭐ 7. Neon Effect on MA20:
It adds a neon-like effect to the MA20 line, making it visually prominent: A standard plot line with the base color. Two additional neon layers with increasing transparency to enhance the effect.
⭐ 8. Daily Timeframes and Lookahead:
The script fetches daily data using the lookahead feature to get a broader view of the market trend. It tracks the previous day’s and two days' data for comparison.
⭐ 9. Labels and Customization:
The script dynamically adds labels to the chart for the different plotted indicators at the last bar, making it easier to identify which indicator is being represented.
🚀 Conclusion:
The script combines multiple technical indicators, such as EMA, RSI, VWAP, PSAR, and multi-day moving averages, to visually assess bullish and bearish market conditions. It uses color-coded candlesticks to represent each indicator and sums up the signals to determine the overall trend.
Trend Following ADX + Parabolic SAR### Strategy Description: Trend Following using **ADX** and **Parabolic SAR**
This strategy is designed to follow market trends using two popular indicators: **Average Directional Index (ADX)** and **Parabolic SAR**. The strategy attempts to enter trades when the market shows a strong trend (using ADX) and confirms the trend direction using the Parabolic SAR. Here's a breakdown:
### Key Indicators:
1. **ADX (Average Directional Index)**:
- **Purpose**: ADX measures the strength of a trend, regardless of direction.
- **Usage**: The strategy uses ADX to confirm that the market is trending. When ADX is above a certain threshold (e.g., 25), it indicates a strong trend.
- **Directional Indicators**:
- **DI+ (Directional Indicator Plus)**: Indicates upward movement strength.
- **DI- (Directional Indicator Minus)**: Indicates downward movement strength.
2. **Parabolic SAR**:
- **Purpose**: Parabolic SAR is a trend-following indicator used to identify potential reversals in the price direction.
- **Usage**: It provides specific price points above or below which the strategy confirms buy or sell signals.
### Strategy Logic:
#### **Entry Conditions**:
1. **Long Position** (Buy):
- **ADX** is above the threshold (default: 25), indicating a strong trend.
- **DI+ > DI-**, indicating the upward trend is stronger than the downward.
- The price is above the **Parabolic SAR** level, confirming the upward trend.
2. **Short Position** (Sell):
- **ADX** is above the threshold (default: 25), indicating a strong trend.
- **DI- > DI+**, indicating the downward trend is stronger than the upward.
- The price is below the **Parabolic SAR** level, confirming the downward trend.
#### **Exit Conditions**:
- Positions are closed when an opposite signal is detected.
- For example, if a long position is open and the conditions for a short position are met, the long position is closed, and a short position is opened.
### Parameters:
1. **ADX Period**: Defines the length of the period for the ADX calculation (default: 14).
2. **ADX Threshold**: The minimum value of ADX to confirm a strong trend (default: 25).
3. **Parabolic SAR Start**: The initial step for the SAR (default: 0.02).
4. **Parabolic SAR Increment**: The step increment for SAR (default: 0.02).
5. **Parabolic SAR Max**: The maximum step for SAR (default: 0.2).
### Example Trade Flow:
#### **Long Trade**:
1. ADX > 25, confirming a strong trend.
2. DI+ > DI-, indicating the market is trending upward.
3. The price is above the Parabolic SAR, confirming the upward direction.
4. **Action**: Enter a long (buy) position.
5. Exit the long position when a short signal is triggered (i.e., DI- > DI+, price below Parabolic SAR).
#### **Short Trade**:
1. ADX > 25, confirming a strong trend.
2. DI- > DI+, indicating the market is trending downward.
3. The price is below the Parabolic SAR, confirming the downward direction.
4. **Action**: Enter a short (sell) position.
5. Exit the short position when a long signal is triggered (i.e., DI+ > DI-, price above Parabolic SAR).
### Strengths of the Strategy:
- **Trend-Following**: It performs well in markets with strong trends, whether upward or downward.
- **Dual Confirmation**: The combination of ADX and Parabolic SAR reduces false signals by ensuring both trend strength and direction are considered before entering a trade.
### Weaknesses:
- **Range-Bound Markets**: This strategy may perform poorly in choppy, non-trending markets because both ADX and SAR are trend-following indicators.
- **Lagging Nature**: Since both ADX and SAR are lagging indicators, the strategy may enter trades after the trend has already started, potentially missing early profits.
### Customization:
- **ADX Threshold**: You can increase the threshold if you only want to trade in very strong trends, or lower it to capture more moderate trends.
- **SAR Parameters**: Adjusting the SAR `start`, `increment`, and `max` values will make the Parabolic SAR more or less sensitive to price changes.
### Summary:
This strategy combines the ADX and Parabolic SAR to take advantage of strong market trends. By confirming both trend strength (ADX) and trend direction (Parabolic SAR), it aims to enter high-probability trades in trending markets while minimizing false signals. However, it may struggle in sideways or non-trending markets.
For Educational purposes only !!!
Cypher Harmonic Pattern [TradingFinder] Cypher Pattern Detector🔵 Introduction
The Cypher Pattern is one of the most accurate and advanced harmonic patterns, introduced by Darren Oglesbee. The Cypher pattern, utilizing Fibonacci ratios and geometric price analysis, helps traders identify price reversal points with high precision. This pattern consists of five key points (X, A, B, C, and D), each playing an important role in determining entry and exit points in the financial markets.
The reversal point typically occurs in the XD region, with the Fibonacci ratio ranging between 0.768 and 0.886. This zone is referred to as the Potential Reversal Zone (PRZ), where traders anticipate price changes to occur.
The Cypher harmonic pattern is popular among professional traders due to its high accuracy in identifying market trends and reversal points. The pattern appears in two forms: bullish Cypher pattern and bearish Cypher pattern.
In the bullish Cypher pattern, after a price correction, the price moves upward, while in the bearish Cypher pattern, the price moves downward after a temporary increase. These patterns help traders use technical analysis to identify strong reversal points in the PRZ and execute more optimal trades.
Bullish Cypher Pattern :
Bearish Cypher Pattern :
🔵 How to Use
The Cypher pattern is one of the most complex and precise harmonic patterns, leveraging Fibonacci ratios to help traders identify price reversals. This pattern is comprised of five key points, each playing a critical role in determining entry and exit points.
The Cypher pattern appears in two main types :
Bullish Cypher pattern : This pattern appears as an M shape on the chart and indicates a trend reversal to the upside after a price correction. Traders can prepare for buying after identifying this pattern in technical analysis.
Bearish Cypher pattern : This pattern appears as a W shape and signals the start of a downtrend after a temporary price increase. Traders can use this pattern to enter short positions.
🟣 How to Identify the Cypher Pattern on a Chart
Identifying the Cypher pattern requires precision and the use of advanced technical analysis tools. The pattern consists of four main legs, each identified using Fibonacci ratios and geometric analysis.
To spot the Cypher pattern on a chart, first, identify the five key points : X, A, B, C, and D.
XA leg : The initial move from point X to A.
AB leg : The first correction after the XA move, where the price moves to point B.
BC leg : After the correction, the price moves upwards to point C.
CD leg : The final price move that reaches point D, where a price reversal is expected.
In a bullish Cypher pattern, point D indicates the start of a new uptrend, while in a bearish Cypher pattern, point D signals the beginning of a downtrend. Correctly identifying these points helps traders determine the best time to enter a trade.
🟣 How to Trade Using the Cypher Pattern
Once the Cypher pattern is identified on the chart, traders can use it to set entry and exit points. Point D is the key point for trade entry. In the bullish Cypher pattern, the trader can enter a long position after point D forms, while in the bearish Cypher pattern, point D serves as the ideal point for entering a short position.
🟣 Entering a Buy Trade with the Bullish Cypher Pattern
In a bullish Cypher pattern, traders wait for the price to reach point D, after which they can enter a buy position. At this point, the price is expected to start rising.
🟣 Entering a Sell Trade with the Bearish Cypher Pattern
In a bearish Cypher pattern, the trader enters a sell position at point D, expecting the price to move downward after reaching this point. For additional confirmation, traders can use technical indicators such as RSI or MACD.
🟣 Risk Management in Cypher Pattern Trades
Risk management is one of the most critical aspects of any trade, and this holds true for trading the Cypher pattern. Traders should always use stop-loss orders to prevent larger losses in case the pattern fails.
In the bullish Cypher pattern, the stop-loss is usually placed slightly below point D to exit the trade if the price continues to drop.
In the bearish Cypher pattern, the stop-loss is placed above point D to limit losses if the price rises unexpectedly.
🟣 Combining the Cypher Pattern with Other Technical Tools
The Cypher pattern is a powerful tool in technical analysis, but combining it with other methods such as price action and technical indicators can improve trading accuracy.
🟣 Combining with Price Action
Traders can use price action to confirm the Cypher pattern. Candlestick patterns like reversal candlesticks can provide additional confirmation for price reversals at point D.
🟣 Using Technical Indicators
Incorporating technical indicators such as RSI and MACD can also help traders receive stronger signals for entering trades based on the Cypher pattern. These indicators help identify overbought or oversold conditions, allowing traders to make more informed decisions.
🟣 Advantages and Disadvantages of the Cypher Pattern in Technical Analysis
Advantages :
High accuracy : The Cypher pattern, using Fibonacci ratios and geometric analysis, provides high precision in identifying reversal points.
Applicable in various markets : This pattern can be used in a wide range of financial markets, including forex, stocks, and cryptocurrencies.
Disadvantages :
Rarit y: The Cypher pattern appears less frequently on charts compared to other harmonic patterns.
Complexity : Accurately identifying this pattern requires significant experience, which may be challenging for novice traders.
🔵 Setting
🟣 Logical Setting
ZigZag Pivot Period : You can adjust the period so that the harmonic patterns are adjusted according to the pivot period you want. This factor is the most important parameter in pattern recognition.
Show Valid Forma t: If this parameter is on "On" mode, only patterns will be displayed that they have exact format and no noise can be seen in them. If "Off" is, the patterns displayed that maybe are noisy and do not exactly correspond to the original pattern.
Show Formation Last Pivot Confirm : if Turned on, you can see this ability of patterns when their last pivot is formed. If this feature is off, it will see the patterns as soon as they are formed. The advantage of this option being clear is less formation of fielded patterns, and it is accompanied by the latest pattern seeing and a sharp reduction in reward to risk.
Period of Formation Last Pivot : Using this parameter you can determine that the last pivot is based on Pivot period.
🟣 Genaral Setting
Show : Enter "On" to display the template and "Off" to not display the template.
Color : Enter the desired color to draw the pattern in this parameter.
LineWidth : You can enter the number 1 or numbers higher than one to adjust the thickness of the drawing lines. This number must be an integer and increases with increasing thickness.
LabelSize : You can adjust the size of the labels by using the "size.auto", "size.tiny", "size.smal", "size.normal", "size.large" or "size.huge" entries.
🟣 Alert Setting
Alert : On / Off
Message Frequency : This string parameter defines the announcement frequency. Choices include: "All" (activates the alert every time the function is called), "Once Per Bar" (activates the alert only on the first call within the bar), and "Once Per Bar Close" (the alert is activated only by a call at the last script execution of the real-time bar upon closing). The default setting is "Once per Bar".
Show Alert Time by Time Zone : The date, hour, and minute you receive in alert messages can be based on any time zone you choose. For example, if you want New York time, you should enter "UTC-4". This input is set to the time zone "UTC" by default.
🔵 Conclusion
The Cypher harmonic pattern is one of the most powerful and accurate patterns used in technical analysis. Its high precision in identifying price reversal points, particularly within the Potential Reversal Zone (PRZ), has made it a popular tool among professional traders. The PRZ, located between the Fibonacci ratios of 0.768 and 0.886 in the XD region, offers traders a clear indication of where price reversals are likely to occur.
However, to use this pattern successfully, traders must employ proper risk management and combine it with supplementary tools like technical indicators and price action. By understanding how to utilize the PRZ, traders can enhance the accuracy of their trade entries and exits.
Ultimately, the Cypher pattern, when used in conjunction with the PRZ, helps traders make more precise decisions in the financial markets, leading to more successful and well-informed trades.
Prometheus Topological Persistent EntropyPersistence Entropy falls under the branch of math topology. Topology is a study of shapes as they twist and contort. It can be useful in the context of markets to determine how volatile they may be and different from the past.
The key idea is to create a persistence diagram from these log return segments. The persistence diagram tracks the "birth" and "death" of price features:
A birth occurs when a new price pattern or feature emerges in the data.
A death occurs when that pattern disappears.
By comparing prices within each segment, the script tracks how long specific price features persist before they die out. The lifetime of each feature (difference between death and birth) represents how robust or fleeting the pattern is. Persistent price features tend to reflect stable trends, while shorter-lived features indicate volatility.
Entropy Calculation: The lifetimes of these patterns are then used to compute the entropy of the system. Entropy, in this case, measures the amount of disorder or randomness in the price movements. The more varied the lifetimes, the higher the entropy, indicating a more volatile market. If the price patterns exhibit longer, more consistent lifetimes, the entropy is lower, signaling a more stable market.
Calculation:
We start by getting log returns for a user defined look back value. In the compute_persistent_entropy function we separate the overall log returns into windows. We then compute persistence diagrams of the windows. It tracks the birth and death of price patterns to see how persistent they are. Then we calculate the entropy of the windows.
After we go through that process we get an array of entropies, we then smooth it by taking the sum of all of them and dividing it by how many we have so the indicator can function better.
// Calculate log returns
log_returns = array.new()
for i = 1 to lgr_lkb
array.push(log_returns, math.log(close / close ))
// Function to compute a simplified persistence diagram
compute_persistence_diagram(segment) =>
n = array.size(segment)
lifetimes = array.new()
for i = 0 to n - 1
for j = i + 1 to n - 1
birth = array.get(segment, i)
death = array.get(segment, j-1)
if birth != death
array.push(lifetimes, math.abs(death - birth))
lifetimes
// Function to compute entropy of a list of values
compute_entropy(values) =>
n = array.size(values)
if n == 0
0.0
else
freq_map = map.new()
total_sum = 0.0
for i = 0 to n - 1
value = array.get(values, i)
//freq_map := freq_map.get(value, 0.0) + 1
map.put(freq_map, value, value + 1)
total_sum += 1
entropy = 0.0
for in freq_map
p = count / total_sum
entropy -= p * math.log(p)
entropy
compute_persistent_entropy(log_returns, window_size) =>
n = (lgr_lkb) - (2 * window_size) + 1
entropies = array.new()
for i = 0 to n - 1
segment1 = array.new()
segment2 = array.new()
for j = 0 to window_size - 1
array.push(segment1, array.get(log_returns, i + j))
array.push(segment2, array.get(log_returns, i + window_size + j))
dgm1 = compute_persistence_diagram(segment1)
dgm2 = compute_persistence_diagram(segment2)
combined_diagram = array.concat(dgm1, dgm2)
entropy = compute_entropy(combined_diagram)
array.push(entropies, entropy)
entropies
//---------------------------------------------
//---------------PE----------------------------
//---------------------------------------------
// Calculate Persistent Entropy
entropies = compute_persistent_entropy(log_returns, window_size)
smooth_pe = array.sum(entropies) / array.size(entropies)
This image illustrates how the indicator works for traders. The purple line is the actual indicator value. The line that changes from green to red is a SMA of the indicator value, we use this to determine bullish or bearish. When the smoothed persistence entropy is above it’s SMA that signals bearishness.
The indicator tends to look prettier on higher time frames, we see NASDAQ:TSLA on a 4 hour here and below we see it on the 5 minute.
On a lower time frame it looks a little weird but still functions the same way.
Prometheus encourages users to use indicators as tools along with their own discretion. No indicator is 100% accurate. We encourage comments about requested features and criticism.
Prior Day High/Low and Highest High/Lowest LowFeatures:
Prior Day High and Low:
The script tracks and displays the previous trading day's high and low prices. These levels can serve as important areas of support or resistance, helping traders to make informed decisions about potential price reversals or breakouts.
Highest High and Lowest Low Over N Days:
This indicator also tracks and displays the highest high and lowest low over the last N days, where N is user-configurable. This allows traders to see broader trends in price action and identify key levels for potential trend changes.
User-Configurable Inputs:
Show Prior Day High/Low: Toggle whether to display the prior day’s high and low levels.
Days to Consider for Highest High/Lowest Low: Define the number of days over which the highest high and lowest low are calculated.
Show Highest High/Lowest Low: Toggle whether to display the highest high and lowest low levels over the specified period.
Low Source and High Source: Customize the data sources for the high and low values.
Automatic Data Handling:
The script automatically tracks the daily high and low prices, storing them in arrays, and calculates the highest and lowest prices over the user-specified number of days. When a new day begins, the prior day's data is saved, and the calculations are updated accordingly.
Visual Display:
The indicator uses distinct colors and plotting styles:
Prior day’s high and low are plotted as blue circles.
The highest high over N days is plotted as a red circle.
The lowest low over N days is plotted as a green circle.
This indicator helps traders stay informed about significant price levels, which are often used in trading strategies for breakouts, trend following, or reversals.
Forex - Lot size calculatorThis indicator is specifically designed for Forex traders who need a convenient lot size calculator directly on their charts. It allows users to input their account balance, risk percentage, and stop-loss distance in pips to easily determine the appropriate lot size for a given trade, ensuring effective risk management.
Key Features:
Lot Size Calculation: Automatically calculates the lot size based on user-defined inputs: account balance, risk percentage, and stop-loss distance.
Error Handling: The indicator only works with Forex pairs. If applied to non-Forex assets, a clear and prominent red error message will appear in the bottom-right corner of the chart, reminding the user that this script is intended exclusively for Forex trading.
Simple Visualization: The calculated lot size is displayed in an easy-to-read table directly on the chart.
How to Use:
Add the indicator to a Forex chart.
Enter your account balance, risk percentage, and stop-loss pips in the input fields.
The indicator will display the calculated lot size for the chosen Forex pair.
Important Notes:
This script is intended only for Forex assets. If used on other instruments (e.g., stocks, crypto, indices), an error message will be shown.
Always validate lot sizes with your broker, as there can be slight variations depending on broker specifications and leverage settings.
SMI Ergodic Indicator/Oscillator of Money Flow Index▮ Introduction
The Stochastic Momentum Index Ergodic (SMII) indicator is a technical analysis tool designed to predict trend reversals in the price of an asset.
It functions as a momentum oscillator, measuring the ratio of the smoothed price change to the smoothed absolute price change over a given number of previous periods.
The Ergodic SMI is based on the True Strength Index (TSI) and integrates a signal line, which is an exponential moving average (EMA) of the SMI indicator itself.
The Ergodic SMI oscillator provides a clearer picture of market trends than the traditional stochastic oscillator by incorporating the concept of 'ergodicity', which helps remove market noise.
On ther other hand, MFI (Money Flow Index) is a technical analysis indicator used to measure the inflow of money into an asset and thus help identify buying and selling pressure in a given financial instrument.
When these two indicators are combined, they can provide a more comprehensive view of price direction and market strength.
▮ Motivation: why another indicator?
By combining SMII with MFI, we can gain even more insights into the market.
One way to do this is to use the MFI as an input to the SMII, rather than just using price.
This means we are measuring momentum based on buying and selling pressure rather than just price.
Furthermore, there is the possibility of making several fine adjustments to both the calculation and visualization parameters that are not present in other indicators.
▮ What to look for
When using the SMII MFI indicator, there are a few things to look out for.
First, look at the SMII signal line.
When the line crosses above -40, it is considered a buy signal, while the crossing below +40 is considered a sell signal.
Also, pay attention to divergences between the SMII and the price.
If price is rising but the SMII is showing negative divergence, it could indicate that momentum is waning and a reversal could be in the offing.
Likewise, if price is falling but the SMII is showing positive divergence, this could indicate that momentum is building and a reversal could also be in the offing.
Divergences can be considered in both indicator and/or histogram.
Examples:
▮ Notes
The indicator presented here offers both the 'SMII' and the 'SMIO', that is, the 'Stochastic Momentum Index Ergodic Indicator' together with the 'Stochastic Momentum Index Ergodic Oscillator' (histogram), as per the documentation described in reference links.
So it is important to highlight the differences in relation to my other indicator, the 'Stochastic Momentum Index (SMI) of Money Flow Index (MFI)':
This last one is purely based on the SMI , which is implemented using SMA smoothing for the relative range and the high/low range.
Although they may seem the same in some situations, the calculation is actually different. The TSI tends to be more responsive at the expense of being noisier, while the SMI tends to be smoother. Which of these two indicators is best depends on the situation, the context, and the analyst's personal preference.
Please refer to reference links to more info.
▮ References
SMI documentation
SMII documentation
SMIO documentation
MFI documentation
Zero-Lag MA Trend Levels [ChartPrime] The Zero-Lag MA Trend Levels indicator combines a Zero-Lag Moving Average (ZLMA) with a standard Exponential Moving Average (EMA) to provide a dynamic view of the market trend. This indicator uses a color-changing cloud to represent shifts in trend momentum and plots key levels when trend reversals are detected. The addition of trend level boxes helps identify significant price zones where market shifts occur, with retest signals aiding in spotting potential continuation or reversal points.
⯁ KEY FEATURES & HOW TO USE
⯌ Zero-Lag Moving Average (ZLMA) with EMA Cloud :
The indicator employs a Zero-Lag Moving Average (ZLMA) alongside a standard EMA.
series float emaValue = ta.ema(close, length) // EMA of the closing price
series float correction = close + (close - emaValue) // Correction factor for zero-lag calculation
series float zlma = ta.ema(correction, length) // Zero-Lag Moving Average (ZLMA)
The cloud between these averages changes color depending on the trend direction. During a downtrend, if the ZLMA begins to increase, the cloud partially turns green, signaling potential strength. Conversely, during an uptrend, if the ZLMA decreases, the cloud partially turns to the downtrend color (blue by default), indicating potential weakness.
Use : Traders can monitor the cloud's color shifts for early signs of changing momentum. A fully colored cloud aligning with the current trend indicates a strong directional move, while mixed colors suggest a potential trend change.
⯌ Trend Shift and Level Boxes :
Each time a crossover between the EMA and the ZLMA occurs, indicating a trend shift, the indicator plots a box around the price level where the shift occurred. This box remains on the chart to mark the price zone of the trend change.
Use : The boxes provide clear visual markers of where market sentiment shifted. These levels can act as support and resistance zones. Traders can use these boxes to identify potential entry or exit points when the market retests these key levels.
⯌ Retest Detection with Labels :
If the price action crosses a previously plotted trend level box, the indicator marks this event with triangle labels. An upward triangle (▲) appears when the price retests the top of a box during a bullish crossover, and a downward triangle (▼) appears when the price retests the bottom of a box during a bearish crossunder.
Use : These labels help traders identify potential continuation or reversal points at critical price levels, offering additional confirmation for trading decisions.
⯌ Dynamic Color-Coding :
The color of the ZLMA and the EMA is adjusted according to their current trend direction, with the ZLMA adopting green for upward trends and blue for downward trends. This visual representation makes it easier to quickly gauge the market's momentum at a glance.
Use : Traders can use the color-coding to quickly assess the strength and direction of the current trend, allowing for more informed decision-making.
⯁ USER INPUTS
Length : Sets the period for both the ZLMA and EMA calculations.
Trend Levels : Toggle to display the trend level boxes on the chart.
Colors (+ / -) : Define the colors for bullish and bearish trends.
⯁ CONCLUSION
The Zero-Lag MA Trend Levels - ChartPrime indicator offers a nuanced approach to trend detection by combining the ZLMA with a traditional EMA. Its dynamic cloud color changes, trend level boxes, and retest labels make it a versatile tool for traders seeking to identify trend shifts and key price zones effectively. By incorporating elements of support and resistance along with trend momentum, this indicator provides a comprehensive view of market dynamics for both trend-following and counter-trend trading strategies.
Bubbles Volume [BigBeluga]The Bubbles Volume indicator is an innovative visualization tool designed to represent trading volume in a more intuitive and visually appealing manner. By displaying volume as bubbles of varying sizes and colors on the price chart, this indicator helps traders quickly identify significant volume levels and potential areas of interest.
Important Note:
For correct visual representation of indicator, layout it to front:
🔵 KEY FEATURES
● Volume Bubbles
Represents trading volume as bubbles on the price chart
Bubble size increases with higher volume levels
Color intensity changes based on volume significance
Provides an intuitive visual representation of volume distribution
● Heatmap Coloring
Optional feature to color bubbles based on volume intensity
Uses a color gradient from cool (low volume) to hot (high volume) colors
Helps quickly identify extremely high volume areas
● Significant Volume Levels
Option to display horizontal lines at significant volume levels
Shows volume amount as labels for highly significant levels
Helps identify potential support/resistance areas based on volume
Volume Levels:
Levels with HeatMap:
Levels without Volume Bubles:
● Normalized Volume Calculation
Uses normalized volume to account for overall market volume trends
Provides a more accurate representation of volume significance
🔵 HOW TO USE
● Volume Analysis
Larger bubbles indicate higher trading volume
Clusters of large bubbles may suggest areas of high interest or potential reversals
Use in conjunction with price action to identify potential breakouts or fakeouts
● Trend Confirmation
Strong trends often show increasing bubble sizes in the trend direction
Diminishing bubble sizes might indicate weakening trends
● Support and Resistance
Significant volume levels (displayed as lines) can act as potential support/resistance
Pay attention to price reactions at these levels for trading opportunities
● Divergences
Look for divergences between price action and bubble sizes
Price making new highs/lows with smaller bubbles might indicate weakening momentum
● Volatility Assessment
Periods with consistently large bubbles indicate high volatility
Can be used to adjust trading strategies or position sizing
🔵 CUSTOMIZATION
The Bubbles Volume indicator offers several customization options:
Toggle bubble display on/off
Adjust volume threshold for filtering low volume bubbles
Enable/disable heatmap coloring for enhanced visual analysis
Show/hide significant volume levels
Adjust the number of significant levels displayed
Customize colors to suit personal preferences
By fine-tuning these settings, traders can adapt the indicator to various market conditions and personal analysis preferences.
The Bubbles Volume indicator provides a unique and intuitive way to visualize trading volume directly on the price chart. This approach allows traders to quickly identify areas of significant trading activity and potential price levels of interest without the need for a separate volume sub-chart.
This tool can be particularly useful for traders focusing on volume analysis, breakout strategies, or those looking to confirm price action with volume. The visual nature of the bubbles makes it easy to spot volume patterns and anomalies at a glance, potentially leading to faster and more informed trading decisions.
As with all technical indicators, it's recommended to use the Bubbles Volume indicator in conjunction with other forms of analysis and within the context of a well-defined trading strategy. While this indicator provides valuable volume insights, it should be considered alongside other factors such as overall market trends, price patterns, and fundamental analysis when making trading decisions.
Boosted Moving AverageOverview:
The Boosted Moving Average (BMA) is designed to enhance the traditional Exponential Moving Average (EMA) by introducing a boositng factor that amplifies its responsiveness to price changes. This means that the BMA will react more quickly to significant market movements, while still maintaining a smooth trajectory.
Key Features:
Boost Factor Sensitivity: Adjust the BMA's reactivity to price movements. A higher boost factor makes it more responsive, ideal for traders who want to catch price shifts early.
Dual EMA Calculation: The BMA combines two EMAs with different lengths to create a divergence that forms the basis for boosted values. This dual approach helps refine entry and exit points.
Smoothing: After boosting, the moving average is smoothed using another EMA, ensuring you get the clearest possible signal without over-complicating things.
Bullish/Bearish Coloring: The plot changes color based on the current trend, making it easy to visualize market direction:
How It Works:
The script calculates two EMAs: one with the given length and one with half that length.
The boost factor amplifies the difference between these two EMAs to provide an enhanced signal.
A final EMA is applied to smooth the resulting boosted moving average, ensuring clarity in market direction.
Color-coded trends make it easy to see if the market is bullish (green) or bearish (red).
Iceberg Trade Revealer [CHE]Unveiling Iceberg Trades: A Deep Dive into Low Volatility Market Phases
Introduction
In the dynamic world of trading, hidden forces often influence market movements in ways that aren't immediately apparent. One such force is the phenomenon of iceberg trades—large orders that are concealed to prevent significant market impact. This presentation explores the concept of iceberg trades, explains why they are typically hidden during periods of low volatility, and introduces an indicator designed to reveal these elusive trades.
Agenda
1. Understanding Iceberg Trades
- Definition and Purpose
- Impact on Market Dynamics
2. The Low Volatility Concealment
- Why Low Volatility Phases?
- Strategies Behind Hiding Large Orders
3. Introducing the Iceberg Trade Revealer Indicator
- How the Indicator Works
- Key Components and Calculations
4. Demonstration and Use Cases
- Interpreting the Indicator Signals
- Practical Trading Applications
5. Conclusion
- Summarizing the Insights
- Q&A Session
1. Understanding Iceberg Trades
Definition and Purpose
- Iceberg Trades are large single orders divided into smaller lots to disguise the total order quantity.
- Traders use iceberg orders to minimize market impact and avoid unfavorable price movements.
Impact on Market Dynamics
- Concealed Volume: Iceberg orders hide true supply and demand levels.
- Price Stability: They prevent sudden spikes or drops by releasing orders gradually.
- Market Sentiment: Their presence can influence perceptions of market strength or weakness.
2. The Low Volatility Concealment
Why Low Volatility Phases?
- Less Market Attention: Low volatility periods attract fewer traders, making it easier to conceal large orders.
- Reduced Slippage: Prices are more stable, reducing the risk of executing orders at unfavorable prices.
- Strategic Advantage: Large players can accumulate or distribute positions without tipping off the market.
Strategies Behind Hiding Large Orders
- Order Splitting: Breaking down large orders into smaller pieces.
- Time Slicing: Executing orders over an extended period.
- Algorithmic Trading: Using sophisticated algorithms to optimize order execution.
3. Introducing the Iceberg Trade Revealer Indicator
How the Indicator Works
- Core Thesis: Iceberg trades can be detected by analyzing periods of unusually low volatility.
- Volatility Analysis: Uses the Average True Range (ATR) and Bollinger Bands to identify low volatility phases.
- Signal Generation: Marks periods where iceberg trades are likely occurring.
Key Components and Calculations
1. Average True Range (ATR)
- Measures market volatility over a specified period.
- Lower ATR values indicate less price movement.
2. Bollinger Bands
- Creates a volatility envelope around the ATR.
- Bands tighten during low volatility and widen during high volatility.
3. Timeframe Adjustments
- Utilizes multiple timeframes to enhance signal accuracy.
- Options for auto, multiplier, or manual timeframe selection.
4. Signal Conditions
- Iceberg Trade Detection: ATR falls below the lower Bollinger Band.
- Revealed Volatility: ATR rises above the upper Bollinger Band, indicating potential market moves after iceberg trades.
4. Demonstration and Use Cases
Interpreting the Indicator Signals
- Iceberg Trade Zones: Highlighted areas where large hidden orders are likely.
- Revealed Volatility Zones: Areas indicating the market's response to the execution of iceberg trades.
Practical Trading Applications
- Entry and Exit Points: Use signals to time trades alongside institutional activity.
- Risk Management: Adjust strategies during detected low volatility phases.
- Market Analysis: Gain insights into underlying market mechanics.
5. Conclusion
Summarizing the Insights
- Iceberg Trades play a significant role in market movements, especially when concealed during low volatility phases.
- The Iceberg Trade Revealer Indicator provides a tool to uncover these hidden activities, offering traders a strategic edge.
- Understanding and utilizing this indicator can enhance trading decisions by aligning them with the actions of major market players.
Best regards Chervolino ( Volker )
Q&A Session
- Questions and Discussions: Open the floor for any queries or further explanations.
Thank You!
By delving into the hidden aspects of market activity, traders can better navigate the complexities of financial markets. The Iceberg Trade Revealer Indicator serves as a bridge between observable market data and the concealed strategies of large institutions.
References
- Average True Range (ATR): A technical analysis indicator that measures market volatility.
- Bollinger Bands: A volatility indicator that creates a band of three lines which are plotted in relation to a security's price.
- Iceberg Orders: Large orders divided into smaller lots to hide the actual order quantity.
Note: Always consider multiple factors when making trading decisions. Indicators provide tools, but they do not guarantee results.
Educational Content Disclaimer:
Disclaimer:
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Hma Swing Points | viResearchHma Swing Points | viResearch
Conceptual Foundation and Innovation
The "Hma Swing Points" script introduces a simple yet effective method for identifying key swing points in the market using Hull Moving Averages (HMA). The Hull Moving Average is a faster and smoother alternative to traditional moving averages, making it ideal for detecting significant price swings. By applying HMA to both high and low prices, the script identifies swing highs and lows, providing traders with visual cues for potential trend reversals or continuations. This approach helps traders recognize turning points in the market with minimal lag, allowing for more precise entries and exits.
Technical Composition and Calculation
This script uses two Hull Moving Averages—one for the high prices and another for the low prices. These HMAs offer smoother trend detection while filtering out market noise. The script identifies the highest and lowest HMA values over a user-defined lookback period to determine the swing high and swing low points. Long signals are generated when the current HMA of the highs matches the highest value within the lookback period, while short signals are generated when the HMA of the lows matches the lowest value. These signals are plotted on the chart, and alerts can be set to notify the trader of possible entry or exit points.
Features and User Inputs
The script offers several customizable inputs to adjust its sensitivity and behavior according to the trader’s preferences. The lookback period defines the number of bars used to calculate the highest and lowest HMA values, allowing traders to control how responsive the script is to price changes. The length of the Hull Moving Average can also be modified, giving traders flexibility in smoothing the indicator. Additionally, optional bar color settings provide visual cues, with bullish and bearish trends highlighted. Alerts are included to notify traders when long or short swing points are detected, ensuring they are informed even when not actively monitoring the chart.
Practical Applications
The "Hma Swing Points" script is useful for traders who aim to identify critical market turning points and potential reversals. It is especially effective in trending markets where price swings present trading opportunities. Traders can use the script to detect reversals by spotting swing points that indicate a possible shift from bullish to bearish trends, or vice versa. The script also helps confirm ongoing trends by showing the strength of swings, allowing traders to make informed decisions about entering or exiting trades. Its ability to mark precise swing points enhances trade timing, helping traders optimize their entries and exits.
Advantages and Strategic Value
The script offers a streamlined approach to detecting swing points with the speed and smoothness of the Hull Moving Average. This makes it easier to filter out false signals and noise, improving the accuracy of trend identification. The customizable inputs allow traders to tailor the script for different assets and market conditions, making it versatile for various trading styles. By highlighting key swing points, the script provides traders with clear visual signals for potential reversals and trend confirmations, enhancing their ability to follow and act on market movements.
Summary and Usage Tips
Incorporating the "Hma Swing Points" script into a trading strategy helps traders identify market reversals and continuation points more effectively. Adjusting the lookback period and HMA length ensures the script adapts to different assets and market conditions. The alert system ensures traders don’t miss key swing points. As always, backtesting is important to evaluate the script’s performance under various market conditions, and past results may not guarantee future outcomes.
Magic Touch Line DetectorSummary of the Magic Touch Line Detector Script:
Purpose:
The Magic Touch Line Detector script is designed to identify significant price points in the market by analyzing candlestick wicks and bodies. It plots lines based on the detected wicks, classifying them as either ascending or descending. The script tracks how frequently price touches these lines and highlights the "most touched" lines for both ascending and descending categories. This script is particularly useful for traders looking to identify key price levels and trends over time.
How It Works:
Wick and Body Detection:
The script starts by analyzing the highs and lows of candlestick wicks relative to their bodies over a user-defined lookback period. A significant wick is identified based on a specified wick-to-body ratio and a deviation threshold measured against the Average True Range (ATR).
Line Creation:
Once a significant upper or lower wick is detected, the script calculates unconventional highs and lows (i.e., points that differ from the absolute highs and lows of the lookback period). Lines are then drawn from these unconventional price points using the slope between the detected wick and the current bar, ensuring a smooth extension.
Line Refinement and Touch Tracking:
As new bars are added, the script tracks how often the price touches the previously drawn lines. The number of touches each line receives is counted and updated in real-time, and the script ensures that only the most touched line is highlighted.
Highlighting and Labeling:
For each category (ascending and descending), the most touched line is identified and given special highlighting with thicker lines and different colors. Labels are also generated to show the number of touches that the most touched line has received. Old labels are cleared to avoid clutter.
Explanation of the Settings:
Lookback Period for Highs and Lows:
This sets the number of bars the script will use to detect the highest highs and lowest lows. A larger lookback period gives the script a broader context to work with, potentially identifying more significant price points.
Minimum Wick-to-Body Ratio:
This ratio determines what qualifies as a "significant" wick. It compares the length of the wick to the body of the candle. A higher ratio means that only wicks that are much longer than the candle body will be considered significant.
Price Deviation Threshold (in ATR multiples):
This setting controls how much price deviation from the ATR is required for a wick to be deemed significant. It acts as a filter to reduce noise by ignoring smaller wicks that are within normal price movements.
Line Touch Tolerance Factor (ATR multiple):
When checking if a price touches a line, the script uses this setting to define how close the price must be to the line to count as a "touch." This tolerance is a multiplier of the ATR, allowing for some flexibility in what is considered a touch.
Price Difference Threshold:
This defines the minimum price difference required to plot a line. If the price difference between the high and low of a detected wick is too small, the script can avoid plotting a line for insignificant moves.
Slope Adjustment Multiplier:
This multiplier adjusts the slope of the lines that are drawn from detected price points. It affects the length and angle of the lines, allowing users to control how far and at what angle the lines should extend across the chart.
Customization Options:
Show Ascending/Descending Lines:
These toggles allow users to decide whether ascending (bullish) or descending (bearish) lines should be shown on the chart.
Line Color, Style, and Width (for Ascending and Descending Lines):
These settings give users control over how the lines appear visually. You can customize the color, style (solid, dashed, dotted), and width of both ascending and descending lines.
Most Touched Line Color:
Users can define a different color for the "most touched" line, which is automatically identified by the script. This setting helps highlight the line that has been interacted with the most by the price.
How to Use the Script:
Setup the Lookback Period and Deviation Filters:
Start by setting the lookback period and the filters for wick-to-body ratio and deviation threshold. These settings help control the script's sensitivity to market movements.
Refine the Tolerance and Slope:
Adjust the line touch tolerance and slope adjustment multiplier to control how closely the script tracks price touches and how the lines are extended on the chart.
Customize Visuals:
Once the lines are being drawn, customize the colors, styles, and widths to ensure the lines are easy to read on your chart. You can also decide if you want to display both ascending and descending lines or focus on just one.
By setting up the script based on these inputs and parameters, you can get a real-time view of significant price levels and how often the price interacts with them, helping you make more informed trading decisions.
Support, Resistance & Liquidity Pool ZonesSupport, Resistance & Liquidity Pool Zones
This indicator automatically detects and plots support and resistance levels based on pivot points and highlights liquidity pool zones, areas where the trading volume exceeds the average over a set number of bars. It is designed to help traders identify key price levels and liquidity traps that can trigger significant market reactions.
Key Features:
Support & Resistance Levels:
The indicator identifies pivot highs and pivot lows as potential resistance and support levels, respectively.
You can customize the number of levels shown on the chart, making it easier to focus on the most recent and relevant price levels.
Liquidity Pool Zones:
The script detects liquidity pool zones, which are areas with above-average trading volume. These zones often act as regions of interest where price accumulation or distribution occurs, potentially leading to significant price moves.
Liquidity zones are shaded to help traders visually identify areas of high interest in the market.
Customizable Settings:
You can adjust the pivot period to fine-tune how the indicator calculates support and resistance.
Control the number of support/resistance levels displayed on the chart and the period used to detect liquidity pools.
Customize the colors for support, resistance, and liquidity zones to match your charting preferences.
Alerts:
The script includes built-in alerts for when the price breaks above resistance or falls below support, helping traders catch key breakout opportunities.
How It Works:
The script calculates support and resistance levels using pivot highs and lows based on the user-defined pivot period.
It monitors liquidity pool zones by comparing the current trading volume with the average volume over a customizable period. When the volume exceeds the set threshold, a liquidity pool zone is highlighted, providing insight into where the market may accumulate or distribute.
Alerts are triggered when the price breaks above the first resistance level or falls below the first support level, giving traders immediate notification of key market events.
How to Use:
Tune the Pivot Period: Adjust the pivot period to your preferred time horizon (default: 10 bars).
Set Liquidity Pool Parameters: Customize the number of bars considered for liquidity pool detection and the volume multiplier to detect high-volume zones.
Monitor Breakouts: Use the built-in alerts to catch potential breakout or breakdown opportunities near support and resistance levels.
This script is ideal for traders looking for an easy-to-use tool to visualize support and resistance levels and liquidity pools, aiding in decision-making and trade management.
WSITEEE Imbalance/FVG (FAIR VALUE GAP)Imbalance/FVG (Fair Value Gap) refers to a price imbalance, representing a range on the chart where little liquidity was provided.
Imbalance implies a strong impulsive movement of a candle, which the price almost always returns to cover.
The best analogy would be to imagine painting a wall with a roller. If you move the roller from top to bottom, what remains on the wall? That’s right, gaps that need to be filled. How do you fill them? Exactly, by moving the roller from bottom to top. The same principle applies to imbalance.
How do you correctly mark an Imbalance?
The first thing we need to find on the chart is three candles, one of which should be impulsive. Next, using the “Fibonacci Retracement” tool, we stretch it from the wick of the first candle to the wick of the last candle.
Imbalance can be used both for determining context and as an entry model. On a higher timeframe, it acts as a point of interest (POI), within which you can look for factors to build a position.
This Pine Script is designed for Smart Money traders who work with Fair Value Gaps (FVG). FVGs are three-candle patterns where the third candle does not fully overlap the first, leaving a gap on the second candle. The script helps to automatically detect these gaps and highlight them on the chart with different colors based on their status and type.
It allows for the visualization of imbalances on the chart, highlighting key zones that can serve as important levels for decision-making. With flexible color and label settings, the script can be tailored to individual needs, enhancing data visualization on the chart.
Fibonacci Swing Trading BotStrategy Overview for "Fibonacci Swing Trading Bot"
Strategy Name: Fibonacci Swing Trading Bot
Version: Pine Script v5
Purpose: This strategy is designed for swing traders who want to leverage Fibonacci retracement levels and candlestick patterns to enter and exit trades on higher time frames.
Key Components:
1. Multiple Timeframe Analysis:
The strategy uses a customizable timeframe for analysis. You can choose between 4hour, daily, weekly, or monthly time frames to fit your preferred trading horizon. The high and low-price data is retrieved from the selected timeframe to identify swing points.
2. Fibonacci Retracement Levels:
The script calculates two key Fibonacci retracement levels:
0.618: A common level where price often retraces before resuming its trend.
0.786: A deeper retracement level, often used to identify stronger support/resistance areas.
These levels are dynamically plotted on the chart based on the highest high and lowest low over the last 50 bars of the selected timeframe.
3. Candlestick Based Entry Signals:
The strategy uses candlestick patterns as the only indicator for trade entries:
Bullish Candle: A green candle (close > open) that forms between the 0.618 retracement level and the swing high.
Bearish Candle: A red candle (close < open) that forms between the 0.786 retracement level and the swing low.
When these candlestick patterns align with the Fibonacci levels, the script triggers buy or sell signals.
4. Risk Management:
Stop Loss: The stop loss is set at 1% below the entry price for long trades and 1% above the entry price for short trades. This tight risk management ensures controlled losses.
Take Profit: The strategy uses a 2:1 risk-to-reward ratio. The take profit is automatically calculated based on this ratio relative to the stop loss.
5. Buy/Sell Logic:
Buy Signal: Triggered when a bullish candle forms above the 0.618 retracement level and below the swing high. The bot then places a long position.
Sell Signal: Triggered when a bearish candle forms below the 0.786 retracement level and above the swing low. The bot then places a short position.
The stop loss and take profit levels are automatically managed once the trade is placed.
Strengths of This Strategy:
Swing Trading Focus: The strategy is ideal for swing traders, targeting longer-term price moves that can take days or weeks to play out.
Simple Yet Effective Indicators: By only relying on Fibonacci retracement levels and basic candlestick patterns, the strategy avoids complexity while capitalizing on well-known support and resistance zones.
Automated Risk Management: The built-in stop loss and take profit mechanism ensures trades are protected, adhering to a strict 2:1 risk/reward ratio.
Multiple Timeframe Analysis: The script adapts to various market conditions by allowing users to switch between different timeframes (4hour, daily, weekly, monthly), giving traders flexibility.
Strategy Use Cases:
Retracement Traders: Traders who focus on entering the market at key retracement levels (0.618 and 0.786) will find this strategy especially useful.
Trend Reversal Traders: The strategy’s reliance on candlestick formations at Fibonacci levels helps traders spot potential reversals in price trends.
Risk Conscious Traders: With its 1% risk per trade and 2:1 risk/reward ratio, the strategy is ideal for traders who prioritize risk management in their trades.
Elder AutoEnvelope with Overbought/Oversold Levels with LabelsThe **"Elder AutoEnvelope with Overbought/Oversold Levels with Labels"** is a technical analysis tool designed to help identify overbought and oversold levels in the market, as well as potential reversal points. It uses moving averages and price volatility to detect possible price extremes.
### Indicator Description:
- **Center EMA (26)**: Acts as the main trend line.
- **Envelope Channels**: These are constructed around the central EMA using the current price volatility. The main channel lines are determined by multiplying the standard deviation of the price by the chosen multiplier.
- **Additional Overbought/Oversold Levels**: Displayed on the chart with different colors and thicknesses to highlight small, moderate, strong, and very strong levels.
- **Labels**: Show specific levels when the price reaches areas of overbought or oversold conditions.
### How to Apply in Practice:
1. **Identifying Extremes**: The indicator shows areas where the price is considered overbought or oversold relative to the current trend. When the price touches or exceeds these levels, it can indicate a potential reversal or correction.
2. **Entry/Exit Signals**:
- **Entry on Oversold**: If the price reaches the lower Envelope lines (especially at strong or very strong oversold levels), it may be a good buying signal.
- **Exit on Overbought**: If the price touches the upper lines (especially at strong or very strong overbought levels), it signals a potential selling opportunity.
3. **Combining with Other Indicators**: It’s recommended to use this indicator alongside oscillators like RSI or MACD for signal confirmation.
4. **Trend Analysis**: The central EMA (26) helps identify the trend direction. If the price is above it, the trend is considered bullish; if below, bearish.
This indicator is particularly useful in volatile markets and helps detect price movements near highs or lows.
(Early Test) Weekly Seasonality with Dynamic Kelly Criterion# Enhancing Trading Strategies with the Weekly Seasonality Dynamic Kelly Criterion Indicator
Amidst this pursuit to chase price, a common pitfall emerges: an overemphasis on price movements without adequate attention to risk management, probabilistic analysis, and strategic position sizing. To address these challenges, I developed the **Weekly Seasonality with Dynamic Kelly Criterion Indicator**. It is designed to refocus traders on essential aspects of trading, such as risk management and probabilistic returns, thereby catering to both short-term swing traders and long-term investors aiming for tax-efficient positions.
## The Motivation Behind the Indicator
### Overemphasis on Price: A Common Trading Pitfall
Many traders concentrate heavily on price charts and technical indicators, often neglecting the underlying principles of risk management and probabilistic analysis. This overemphasis on price can lead to:
- **Overtrading:** Making frequent trades based solely on price movements without considering the associated risks.
- **Poor Risk Management:** Failing to set appropriate stop-loss levels or position sizes, increasing the potential for significant losses.
- **Emotional Trading:** Letting emotions drive trading decisions rather than objective analysis, which can result in impulsive and irrational trades.
### The Need for Balanced Focus
To achieve sustained trading success, it is crucial to balance price analysis with robust risk management and probabilistic strategies. Key areas of focus include:
1. **Risk Management:** Implementing strategies to protect capital, such as setting stop-loss orders and determining appropriate position sizes based on risk tolerance.
2. **Probabilistic Analysis:** Assessing the likelihood of various market outcomes to make informed trading decisions.
3. **Swing Trading Percent Returns:** Capitalizing on short- to medium-term price movements by buying assets below their average return and selling them above.
## Introducing the Weekly Seasonality with Dynamic Kelly Criterion Indicator
The **Weekly Seasonality with Dynamic Kelly Criterion Indicator** is designed to integrate these essential elements into a comprehensive tool that aids traders in making informed, risk-aware decisions. Below, we explore the key components and functionalities of this indicator.
### Key Components of the Indicator
1. **Average Return (%)**
- **Definition:** The mean percentage return for each week across multiple years.
- **Purpose:** Serves as a benchmark to identify weeks with above or below-average performance, guiding buy and sell decisions.
2. **Positive Percentage (%)**
- **Definition:** The proportion of weeks that yielded positive returns.
- **Purpose:** Indicates the consistency of positive returns, helping traders gauge the reliability of certain weeks for trading.
3. **Volatility (%)**
- **Definition:** The standard deviation of weekly returns.
- **Purpose:** Measures the variability of returns, providing insights into the risk associated with trading during specific weeks.
4. **Kelly Ratio**
- **Definition:** A mathematical formula used to determine the optimal size of a series of bets to maximize the logarithmic growth of capital.
- **Purpose:** Balances potential returns against risks, guiding traders on the appropriate position size to take.
5. **Adjusted Kelly Fraction**
- **Definition:** The Kelly Ratio adjusted based on user-defined risk tolerance and external factors like Federal Reserve (Fed) stance.
- **Purpose:** Personalizes the Kelly Criterion to align with individual risk preferences and market conditions, enhancing risk management.
6. **Position Size ($)**
- **Definition:** The calculated amount to invest based on the Adjusted Kelly Fraction.
- **Purpose:** Ensures that position sizes are aligned with risk management strategies, preventing overexposure to any single trade.
7. **Max Drawdown (%)**
- **Definition:** The maximum observed loss from a peak to a trough of a portfolio, before a new peak is attained.
- **Purpose:** Assesses the worst-case scenario for losses, crucial for understanding potential capital erosion.
### Functionality and Benefits
- **Weekly Data Aggregation:** Aggregates weekly returns across multiple years to provide a robust statistical foundation for decision-making.
- **Quarterly Filtering:** Allows users to filter weeks based on quarters, enabling seasonality analysis and tailored strategies aligned with specific timeframes.
- **Dynamic Risk Adjustment:** Incorporates the Dynamic Kelly Criterion to adjust position sizes in real-time based on changing risk profiles and market conditions.
- **User-Friendly Visualization:** Presents all essential metrics in an organized Summary Table, facilitating quick and informed decision-making.
## The Origin of the Kelly Criterion and Addressing Its Limitations
### Understanding the Kelly Criterion
The Kelly Criterion, developed by John L. Kelly Jr. in 1956, is a formula used to determine the optimal size of a series of bets to maximize the long-term growth of capital. The formula considers both the probability of winning and the payout ratio, balancing potential returns against the risk of loss.
**Kelly Formula:**
\
Where:
- \( b \) = the net odds received on the wager ("b to 1")
- \( p \) = probability of winning
- \( q \) = probability of losing ( \( q = 1 - p \) )
### The Risk of Ruin
While the Kelly Criterion is effective in optimizing growth, it carries inherent risks:
- **Overbetting:** If the input probabilities or payout ratios are misestimated, the Kelly Criterion can suggest overly aggressive position sizes, leading to significant losses.
- **Assumption of Constant Probabilities:** The criterion assumes that probabilities remain constant, which is rarely the case in dynamic markets.
- **Ignoring External Factors:** Traditional Kelly implementations do not account for external factors such as Federal Reserve rates, margin requirements, or market volatility, which can impact risk and returns.
### Addressing Traditional Limitations
Recognizing these limitations, the **Weekly Seasonality with Dynamic Kelly Criterion Indicator** introduces enhancements to the traditional Kelly approach:
- **Incorporation of Fed Stance:** Adjusts the Kelly Fraction based on the current stance of the Federal Reserve (neutral, dovish, or hawkish), reflecting broader economic conditions that influence market behavior.
- **Margin and Leverage Considerations:** Accounts for margin rates and leverage, ensuring that position sizes remain within manageable risk parameters.
- **Dynamic Adjustments:** Continuously updates position sizes based on real-time risk assessments and probabilistic analyses, mitigating the risk of ruin associated with static Kelly implementations.
## How the Indicator Aids Traders
### For Short-Term Swing Traders
Short-term swing traders thrive on capitalizing over weekly price movements. The indicator aids them by:
- **Identifying Favorable Weeks:** Highlights weeks with above-average returns and favorable volatility, guiding entry and exit points.
- **Optimal Position Sizing:** Utilizes the Adjusted Kelly Fraction to determine the optimal amount to invest, balancing potential returns with risk exposure.
- **Probabilistic Insights:** Provides metrics like Positive Percentage (%) and Kelly Ratio to assess the likelihood of favorable outcomes, enhancing decision-making.
### For Long-Term Tax-Free Investors
This is effectively a drop-in replacement for DCA which uses fixed position size that doesn't change based on market conditions, as a result, it's like catching multiple falling knifes by the blade and smiling with blood on your hand... I don't know about you, but I'd rather juggle by the hilt and look like an actual professional...
Long-term investors, especially those seeking tax-free positions (e.g., through retirement accounts), benefit from:
- **Consistent Risk Management:** Ensures that position sizes are aligned with long-term capital preservation strategies.
- **Seasonality Analysis:** Allows for strategic positioning based on historical performance trends across different weeks and quarters.
- **Dynamic Adjustments:** Adapts to changing market conditions, maintaining optimal risk profiles over extended investment horizons.
### Developers
Please double check the logic and functionality because I think there are a few issue and I need to crowd source solutions and be responsible about the code I publish. If you have corrections, please DM me or leave a respectful comment.
I want to publish this by the end of the year and include other things like highlighting triple witching weeks, adding columns for volume % stats, VaR and CVaR, alpha, beta (to see the seasonal alpha and beta based off a benchmark ticker and risk free rate ticker and other little goodies.
Trend Following Moron TFM 10% System
Trend Following Moron TFM 10% System
The TFM 10% Market Timing System
The Trend Following Moron TFM 10% System is a powerful trading tool designed using Pine Script™, following the principles outlined by Dave S. Landry. This script helps traders identify optimal entry and exit points based on moving averages and market trends.
What the Script Does:
Visual representation of trend strength.
As long as it is trending in green band, trend is very strong and price is contained within 5% of the high.
As price drops to yellow band, strength is weakening and caution is advised. Price is between 5% to 10% away from52 week high.
As price drops in red band, it is to be avoided as trend is rolling over. Price is more than 10% way from 52 week high.
Moving Averages Calculation:
Users can choose between Simple Moving Average (SMA) and Exponential Moving Average (EMA) for daily, weekly, and monthly periods. The script calculates the moving averages to provide trend direction.
Trend Color Coding:
Moving averages are displayed in different colors based on market conditions: green indicates an uptrend, red for a downtrend, and gray for neutral conditions.
Highs Calculation:
The script calculates the 52-week and 12-month closing highs, which are crucial for identifying potential breakout points.
Level Definition:
Traders can set levels based on either Average True Range (ATR) or percentage changes from these highs, allowing for flexible risk management strategies.
Buy and Sell Conditions:
The script defines specific buy conditions: when the price is within 10% of the highest close and trading above the moving averages, and sell conditions: when the price falls below these thresholds.
Visual Indicators:
Buy and sell signals are visually represented on the chart with arrows, making it easy for traders to see potential trading opportunities at a glance.
Performance Labels:
The script includes performance labels that track the number of bars above or below the moving averages and the percentage change from the moving average, providing users with key metrics to evaluate their trades.
Interactive Table:
A table summarizing the buy and sell rules is displayed on the chart, ensuring that traders have quick access to the system’s trading logic.
Benefits of Using the TFM 10% System:
Streamlined Decision Making:
The script simplifies the trading process by clearly outlining buy and sell signals, making it accessible even for novice traders.
Customizable Parameters:
Users can tailor the script to their preferences by adjusting moving average types and lengths, ATR levels, and percentage thresholds. Bands are interchange able for ATR and Percent below 52 week high for volatility looks. But buy and sell are fixed in 10% threshold.
Risk Management:
By utilizing ATR and percentage levels, traders can effectively manage their risk, making the trading process more systematic.
Comprehensive Market Analysis:
The combination of multiple time frames (daily, weekly, monthly) allows for a well-rounded analysis of market trends, enhancing trading accuracy.