Bayesian Trend Indicator [ChartPrime]Bayesian Trend Indicator
Overview:
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event.
The "Bayesian Trend Indicator" is a sophisticated technical analysis tool designed to assess the direction of price trends in financial markets. It combines the principles of Bayesian probability theory with moving average analysis to provide traders with a comprehensive understanding of market sentiment and potential trend reversals.
At its core, the indicator utilizes multiple moving averages, including the Exponential Moving Average (EMA), Simple Moving Average (SMA), Double Exponential Moving Average (DEMA), and Volume Weighted Moving Average (VWMA) . These moving averages are calculated based on user-defined parameters such as length and gap length, allowing traders to customize the indicator to suit their trading strategies and preferences.
The indicator begins by calculating the trend for both fast and slow moving averages using a Smoothed Gradient Signal Function. This function assigns a numerical value to each data point based on its relationship with historical data, indicating the strength and direction of the trend.
// Smoothed Gradient Signal Function
sig(float src, gap)=>
ta.ema(source >= src ? 1 :
source >= src ? 0.9 :
source >= src ? 0.8 :
source >= src ? 0.7 :
source >= src ? 0.6 :
source >= src ? 0.5 :
source >= src ? 0.4 :
source >= src ? 0.3 :
source >= src ? 0.2 :
source >= src ? 0.1 :
0, 4)
Next, the indicator calculates prior probabilities using the trend information from the slow moving averages and likelihood probabilities using the trend information from the fast moving averages . These probabilities represent the likelihood of an uptrend or downtrend based on historical data.
// Define prior probabilities using moving averages
prior_up = (ema_trend + sma_trend + dema_trend + vwma_trend) / 4
prior_down = 1 - prior_up
// Define likelihoods using faster moving averages
likelihood_up = (ema_trend_fast + sma_trend_fast + dema_trend_fast + vwma_trend_fast) / 4
likelihood_down = 1 - likelihood_up
Using Bayes' theorem , the indicator then combines the prior and likelihood probabilities to calculate posterior probabilities, which reflect the updated probability of an uptrend or downtrend given the current market conditions. These posterior probabilities serve as a key signal for traders, informing them about the prevailing market sentiment and potential trend reversals.
// Calculate posterior probabilities using Bayes' theorem
posterior_up = prior_up * likelihood_up
/
(prior_up * likelihood_up + prior_down * likelihood_down)
Key Features:
◆ The trend direction:
To visually represent the trend direction , the indicator colors the bars on the chart based on the posterior probabilities. Bars are colored green to indicate an uptrend when the posterior probability is greater than 0.5 (>50%), while bars are colored red to indicate a downtrend when the posterior probability is less than 0.5 (<50%).
◆ Dashboard on the chart
Additionally, the indicator displays a dashboard on the chart , providing traders with detailed information about the probability of an uptrend , as well as the trends for each type of moving average. This dashboard serves as a valuable reference for traders to monitor trend strength and make informed trading decisions.
◆ Probability labels and signals:
Furthermore, the indicator includes probability labels and signals , which are displayed near the corresponding bars on the chart. These labels indicate the posterior probability of a trend, while small diamonds above or below bars indicate crossover or crossunder events when the posterior probability crosses the 0.5 threshold (50%).
The posterior probability of a trend
Crossover or Crossunder events
◆ User Inputs
Source:
Description: Defines the price source for the indicator's calculations. Users can select between different price values like close, open, high, low, etc.
MA's Length:
Description: Sets the length for the moving averages used in the trend calculations. A larger length will smooth out the moving averages, making the indicator less sensitive to short-term fluctuations.
Gap Length Between Fast and Slow MA's:
Description: Determines the difference in lengths between the slow and fast moving averages. A higher gap length will increase the difference, potentially identifying stronger trend signals.
Gap Signals:
Description: Defines the gap used for the smoothed gradient signal function. This parameter affects the sensitivity of the trend signals by setting the number of bars used in the signal calculations.
In summary, the "Bayesian Trend Indicator" is a powerful tool that leverages Bayesian probability theory and moving average analysis to help traders identify trend direction, assess market sentiment, and make informed trading decisions in various financial markets.
Moyennes mobiles
Iron Cortex: Volume AnalysisDescription:
This Volume Analysis indicator is designed to identify potential buying and selling pressures in the market by analysing volume and price changes in conjunction with dual Exponential Moving Averages (EMAs).
Signal Identification:
Buying Pressure: This signal is identified when:
i) Volume is rising and the price is increasing.
ii) The current volume is above both the fast and slow EMAs of the volume.
iii) The fast EMA is above the slow EMA.
Selling Pressure: This signal is identified when:
i) Volume is rising and the price is decreasing.
ii) The current volume is above both the fast and slow EMAs of the volume.
iii) The fast EMA is above the slow EMA.
Interpretation:
When the volume bars change to the specified colours, it indicates potential buying or selling pressure based on the underlying conditions. Teal is buying pressure, red is selling pressure.
Use this information in conjunction with other technical analysis tools to make informed trading decisions. As with all indicators, expect some false signals in choppy markets.
This indicator is useful for traders who want to incorporate volume analysis with price trends and EMA crossovers to identify strong market movements. Adjust the settings to fit your trading strategy and enhance your market analysis.
Advanced Fractal and Hurst IndicatorAdvanced Fractal and Hurst Indicator (AFHI)
Description:
The Advanced Fractal and Hurst Indicator (AFHI) is a custom technical analysis tool designed to identify market trends and potential reversals by leveraging the concepts of Fractal Dimension and the Hurst Exponent . These advanced mathematical concepts provide insights into the complexity and persistence of price movements, making this indicator a powerful addition to any trader's toolkit.
How It Works:
Fractal Dimension (FD) :
The Fractal Dimension measures the complexity of price movements. A higher Fractal Dimension indicates a more complex, choppy market, while a lower value suggests smoother trends.
The FD is calculated using the log difference of price movements over a specified length.
Hurst Exponent (HE) :
The Hurst Exponent indicates the tendency of a time series to either regress to the mean or cluster in a direction. Values below 0.5 indicate a tendency to revert to the mean (mean-reverting), while values above 0.5 suggest a trending market.
The HE is calculated using the rescaled range method, comparing the range of price movements to the standard deviation.
Composite Indicator :
The Composite Indicator combines the smoothed Fractal Dimension and Hurst Exponent to provide a single value indicating market conditions. This is done by normalizing the FD and HE values and combining them into one metric.
A positive Composite Indicator suggests an uptrend, while a negative value indicates a downtrend.
Smoothing :
Both FD and HE values are smoothed using a simple moving average to reduce noise and provide clearer signals.
Trend Confirmation :
A 50-period moving average (MA) is used to confirm the trend direction. The price being above the MA indicates an uptrend, while below the MA indicates a downtrend.
Background Shading :
The indicator pane is shaded green during uptrend conditions (positive Composite Indicator and price above MA) and red during downtrend conditions (negative Composite Indicator and price below MA).
How Traders Can Use It:
Identifying Trends :
Traders can use the AFHI to identify current market trends. The background shading in the indicator pane provides a visual cue for trend direction, with green indicating an uptrend and red indicating a downtrend.
Trend Confirmation :
The Composite Indicator line, plotted in purple, helps confirm the trend. Positive values suggest a strong uptrend, while negative values indicate a strong downtrend.
Entry and Exit Signals :
Traders can use the transitions of the Composite Indicator and the background shading to time their entry and exit points. For instance, a shift from red to green shading suggests a potential buy opportunity, while a shift from green to red suggests a potential sell opportunity.
Alerts :
The script includes alert conditions that can notify traders when the Composite Indicator signals a new trend direction. Alerts can be set up for both uptrends and downtrends, helping traders stay informed of key market changes.
Strategy Development :
By integrating AFHI into their trading strategies, traders can develop more robust systems that account for market complexity and persistence. The indicator can be used alongside other technical tools to enhance decision-making and improve trade accuracy.
Market Slayer (i)Market Slayer (i)
This script is designed to provide insights into market trends and generate trading signals based on a combination of moving average crossovers and trend confirmation. It aims to assist traders in identifying potential entry and exit points in the market.
Input Parameters:
Trend Timeframe: Allows the user to specify the timeframe for trend analysis. Default is set to W (weekly).
Trend Value: Defines the sensitivity of the trend detection algorithm.
Short SMA Length: Length of the short-term Simple Moving Average (SMA).
Long SMA Length: Length of the long-term Simple Moving Average (SMA).
Bullish Color: Color representation for bullish signals.
Bearish Color: Color representation for bearish signals.
Take Profit Color: Color representation for take profit events.
Simple Moving Average (SMA) Logic:
Two SMAs are calculated based on the provided lengths: one short-term and one long-term.
Short-term SMA values are plotted with a semi-transparent bearish color.
Long-term SMA values are plotted with a semi-transparent bullish color.
Trend Logic:
The script employs a modified SSL (Schaff Trend Cycle) indicator to determine the trend direction.
Trend direction is determined based on whether the closing price is above or below the SSL (Schaff Trend Cycle) indicator.
Trend changes are detected by comparing the current trend direction with the previous two trend directions.
Signal Logic:
Buy signals are generated when the short-term SMA crosses above the long-term SMA and the trend is bullish.
Sell signals are generated when the short-term SMA crosses below the long-term SMA and the trend is bearish.
Signals are confirmed only if there is no open position.
Take Profit Logic:
Take profit events are triggered when the trend changes direction after a position has been opened.
Take profit events are confirmed only if there is an open position.
Alerts:
Various alerts are included to notify traders of different events such as signal generation, take profit opportunities, and trend changes.
Usage of lookahead:
Within the script, the lookahead argument is utilized in the request.security() function to control how much historical data should be loaded for trend analysis.
Setting lookahead=barmerge.lookahead_on enables the script to consider future price movements when calculating trend conditions.
This functionality can enhance the accuracy of trend detection by incorporating future bars into the analysis.
Usage:
Traders can use this script on the TradingView platform to visualize market trends, identify potential entry and exit points, and receive timely alerts for trading opportunities.
Simplified MA Crossover indicatorThis is my first script, it is really simple logic and you probably saw something similar before. Is a crossover indicator between 2 Moving Average, one fast MA and the second slow MA.
Inputs you can adjust:
- 8 different source of MA's
- lenght of the MA's
- 7 different types of MA's ("EMA", "SMA", "RMA", "WMA", "DEMA", "TEMA", "HMA")
- 3 smoothing level of the fast MA
- plotting fast MA into the chart
- plotting crossover triangle shapes
I really enjoed the creation of this simple concept indicator, maybe not the fastest because of his nature but I liked work on it. I am sure is a good base to improve, study and try new idea.
Ultimate Trading StrategyDescription:
In this TradingView Pine Script publication, we introduce a powerful tool designed to enhance your trading strategies by combining the Exponential Moving Average (EMA) and the Relative Strength Index (RSI). This strategy is specifically tailored for the EGLD/USDT.P pair on Binance, using a 5-minute interval to capture timely trading opportunities in a volatile market.
Key Features:
Combining EMA and RSI for Robust Signals
This script combines the EMA, which helps identify the overall trend direction, with the RSI, which measures the speed and change of price movements to identify overbought and oversold conditions.
The combination ensures that you get high-probability signals by leveraging both trend-following and momentum-based indicators.
Multiple Timeframe Analysis
Analyze the EMA and RSI across different timeframes to gain a comprehensive view of market conditions and make more informed trading decisions.
Reversing and Extending Signals
Reverse signals generated by indicators to adapt to various market conditions.
Extend signals by specifying conditions such as "RSI cross AND EMA cross WITHIN 2 bars" to capture more nuanced trading opportunities.
Backtesting and Risk Management
Evaluate the performance of your strategies by feeding the results into a backtesting engine.
The strategy risks a maximum of 10% of the account on a single trade to maintain sustainable risk levels.
Available Indicators:
EMA (Exponential Moving Average)
Helps identify the overall trend direction.
Signals:
Long Entry: When the price closes above the EMA.
Short Entry: When the price closes below the EMA.
RSI (Relative Strength Index)
Measures the speed and change of price movements.
Signals:
Long Entry: When RSI is below the oversold level (30).
Short Entry: When RSI is above the overbought level (70).
How It Works:
Long Entry: A buy signal is generated when the price closes above the EMA and the RSI is below the oversold level (30). This indicates that the price is in an upward trend and temporarily oversold, presenting a potential buying opportunity.
Short Entry: A sell signal is generated when the price closes below the EMA and the RSI is above the overbought level (70). This indicates that the price is in a downward trend and temporarily overbought, presenting a potential selling opportunity.
Close Long Position: The script closes long positions when the conditions for a short entry are met.
Close Short Position: The script closes short positions when the conditions for a long entry are met.
Parameters:
EMA Length: 20 (default)
RSI Length: 14 (default)
RSI Overbought Level: 70 (default)
RSI Oversold Level: 30 (default)
Initial Capital: 10,000 USDT (default) – Realistic starting capital for an average trader.
Commission: 0.1% (default) – Reflects typical trading commissions.
Slippage: 0.5 ticks (default) – Accounts for market conditions and potential price slippage during order execution.
Backtesting:
Trading Range: – Ensure that the dataset used covers a significant period to generate a sufficient number of trades.
Dataset Limitation: Due to TradingView Premium's limitation of backtesting only 20,000 candles, it may not be possible to generate more than 100 trades. This limitation affects the statistical relevance of the backtesting results, but the strategy has been tested to provide meaningful insights within these constraints.
Use Case:
This strategy combines the EMA and RSI to identify potential trading opportunities by detecting trend direction and overbought/oversold conditions. It is particularly effective in volatile markets where quick trend reversals are common.
How to Use:
Set the parameters according to your preference or use the default values.
Run the script on the EGLD/USDT.P pair with a 5-minute interval.
Monitor the signals and adjust your trades accordingly.
Investify360 ICT IndicatorThe Investify360 ICT Indicator is designed to follow the ICT (Inner Circle Trader) strategy. It provides essential buy and sell signals based on price movements relative to a simple moving average (SMA). The indicator is built to be beginner-friendly with clear labels and color-coded signals.
Key Features
Simple Moving Average (SMA):
The script calculates a simple moving average based on a user-defined period (length), defaulting to 14 periods. This moving average helps smooth out price data and identify trends.
Buy and Sell Signals:
Buy Signal: A buy signal is generated when the current price (src, defaulting to the close price) crosses above the SMA. This event is typically interpreted as a potential upward trend.
Sell Signal: A sell signal is generated when the current price crosses below the SMA. This event is often interpreted as a potential downward trend.
These signals are visually represented on the chart with up and down labels respectively.
Labels and Colors:
Buy Signal: Displayed with an up label (BUY) in green color.
Sell Signal: Displayed with a down label (SELL) in red color.
The colors for these signals can be customized through the script inputs (buyColor and sellColor).
Beginner-Friendly Labels:
To assist beginners, the script includes a label at the start of the chart indicating the position of the moving average line (MA Line). This label is shown on the first bar to clarify the purpose of the plotted line.
Plotting the Moving Average:
The SMA is plotted on the chart with a yellow line, making it easily distinguishable. The moving average line helps traders visualize the trend direction.
Quaterly Earnings,Sectors/Industry,Moving AveragesDescription:
The EPS & Revenue indicator is designed to provide detailed financial insights into a company's performance by displaying key financial metrics such as Earnings Per Share (EPS), Total Revenue, Free Float, Operating Income, and Return on Equity (ROE). The indicator also calculates and visualizes the percentage changes in these metrics over different quarters, offering a comprehensive view of the company's financial health.
Features:
Table Display:
A customizable table that can be positioned in various locations on the chart (e.g., top left, top center, bottom right, etc.).
Color-coded cells to indicate positive and negative changes in financial metrics.
Dynamic text size and color for better readability.
Financial Metrics:
EPS (Earnings Per Share): Displays the EPS values for the current and previous quarters.
Total Revenue: Shows revenue values in crores (Cr) for multiple quarters.
Free Float: Represents the number of freely floating shares.
Operating Income (OP): Indicates the operating income for the company.
Return on Equity (ROE): Displays the ROE values for multiple quarters.
Calculations:
EPS Year-over-Year (YoY) Change: Calculates the YoY percentage change in EPS.
Quarter-over-Quarter (QoQ) Change: Computes the percentage change in EPS and sales for different quarters.
Sales in Crores: Displays sales values in crores (Cr) and calculates the QoQ changes.
Operating Profit Margin (OPM): Calculates the operating profit margin as a percentage of sales.
52-Week High/Low: Shows the highest and lowest prices over the past 52 weeks.
Average Daily Range (ADR): Computes the average daily range percentage.
Turnover: Displays the average turnover period and current turnover values.
Relative Volume (Rvol): Indicates the relative trading volume compared to the average.
Color Coding:
Uses different colors to highlight significant changes in metrics (e.g., dark green for strong positive changes, light green for moderate positive changes, red for negative changes).
Adjustable transparency based on the magnitude of the change.
Customization:
User inputs for table position, color settings, and calculation periods for turnover and relative volume.
Text labels for various columns and rows in the table to enhance clarity.
How to Use:
Add the EPS & Revenue indicator to your TradingView chart.
Customize the table position and color settings as per your preference.
Analyze the displayed financial metrics and percentage changes to gain insights into the company's performance.
Use the color-coded cells to quickly identify significant changes and trends in EPS, revenue, operating income, and other key metrics.
Example Output:
The table will display current and past EPS values, percentage changes in EPS and sales, operating profit margins, ROE values, turnover, relative volume, and the percentage up from 52-week low and down from 52-week high.
The data will be color-coded to indicate positive and negative changes, making it easier to interpret the company's financial performance at a glance.
This indicator is ideal for investors and traders who want to keep a close eye on a company's financial health and make informed decisions based on detailed financial data.
Periodic Moving AveragesIndicator plots three simple moving averages (MA) that are reset at the beginning of period, specified by a user.
Red MA is based on highs
Blue MA is based on close
Green MA one is based on lows.
Moving averages often act as support /resistance levels. They can also help to identify intraday trend. It is important to realize that none of the moving averages is universal as price behavior changes from day to day. On the chart I’ve highlighted several occurrences when one of MAs (different ones) provided support for price.
Parameters:
PERIOD – period for which MAs are plotted. They are reset at the beginning of each period. Period cannot be lower than chart’s timeframe
LENGTH – length of moving averages. If set to 0 then parameter is ignored and MAs are calculated on all bars, available in the period
VWAP? – if checked then moving averages will be calculated as volume weighted price
Disclaimer
This indicator should not be used as a standalone tool to make trading decisions but only in conjunction with other technical analysis methods.
Moving Average Momentum SignalsBest for trade execution in lower timeframe (1m,5m,15m) with momentum confirmation in higher timeframes (2h,4h,1d)
This indicator relies on three key conditions to determine buy and sell signals: the price's deviation from a short-term moving average, the change in the moving average over time (past 10 candles), and the price's deviation from a historical price (40 candles). The strategy aims to target moments where the asset's price is likely to experience a reversal or momentum shift.
Conditions
Price deviation from short-term Moving Average (MA): Current candle close minus the 10-period MA (price action past 10 candles)
Change in Moving Average over time: Current 10-period MA minus the 10-period MA from 10 candles ago (price action past 20 candles)
Price deviation from historical price: Current close minus the close from 40 candles ago (price action past 40 candles)
Signal Generation Logic
Buy Signal: Triggered when all three conditions are positive. Confirmed if the previous signal was a sell or if there were no previous signals
Sell Signal: Triggered when all three conditions are negative. Confirmed if the previous signal was a buy or if there were no previous signals
Usage and Strategy
After back testing, I observed the higher timeframes were a good indication of momentum/sentiment that you can take note of while trading intraday on the lower time frames (time intervals stated above). Background highlights are also displayed for easier visualization of bullish/bearish skew in terms of the volume of signals generated.
Entry Fragger - Strategy
For basic instructions please visit my other script "Entry Fragger".
The Signal Logic is explained there.
v1.4:
- Added advanced backtesting with fully customizable entries.
- Fully automated Buy Signals (profitable).
- Adjustable timeframes for signal logic. (requested)
Every setting affects the accuracy and profitability greatly now, based on settings applied.
The strategy performs best on high timeframes with larger capital and no leverage.
Useless for Forex, but absolutely smashes stocks and crypto on mid to high timeframes.
Please read through my other scripts description.
Set values as preferred and try your assets.
It does NOT work on low timeframes and forex!
Hint: BTC 4H, Custom Timeframe 1h, Moon Mode and Show Sell Signals enabled, R2R: 2.
Weighted Moving Range with Trend Signals (WMR-TS)Weighted Moving Range with Trend Signals (WMR-TS)
Technical analysis involves analyzing statistical trends from trading activity , such as price movement and volume, to make trading decisions. Technical indicators are mathematical calculations based on the price, volume, or open interest of a security or contract. They are used by traders to analyze price movements and predict future market behavior. The WMR-TS indicator combines weighted moving averages and range calculations to identify key trading levels and generate buy/sell signals. It dynamically adjusts to market conditions, offering traders insights into potential support, resistance, and trend reversal points. Key levels are color-coded for quick interpretation. It utilizes weighted moving averages (WMA) and range calculations to determine these levels, making it a robust tool for both trending and ranging markets.
SUMMARY
Parameters :
WMA Length : Determines the length for the primary weighted moving average.
Highest High Length : Sets the period for calculating the highest high.
Lowest Low Length : Sets the period for calculating the lowest low.
Range Corrector : Adjusts the range calculation slightly for fine-tuning.
Top Level : Multiplier for determining the top level from the calculated range.
Bottom Level : Multiplier for determining the bottom level from the calculated range.
Levels Visibility : Sets how many recent bars will display the levels.
Trading Zones :
Short Area : Highlighted zone indicating potential shorting opportunities.
Long Area : Highlighted zone indicating potential buying opportunities.
The Levels :
Wave (Yellow): Midpoint of the calculated range, adjusted by WMA.
Top Level (Red): Calculated upper boundary of the trading range.
Sell Level (Pink): Intermediate sell level.
Resistance Level (Magenta): Immediate resistance level.
Support Level (Cyan): Immediate support level.
Buy Level (Light Green): Intermediate buy level.
Bottom Level (Dark Green): Calculated lower boundary of the trading range.
Interpreting the Signals :
Hammer Signal : Red circles above bars indicate potential sell signals.
Rocket Signal : Green circles below bars indicate potential buy signals.
KEY CONCEPTS
Highest High and Lowest Low :
These values represent the highest high ( HH ) and lowest low ( LL ) over a specified number of periods.
Support Level :
This is the lower boundary of the trading range. It is a price level where demand is strong enough to prevent the price from falling further. As the price approaches the support level, it is likely to bounce back up.
Resistance Level :
This is the upper boundary of the trading range. It is a price level where supply is strong enough to prevent the price from rising further. As the price approaches the resistance level, it is likely to pull back down.
THE USE OF MULTIPLIERS :
The script uses several multipliers to adjust and fine-tune the calculated support and resistance levels, as well as to control the range and sensitivity of these levels. Here is a detailed explanation of these multipliers and their purpose:
Range Corrector : This multiplier adjusts the calculated high ( H ) and low ( L ) levels, adding flexibility to how these levels are positioned relative to the highest high and lowest low. It ranges from -1 to 1 , with a default value of 0 . The use of positive values increase the range, making the calculated levels further apart. Thus, using negative values decrease the range, bringing the calculated levels closer together.
Top Level : This multiplier adjusts the distance of the top level from the calculated high H ) level. It fluctuates from 0 to 2 , with a default value of 0.382 . Higher values will push the top level further above the high level, while lower values will bring it closer.
Bottom Level : This multiplier adjusts the distance of the bottom support level from the calculated low support level. Ranging from 0 to 2, with a default value of 0.214, the higher values will push the bottom level further below the low level, while lower values will bring it closer.
The script plots the support and resistance levels on the chart, allowing traders to visualize the trading range. Color-coded zones are used to indicate areas where buying or selling opportunities may arise based on the current price relative to the trading range. A trading range refers to the area between a price's support and resistance levels over a specific period of time. Within this range, the price of the security fluctuates up and down but does not break out above the resistance or below the support. Support and resistance levels to make trading decisions. Buying near the support level and selling near the resistance level is a common strategy. When the price moves above the resistance level, it is called a breakout . A breakout often indicates that the price may start a new upward trend . Conversely, when the price moves below the support level, it is called a breakdown . A breakdown often indicates that the price may start a new downward trend . By understanding and utilizing trading ranges, traders can make more informed decisions, optimize their trading strategies, and manage risk more effectively.
Understanding Moving Averages
A moving average (MA) is a widely used technical indicator that helps smooth out price data by creating a constantly updated average price. The main purpose of using a moving average is to identify the direction of the trend and to reduce the "noise" of random price fluctuations. The Weighted Moving Average ( WMA ) assigns different weights to each period, with more recent periods typically given more weight. A 10-day WMA might give the most recent day a weight of 10, the second most recent day a weight of 9, and so on. It is useful for traders who want to emphasize recent price data more than older data. When the price is above the moving average, it suggests an Bullish trend . A Bearish Trend is expected to take place when the price is below the moving average. Understanding the price reactions around these levels can be used to make trading decisions.
APPLYING CONCEPTS
Support and Resistance Calculations in the Script :
The script calculates dynamic support and resistance levels using weighted moving averages ( WMA s) and the highest high and lowest low over specified periods. Buy ( Rocket ) and sell ( Hammer ) signals are generated based on the crossing of the price with calculated top and bottom levels.These signals help traders identify potential entry and exit points within the trading range .
Weighted Moving Average (WMA) Application in the Script
This script calculates a special trendWMA using the close price that helps in creating a more dynamic moving average that considers both high and low price actions. This modified WMA is used in conjunction with highest high and lowest low values over specified periods to calculate dynamic support and resistance levels.
Explanation of the Levels in the Script
By understanding these levels, traders can make more informed decisions about where to enter and exit trades, manage risk, and anticipate potential market movements. The script incorporates several key levels levels that traders can use to better anticipate price movements and make more informed trading decisions. Leveraging the principles of Fibonacci retracement ratios ( 23.6%, 38.2%, 50%, 61.8%, and 100% ) to identify key support and resistance zones can also serve for gauging the overall market sentiment.
Top Level and Sell Leve l: Used to identify potential resistance zones where the price may reverse or pause.
Support Level and Buy Level : Used to identify potential support zones where the price may bounce.
Upper and Lower Pivot Values : Serve as intermediate levels for possible price retracements or extensions within the trading range.
Wave Level : Indicates the central trend direction, which can be useful for gauging the overall market sentiment.
Alerts are a crucial part of the script as they notify traders of potential buy and sell signals based on predefined conditions. There are two main alerts: one for a " Hammer " signal (sell condition) and one for a " Rocket " signal (buy condition).
Adjust the input parameters to fit your trading style and the specific asset being analyzed. Shorter lengths may be more responsive to price changes but can produce more false signals , while longer lengths provide smoother signals but may lag . Always backtest the indicator on historical data to understand its behavior and performance. Also remember that different markets may require different parameter settings for optimal performance.
Keep in mind that by nature like all moving averages, WMAs lag behind price action. This means that signals may be delayed. The indicator performs differently in various market conditions. Always consider the overall market context when interpreting signals.
Adjusting parameters like the range corrector and visibility can help tailor the indicator to specific market conditions or trading strategies, improving its effectiveness. The script uses the calculated levels to plot lines and fill zones on the chart, helping traders visualize potential support, resistance, and trend reversal points. The use of multipliers allows for dynamic adjustment of these levels, making the indicator flexible and adaptable to different market conditions.
I think traders can make more informed decisions about where to enter and exit trades, manage risk, and anticipate potential market movements following this code. Stay safe and always remember that market is always changing. Use this tool if you want, please stay informed and plan safe trades,
D.
Multi-Timeframe MA Levels█ OVERVIEW
This Pine Script is an indicator for displaying multiple moving average (MA) levels from several timeframes on your TradingView charts. At the Realtime Bar (the right-most bar on your chart), it draws a line where the various moving averages currently are.
For example, it will show you where the 8 EMA on the 5 minute timeframe is on your 1-minute timeframe chart.
It derives its look and function from "Lepelle's Key Levels" and focuses on visualizing various moving averages to complement this indicator.
█ FEATURES
1 — Multi-Timeframe Analysis:
• The script allows traders to view moving averages from different timeframes on a single chart.
This multi-timeframe approach helps identify significant levels and trends that might not be apparent when looking at a single timeframe.
2 — Customization and Flexibility:
• Extensive input options for customizing the appearance of the lines (width, style, color) and labels (size, position, distance from price).
This ensures that the indicator can be tailored to individual preferences and charting styles.
3 — Multiple Moving Averages:
• Support for various types of moving averages (8 EMA, 21 EMA, 50 SMA, 100 SMA, 200 SMA).
Each moving average can be individually enabled or disabled for specific timeframes,
providing a flexible tool for technical analysis.
█ SETTINGS
Inputs for Styling:
• Controls the appearance of the lines and labels.
• Includes options for line width, line style, text size, distance from the candlesticks, label position,
and whether to hide prices or use shorthand notation.
Moving Averages Settings:
• Inputs to select different moving averages (8 EMA, 21 EMA, 50 SMA, 100 SMA, 200 SMA) and their corresponding colors.
• Boolean inputs to enable or disable these moving averages on various timeframes (2 min, 5 min, hourly, daily).
█ SUMMARY
In essence, this script provides a comprehensive tool for technical analysis by combining multi-timeframe moving averages into a single, customizable, and user-friendly indicator. It enhances traders' ability to make informed decisions by providing clear visual representations of key moving average levels across different timeframes.
═════════════════════════════════════════════════════════════
█ LIMITATIONS
This script is best used with a short timeframe such as 1-minute or lower because of the limitations of Multi-Timeframe scripts. Basically, the alternate timeframes in use should always be higher than the chart timeframe.
═════════════════════════════════════════════════════════════
█ NOTES
This indicator is intended to complement and be used with "Lepelle's Key Levels" indicator.
In that indictor settings, I recommend turning off the 5 Daily timeframe moving average levels in that script, if using this one.
═════════════════════════════════════════════════════════════
SMA DMA Crossing SignalSMA and DMA Crossing Buy Sell Signals
This script implements a Double Moving Average (DMA) strategy, a popular technical analysis technique used by traders to identify trends and potential buy/sell signals in financial markets.
**Description:**
The Double Moving Average strategy involves the calculation of two moving averages – a short-term moving average and a long-term moving average. In this script, we calculate these moving averages as follows:
1. **Short-term DMA (`dmaShort`):**
- Calculated using a 28-bar Simple Moving Average (SMA).
- Represents the shorter-term trend in the price movement.
2. **Long-term DMA (`dmaLong`):**
- Also calculated using a 28-bar SMA.
- Displaced backward by 14 bars (`dmaLong := request.security(syminfo.tickerid, "D", dmaLong )`), effectively creating a 28-bar SMA with a -14 bar displacement.
- Represents the longer-term trend in the price movement.
**Signals:**
Buy and sell signals are generated based on the crossing of the short-term DMA over or under the long-term DMA:
- **Buy Signal (`DMA BUY`):** Occurs when the short-term DMA crosses above the long-term DMA (`dmaBuySignal`).
- **Sell Signal (`DMA SELL`):** Occurs when the short-term DMA crosses below the long-term DMA (`dmaSellSignal`).
**How to Use:**
- **Buy Signal:** Consider entering a long position when the short-term DMA crosses above the long-term DMA, indicating a potential uptrend.
- **Sell Signal:** Consider exiting a long position or entering a short position when the short-term DMA crosses below the long-term DMA, indicating a potential downtrend.
This script provides a visual representation of the DMA crossover signals on the chart, helping traders identify potential entry and exit points in the market.
**Note:** It's important to combine DMA signals with other technical analysis tools and risk management strategies for informed trading decisions.
All comments are welcome..
Multi-Chart Widget [LuxAlgo]The Multi-Chart Widget tool is a comprehensive solution crafted for traders and investors looking to analyze multiple financial instruments simultaneously. With the capability to showcase up to three additional charts, users can customize each chart by selecting different financial instruments, and timeframes.
Users can add various widely used technical indicators to the charts such as the relative strength index, Supertrend, moving averages, Bollinger Bands...etc.
🔶 USAGE
The tool offers traders and investors a comprehensive view of multiple charts simultaneously. By displaying up to three additional charts alongside the primary chart, users can analyze assets across different timeframes, compare their performance, and make informed decisions.
Users have the flexibility to choose from various customizable chart types, including the recently added "Volume Candles" option.
This tool allows adding to the chart some of the most widely used technical indicators, such as the Supertrend, Bollinger Bands, and various moving averages.
In addition to the charting capabilities, the tool also features a dynamic statistic panel that provides essential metrics and key insights into the selected assets. Users can track performance indicators such as relative strength, trend, and volatility, enabling them to identify trends, patterns, and trading opportunities efficiently.
🔶 DETAILS
A brief overview of the indicators featured in the statistic panel is given in the sub-section below:
🔹Dual Supertrend
The Dual Supertrend is a modified version of the Supertrend indicator, which is based on the concept of trend following. It generates buy or sell signals by analyzing the asset's price movement. The Dual Supertrend incorporates two Supertrend indicators with different parameters to provide potentially more accurate signals. It helps traders identify trend reversals and establish trend direction in a more responsive manner compared to a single Supertrend.
🔹Relative Strength Index
The Relative Strength Index is a momentum oscillator that measures the speed and change of price movements. RSI oscillates between 0 and 100 and is typically used to identify overbought or oversold conditions in a market. Traditionally, RSI values above 70 are considered overbought, suggesting that the asset may be due for a reversal or correction, while RSI values below 30 are considered oversold, indicating potential buying opportunities.
🔹Volatility
Volatility in trading refers to the degree of variation or fluctuation in the price of a financial instrument, such as a stock, currency pair, or commodity, over a certain period of time. It is a measure of the speed and magnitude of price changes and reflects the level of uncertainty or risk in the market. High volatility implies that prices are experiencing rapid and significant movements, while low volatility suggests that prices are relatively stable and are not changing much. Traders often use volatility as an indicator to assess the potential risk and return of an investment and to make informed decisions about when to enter or exit trades.
🔹R-Squared (R²)
R-squared, also known as the coefficient of determination, is a statistical measure that indicates the proportion of the variance in the dependent variable that is predictable from the independent variable(s). In other words, it quantifies the goodness of fit of a regression model to the observed data. R-squared values range from %0 to %100, with higher values indicating a better fit of the model to the data. An R-squared of 100% means that all movements of a security are completely explained by movements in the index, while an R-squared value of %0 indicates that the model does not explain any of the variability in the dependent variable.
In simpler terms, in investing, a high R-squared, from 85% to 100%, indicates that the stock’s or fund’s performance moves relatively in line with the index. Conversely, a low R-squared (around 70% or less) indicates that the fund's performance tends to deviate significantly from the movements of the index.
🔶 SETTINGS
🔹Mini Chart(s) Generic Settings
Mini Charts Separator: This option toggles the visibility of the separator lines.
Number Of Bars: Specifies the number of bars to be displayed for each mini chart.
Horizontal Offset: Determines the distance at which the mini charts will be displayed from the primary chart.
🔹Mini Chart Settings: Top - Middle - Bottom
Mini Chart Top/Middle/Bottom: Toggle the visibility of the selected mini chart.
Symbol: Choose the financial instrument to be displayed in the mini chart. If left as an empty string, it will default to the current chart instrument.
Timeframe: This option determines the timeframe used for calculating the mini charts. If a timeframe lower than the chart's timeframe is selected, the calculations will be based on the chart's timeframe.
Chart Type: Selection from various chart types for the mini charts, including candles, volume candles, line, area, columns, high-low, and Heikin Ashi.
Chart Size: Determines the size of the mini chart.
Technical Indicator: Selection from various technical indicators to be displayed on top of the mini charts.
Note : Chart sizing is relative to other mini charts. For example, If all the mini charts are sized to x5 relative to each other, the result will be the same as if they were all sized as x1. This is because the relative proportions between the mini charts remain consistent regardless of their absolute sizes. Therefore, their positions and sizes relative to each other remain unchanged, resulting in the same visual representation despite the differences in absolute scale.
🔹Supertrend Settings
ATR Length: is the lookback length for the ATR calculation.
Factor: is what the ATR is multiplied by to offset the bands from price.
Color: color customization option.
🔹Moving Average Settings
Type: is the type of the moving average, available types of moving averages include SMA (Simple Moving Average), EMA (Exponential Moving Average), RMA (Root Mean Square Moving Average), HMA (Hull Moving Average), WMA (Weighted Moving Average), and VWMA (Volume Weighted Moving Average).
Source: Determines what data from each bar will be used in calculations.
Length: The time period to be used in calculating the Moving Average.
Color: Color customization option.
🔹Bollinger Bands Settings
Basis Type: Determines the type of Moving Average that is applied to the basis plot line.
Source: Determines what data from each bar will be used in calculations.
Length: The time period to be used in calculating the Moving Average which creates the base for the Upper and Lower Bands.
StdDev: The number of Standard Deviations away from the Moving Average that the Upper and Lower Bands should be.
Color: Color customization options for basis, upper and lower bands.
🔹Mini Chart(s) Panel Settings
Mini Chart(s) Panel: Controls the visibility of the panel containing the mini charts.
Dual Supertrend: Toggles the display of the evaluated dual super trend, based on the super trend settings provided below the option. The definitions for the options are the same as stated above for the super trend.
Relative Strength Index: Toggles the display of the evaluated RSI, based on the source and length settings provided below the option.
Volatility: Toggles the display of the calculated Volatility, based on the length settings provided below the option.
R-Squared: Toggles the display of the calculated R-Squared (R²), based on the length settings provided below the option.
🔶 LIMITATIONS
The tool allows users to display mini charts featuring various types of instruments alongside the primary chart instrument. However, there's a limitation: the selected primary chart instrument must have an ACTIVE market status. Alternatively, if the primary chart instrument is not active, the mini chart instruments must belong to the same exchange and have the same type as the primary chart instrument.
Tetuan SniperThe TEMA and EMA Crossover Alert with SL, TP, and Order Signal strategy combines the power of Triple Exponential Moving Average (TEMA) and Exponential Moving Average (EMA) to generate high-quality trading signals. This strategy is designed to provide clear entry and exit points, manage risk through dynamic Stop Loss (SL) and Take Profit (TP) levels, and optimize trade sizes based on account balance and risk tolerance.
Key Features:
EMA and TEMA Crossover:
The strategy identifies potential buy and sell signals based on the crossover of EMA and TEMA. A buy signal is generated when TEMA crosses above EMA, and a sell signal is generated when TEMA crosses below EMA.
Dynamic Stop Loss (SL) and Take Profit (TP):
Stop Loss levels are dynamically set based on a user-defined number of pips below (for buy orders) or above (for sell orders) the lowest or highest point since the crossover.
Take Profit levels are dynamically adjusted using another TEMA, providing a flexible exit strategy that adapts to market conditions.
Lot Size Calculation:
The strategy calculates the optimal lot size based on the account balance, risk percentage per trade, and the number of maximum open orders. For JPY pairs, the lot size is adjusted by dividing by 100 to account for the different pip value.
The lot size is rounded to two decimal places for better readability and precision.
Visual Alerts and Labels:
Clear visual alerts and labels are provided for each buy and sell signal, including the recommended SL, TP, and lot size. The labels are placed in a way to avoid overlapping important chart elements.
Trend Visualization:
The area between the TEMA and EMA is colored to indicate the trend, with green for bullish trends and red for bearish trends, making it easy to visualize the market direction.
Inputs:
SL Points: Number of pips for the Stop Loss.
EMA Period: Period for the Exponential Moving Average.
TEMA Period: Period for the Triple Exponential Moving Average.
Account Balance: The total account balance for calculating the lot size.
Risk Percentage: The percentage of the account balance to risk per trade.
Take Profit TEMA Period: Period for the TEMA used to set Take Profit levels.
Lot per Pip Value: The value of 1 pip per lot.
Maximum Open Orders: The maximum number of open orders to split the balance among.
Example Usage
This strategy is suitable for traders who want to automate their trading signals and manage risk effectively. By combining TEMA and EMA crossovers with dynamic SL and TP levels and precise lot size calculation, traders can achieve a disciplined and methodical approach to trading.
Multi-Frame Market Sentiment DashboardOverview
This Pine Script™ code generates a "Market Sentiment Dashboard" on TradingView, providing a visual summary of market sentiment across multiple timeframes. This tool aids traders in making informed decisions by displaying real-time sentiment analysis based on Exponential Moving Averages (EMA).
Key Features
Panel Positioning:
Custom Placement: Traders can position the dashboard at the top, middle, or bottom of the chart and align it to the left, center, or right, ensuring optimal integration with other chart elements.
Customizable Colors:
Sentiment Colors: Users can define colors for bullish, bearish, and neutral market conditions, enhancing the dashboard's readability.
Text Color: Customizable text color ensures clarity against various background colors.
Label Size:
Scalable Labels: Adjustable label sizes (from very small to very large) ensure readability across different screen sizes and resolutions.
Market Sentiment Calculation:
EMA-Based Sentiment: The dashboard calculates sentiment using a 9-period EMA. If the EMA is higher than two bars ago, the sentiment is bullish; if lower, it's bearish; otherwise, it's neutral.
Multiple Timeframes: Sentiment is calculated for several timeframes: 1 minute, 3 minutes, 5 minutes, 15 minutes, 30 minutes, 1 hour, 4 hours, and 1 day. This broad analysis provides a comprehensive view of market conditions.
Dynamic Table:
Structured Display: The dashboard uses a table to organize and display sentiment data clearly.
Real-Time Updates: The table updates in real-time, providing traders with up-to-date market information.
How It Works
EMA Calculation: The script requests EMA(9) values for each specified timeframe and compares the current EMA with the EMA from two bars ago to determine market sentiment.
Color Coding: Depending on the sentiment (Bullish, Bearish, or Neutral), the corresponding cell in the table is color-coded using predefined colors.
Table Display: The table displays the timeframe and corresponding sentiment, allowing traders to quickly assess market trends.
Benefits to Traders
Quick Assessment: Traders can quickly evaluate market sentiment across multiple timeframes without switching charts or manually calculating indicators.
Enhanced Visualization: The color-coded sentiment display makes it easy to identify trends at a glance.
Multi-Timeframe Analysis: Provides a broad view of short-term and long-term market trends, helping traders confirm trends and avoid false signals.
This dashboard enhances the overall trading experience by providing a comprehensive, customizable, and easy-to-read summary of market sentiment.
Usage Instructions
Add the Script to Your Chart: Apply the "Market Sentiment Dashboard" indicator to your TradingView chart.
Customize Settings: Adjust the panel position, colors, and label sizes to fit your preferences.
Interpret Sentiment: Use the color-coded table to quickly understand the market sentiment across different timeframes and make informed trading decisions.
On Balance Volume (OBV) with Multiple SMAs IndicatorThe On Balance Volume (OBV) with Multiple SMAs Indicator is a powerful tool designed to provide insights into market momentum and volume trends. By combining the traditional OBV calculation with multiple Simple Moving Averages (SMAs), this indicator helps traders to identify potential changes in trend and confirm the strength of existing trends.
Key Features
On Balance Volume (OBV):
OBV is a cumulative volume-based indicator that adds volume on up days and subtracts volume on down days. It helps to identify the buying and selling pressure.
OBV is calculated by summing the volume when the closing price is higher than the previous close and subtracting the volume when the closing price is lower than the previous close.
Simple Moving Averages (SMAs):
SMAs are calculated on the OBV to smooth out the fluctuations and highlight the underlying trend.
This indicator includes the following SMAs:
21-period SMA: Short-term trend indicator, helps in identifying quick trend reversals.
60-period SMA: Medium-term trend indicator, provides a balance between short-term and long-term trends.
100-period SMA: Long-term trend indicator, useful for identifying sustained trends.
200-period SMA: Very long-term trend indicator, helps in identifying major trend directions and potential changes.
How to Use
Identify Trend Direction:
The slope and direction of the OBV line indicate the overall buying and selling pressure in the market.
When OBV is above its SMAs, it suggests a strong buying pressure. Conversely, when OBV is below its SMAs, it indicates selling pressure.
Confirm Trends:
The crossovers of the OBV line and its SMAs can act as confirmations for trend changes. For example, when OBV crosses above the 21-period SMA, it may signal a short-term bullish trend.
Support and Resistance:
The SMAs can act as dynamic support and resistance levels for the OBV line. Price bouncing off these levels may provide entry and exit points.
Visualization
OBV Line: Plotted in blue to represent the cumulative volume trend.
21-period SMA: Plotted in red, indicating short-term trends.
60-period SMA: Plotted in orange, representing medium-term trends.
100-period SMA: Plotted in green, showing long-term trends.
200-period SMA: Plotted in blue, indicating very long-term trends.
Dual Simple Moving Average with Price ConditionThe "Dual Simple Moving Average with Price Condition" indicator is a powerful tool designed to help traders identify potential buy and sell opportunities by analyzing the relationship between two Simple Moving Averages (SMAs) and the price action.
Features:
Simple Moving Averages (SMAs):
The indicator uses two SMAs: a short-term SMA and a long-term SMA.
The lengths of these SMAs can be customized to suit the trader’s preferences and trading style.
Crossover Signals:
Buy signals are generated when the short-term SMA crosses above the long-term SMA.
Sell signals are generated when the short-term SMA crosses below the long-term SMA.
Price Condition:
To enhance the reliability of the signals, the indicator includes a price condition:
A buy signal is only confirmed if, at the time of the crossover, the closing price is at its maximum over a specified period.
A sell signal is only confirmed if, at the time of the crossover, the closing price is at its minimum over a specified period.
The period for determining the maximum and minimum price can be customized by the user.
Visual Alerts:
Green "Buy" labels are displayed below the bars when a buy signal is confirmed.
Red "Sell" labels are displayed above the bars when a sell signal is confirmed.
How to Use:
Adjust the Inputs:
Customize the lengths of the short-term and long-term SMAs according to your trading strategy.
Set the period over which to evaluate the maximum and minimum prices.
Interpret the Signals:
Use the crossover of the short-term and long-term SMAs as the primary signal.
Confirm the signal by checking if the price condition is met (price at its maximum or minimum for the specified period).
Trade Entry and Exit:
Enter a long position when a green "Buy" label appears below the bar.
Enter a short position or exit a long position when a red "Sell" label appears above the bar.
Trading Tip: You can use the indicator best in higher timeframes, such as 4-hour (4H) and daily charts, along with a trend line. This approach helps to avoid false signals that may occur due to frequent crossings of the short and long-term SMAs on lower timeframes.
This indicator is suitable for various financial instruments including stocks, forex, commodities, and cryptocurrencies. By combining moving average crossovers with price conditions, it provides a robust mechanism for identifying high-probability trading opportunities.
PROWIN STUDY BASIC CURRENT CANDLE TABLE**PROWIN STUDY BASIC CURRENT CANDLE TABLE**
**Description:**
The PROWIN STUDY BASIC CURRENT CANDLE TABLE indicator provides an insightful analysis of the current candle's volume and its comparative performance against the last 50 candles. This script includes several features designed to help traders understand volume trends and potential market direction.
**Key Features:**
1. **Volume Analysis**:
- Accesses the current candle's volume and compares it with the highest and lowest volumes over the past 50 candles.
- Calculates the average volume between the highest and lowest values for a better perspective.
2. **Candle Trend Identification**:
- Identifies whether the current candle is bullish or bearish by comparing the current close price with the previous close price.
3. **Average Volume Calculation**:
- Computes the average volume of bullish (green) and bearish (red) candles over the last 50 periods.
- Derives an average value between the green and red volume averages.
4. **Volume Slope Calculation**:
- Calculates the difference in volume averages (EMAs) between successive periods to determine the slope.
- Computes the angle of inclination for green, red, and average volume lines in degrees.
5. **Plotting**:
- Plots the average volumes of green and red candles as well as the combined average on the chart.
- Visualizes these metrics with color-coded lines for quick interpretation.
6. **Dynamic Table**:
- Displays a dynamic table on the chart that updates in real-time.
- Shows the angles of inclination for buy (green), sell (red), and average volume (blue) with corresponding background colors.
7. **Customizable Background**:
- Includes an option to set a semi-transparent background color for the chart, enhancing visual clarity.
This indicator is designed to help traders gain deeper insights into market volume dynamics and make more informed trading decisions. Whether you're analyzing short-term movements or long-term trends, the PROWIN STUDY BASIC CURRENT CANDLE TABLE offers valuable data at a glance.
Multi-Timeframe Trend Cloud (EMA13/21) with Alerts Purpose:
This indicator combines trend analysis across multiple timeframes with alerts to help identify general trends and market shifts. It visualizes trends by creating EMA clouds (The area between EMA13 & EMA21), detects confirmed EMA crossovers, and can alert users when the price re-enters the cloud or interacts with the EMA200.
Input Parameters:
Lower Timeframe (LTF): Allows you to select the lower timeframe for trend analysis (e.g., 1 hour, 4 hours).
Higher Timeframe (HTF): Allows you to select the higher timeframe for the main trend reference (e.g., 4 hours, 1 day).
Fill Colors: You can customize the colors used to fill the areas between the EMA lines in both the higher and lower timeframes. Note: The LTF cloud defaults to transparent white so if you have a light background change the color in style settings.
The EMA's default to transparent but can be turned on in the style settings.
Calculating & Plotting EMAs:
The indicator calculates two Exponential Moving Averages (EMAs) on both the LTF and HTF: a faster 13-period EMA and a slower 21-period EMA.
Additionally, it calculates a 200-period EMA on the HTF.
These EMAs are plotted on your chart, providing a visual representation of the trend.
Identifying Trend States:
The script uses the relationships between the price and the 13-period and 21-period EMAs on the Higher Time Frame (HTF) to identify four distinct trend states, each depicted by a specific color to create the "Trend Cloud":
Strong Bull Trend: The 13-period EMA is above the 21-period EMA, and the price is above both EMAs. --- "Color 0" in HTF Trend style settings.
Broken Bullish Trend: The 13-period EMA is above the 21-period EMA but price has broken below both EMA's. --- "Color 3" in HTF Trend style settings.
Strong Bear Trend: The 13-period EMA is below the 21-period EMA, and the price is below both EMAs. --- "Color 2" in HTF Trend style settings.
Broken Bearish Trend: The 13-period EMA is below the 21-period EMA but price has broken above both EMA's. --- "Color 1" in HTF Trend style settings.
Important Note: The 200-period EMA is plotted for reference but is not directly used in determining the current trend state within this script.
Confirmed Crossover Signals:
The indicator plots upward or downward triangles to signal confirmed crossovers of the EMA13 and EMA21 on the HTF. A crossover is considered "confirmed" when it's followed by a candle closing on the same side of the crossing point, adding an extra layer of confidence to the signal.
Cloud Re-entry Alerts:
Receive alerts whenever the price re-enters the HTF cloud - aka "Trend".
EMA200 Retest Alerts:
Get alerts when the price touches the 200 EMA on the HTF. These alerts can be valuable for identifying potential trend reversals or trend continuation scenarios.
Benefits:
Clear Visual Representation: Easily visualize trends on both the lower and higher timeframes.
Confirmed Signals: Filter out false signals by focusing on confirmed crossovers.
Timely Alerts: Get instant notifications for important price actions, allowing you to react quickly to market opportunities.
Customizable: Tailor the indicator's appearance and alert settings to your preferences.
How to Use:
Add the indicator to your chart.
Select your desired LTF and HTF in the Inputs tab.
Customize the fill colors (and optional EMA line colors) in the Style tab.
Enable the alerts you want to receive in the Alerts tab.
Note: This indicator is a great tool for trend analysis, but it should be used with other forms of analysis and risk management techniques to make informed trading decisions.
Kaufman Adaptive Moving Average (KAMA) Strategy [TradeDots]"The Kaufman Adaptive Moving Average (KAMA) Strategy" is a trend-following system that leverages the adaptive qualities of the Kaufman Adaptive Moving Average (KAMA). This strategy is distinguished by its ability to adjust dynamically to market volatility, enhancing trading accuracy by minimizing the effects of false and delayed signals often associated with the Simple Moving Average (SMA).
HOW IT WORKS
This strategy is centered around use of the Kaufman Adaptive Moving Average (KAMA) indicator, which refines the principles of the Exponential Moving Average (EMA) with a superior smoothing technique.
KAMA distinguishes itself by its responsiveness to changes in market prices through an "Efficiency Ratio (ER)." This ratio is computed by dividing the recent absolute net price change by the cumulative sum of the absolute price changes over a specified period. The resulting ER value ranges between 0 and 1, where 0 indicates high market noise and 1 reflects stronger market momentum.
Using ER, we could get the smoothing constant (SC) for the moving average derived using the following formula:
fastest = 2/(fastma_length + 1)
slowest = 2/(slowma_length + 1)
SC = math.pow((ER * (fastest-slowest) + slowest), 2)
The KAMA line is then calculated by applying the SC to the difference between the current price and the previous KAMA.
APPLICATION
For entering long positions, this strategy initializes when there is a sequence of 10 consecutive rising KAMA lines. Conversely, a sequence of 10 consecutive falling KAMA lines triggers sell orders for long positions. The same logic applies inversely for short positions.
DEFAULT SETUP
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 80%
Users are advised to adjust and personalize this trading strategy to better match their individual trading preferences and style.
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
Volume Surge Analysis [UAlgo]The "Volume Surge Analysis " indicator is designed to detect significant volume surges in the market. By analyzing volume relative to its moving average and incorporating a comparison of the true range of price movements, this script highlights potential bullish and bearish volume spikes. Traders can utilize these signals to identify moments of heightened market activity that may indicate strong buying or selling pressure.
🔶Features
Volume Multiplier: Customizable setting to define the threshold for what constitutes a volume surge.
Volume SMA Length: Adjustable length for the Simple Moving Average (SMA) of volume.
Price Movement Analysis
Enhances the volume analysis by adding an additional layer of context, helping to confirm whether a volume surge is associated with buying or selling pressure.
True Range Calculation: Measures the range of price movement to understand volatility.
Positive Movement (DM+): Calculated when the current high minus the previous high is greater than the previous low minus the current low. This helps identify strong upward movements.
Negative Movement (DM-): Calculated when the previous low minus the current low is greater than the current high minus the previous high. This helps identify strong downward movements.
Integration with Volume Analysis: By combining the volume analysis with price movement analysis, the script can more accurately determine whether a volume surge is likely driven by bullish or bearish sentiment. This integration helps filter out false signals and provides more reliable indications of market activity.
Median Volume Comparison: Compares the current volume against the median volume multiplied by the volume multiplier to identify significant volume spikes.
Bullish and Bearish Surge Signals: Plots circles above or below bars where significant volume surges occur, indicating potential bullish or bearish movements.
Color Customization: Options to set specific colors for bullish and bearish signals to enhance visual clarity.
Bar Coloring: Optional feature to change the color of bars based on detected volume surges.
Alerts: Configurable alerts for bullish and bearish volume spikes to notify traders in real-time.
🔶Interpretation:
Bullish Volume Surges ( Teal Circles ): These circles appear above the bar when the current volume exceeds the median volume by the specified Volume Multiplier, and the smoothed Positive Directional Index (PDI) is greater than the smoothed Negative Directional Index (NDI). This suggests a potential uptrend with strong buying pressure.
Bearish Volume Surges ( Red Circles ): These circles appear below the bar when the current volume exceeds the median volume by the specified Volume Multiplier, and the smoothed NDI is greater than the smoothed PDI. This suggests a potential downtrend with strong selling pressure.
Overall, the "Volume Surge Analysis " indicator serves as a valuable tool for traders seeking to identify potential trend reversals or strong continuations based on with an above-average rise in volume and directional momentum.
🔶Disclaimer
This indicator is intended for informational and educational purposes only and should not be construed as financial or investment advice. Trading involves substantial risk, and it is essential to conduct your own research and consult with a qualified financial advisor before making any trading decisions.