Volatility Estimator - YZ & RSThe Yang-Zheng Volatility Estimator (YZVE) integrates both intra-candle and inter-candle dynamics, such as overnight and weekend price changes, offering a more detailed analysis compared to traditional methods. The YZVE is proposed to improve over the standard deviation by accounting for the open, high, low, and close prices of trading periods, instead of only the close prices, and attempts to supplant the Parkinson's Volatility Estimator (PVE) by a also capturing inter-candle dynamics. The YZVE is calculated by this formula:
YZ Volatility Squared σ_YZ² = k * σ_o² + σ_rs² + (1 - k) * σ_c²
where k is a weighting factor that adjusts the emphasis between the overnight and close-to-close components, popularly estimated as:
k = 0.34 / (1.34 + (N+1) / (N-1))
where N is the lookback period. Optionally, users may opt to override this calculation with a specified constant (off by default). Next, the
Overnight Volatility Squared σ_o² = (log(O_t / C_(t-1)))²
measures the volatility associated with overnight price changes, from the previous candle's closing price C_(t-1) to the current candle's opening price O_t. It captures the market's reaction to news and events that occur outside of regular trading hours to reflect risk associated with holding positions over non-trading hours and gaps.
Next, the The Rogers-Satchell Volatility Estimator (RSVE) serves as an intermediary step in the computation of YZVE. It aggregates the logarithmic ratios between high, low, open, and close prices within each trading period, focusing on intra-candle volatility without assuming zero inter-candle drift as commonly implicitly assumed in other volatility models:
Rogers-Satchell Volatility Squared σ_rs² = (log(H_t / C_t) * log(H_t / O_t)) + (log(L_t / C_t) * log(L_t / O_t))
Finally,
Close-to-Close Volatility Squared σ_c² = (log(C_t / C_(t-1)))²
measures the volatility from the close of one candle to the close of the next. It reflects the typical candle volatility, similar to naive standard deviation.
This script also includes an option for users to apply the simpler RS Volatility exclusively, focusing on intraday price movements. Additionally, it offers a choice for normalization between 0 and 1, turning the estimator into an oscillator for comparing current volatility to recent levels. Horizontal lines at user-defined levels are also available for clearer visualization. Both are off by default.
References:
Yang, D., & Zhang, Q. (2000). Drift-independent volatility estimation based on high, low, open, and close prices. The Journal of Business, 73(3), 477-491.
Rogers, L.C.G., & Satchell, S.E. (1991). Estimating variance from high, low and closing prices. Annals of Applied Probability, 1(4), 504-512.
Volatility
Parkinson's Volatility EstimatorThe Parkinson's Volatility Estimator (PVE) provides an alternative method for assessing market volatility using the highest and lowest prices within a given period. Unlike traditional models that predominantly rely on closing prices, the PVE considers the full range of intra-candle price movements, thereby potentially offering a more comprehensive gauge of market volatility. The estimator is derived from the logarithm of the ratio of the high to low prices, squared and then averaged over the period of interest. This calculation is rooted in the assumption that the logarithmic high-to-low ratio represents a normalized measure of price movements, capturing both upward and downward volatility in a symmetric manner (Parkinson, 1980).
In this specific implementation, the estimator is calculated as follows:
Parkinson’s Volatility = (1/4 log(2)) * (1/n) * Σ from i=1 to n of (log(High_i/Low_i))^2
where n is the lookback period defined by the user, and High_i and Low_i are the highest and lowest prices at each interval i within that period. This formulation takes advantage of the logarithmic properties to scale the volatility measure appropriately, utilizing a factor of 1/4 log(2) to normalize the variance estimate (Parkinson, 1980).
This implementation includes options for output normalization between 0 and 1 and for plotting horizontal lines at specified levels, allowing the estimator to function like an oscillator to evaluate volatility relative to recent market regimes. Users can customize these features through script inputs, enhancing flexibility for various trading scenarios and improving its utility for real-time volatility assessments on the TradingView platform.
Reference:
Parkinson, M. (1980). The extreme value method for estimating the variance of the rate of return. The Journal of Business, 53(1), 61-65.
Price Based Z-Trend - Strategy [presentTrading]█ Introduction and How it is Different
Z-score: a statistical measurement of a score's relationship to the mean in a group of scores.
Simple but effective approach.
The "Price Based Z-Trend - Strategy " leverages the Z-score, a statistical measure that gauges the deviation of a price from its moving average, normalized against its standard deviation. This strategy stands out due to its simplicity and effectiveness, particularly in markets where price movements often revert to a mean. Unlike more complex systems that might rely on a multitude of indicators, the Z-Trend strategy focuses on clear, statistically significant price movements, making it ideal for traders who prefer a streamlined, data-driven approach.
BTCUSD 6h LS Performance
█ Strategy, How It Works: Detailed Explanation
🔶 Calculation of the Z-score
"Z-score is a statistical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean. If a Z-score is 0, it indicates that the data point's score is identical to the mean score. A Z-score of 1.0 would indicate a value that is one standard deviation from the mean. Z-scores may be positive or negative, with a positive value indicating the score is above the mean and a negative score indicating it is below the mean."
The Z-score is central to this strategy. It is calculated by taking the difference between the current price and the Exponential Moving Average (EMA) of the price over a user-defined length, then dividing this by the standard deviation of the price over the same length:
z = (x - μ) /σ
Local
🔶 Trading Signals
Trading signals are generated based on the Z-score crossing predefined thresholds:
- Long Entry: When the Z-score crosses above the positive threshold.
- Long Exit: When the Z-score falls below the negative threshold.
- Short Entry: When the Z-score falls below the negative threshold.
- Short Exit: When the Z-score rises above the positive threshold.
█ Trade Direction
The strategy allows users to select their preferred trading direction through an input option.
█ Usage
To use this strategy effectively, traders should first configure the Z-score thresholds according to their risk tolerance and market volatility. It's also crucial to adjust the length for the EMA and standard deviation calculations based on historical performance and the expected "noise" in price data.
The strategy is designed to be flexible, allowing traders to refine settings to better capture profitable opportunities in specific market conditions.
█ Default Settings
- Trade Direction: Both
- Standard Deviation Length: 100
- Average Length: 100
- Threshold for Z-score: 1.0
- Bar Color Indicator: Enabled
These settings offer a balanced starting point but can be customized to suit various trading styles and market environments. The strategy's parameters are designed to be adjusted as traders gain experience and refine their approach based on ongoing market analysis.
Z-score is a must-learn approach for every algorithmic trader.
Sector Rotation Hedging With Volatility Index [TradeDots]The "Sector Rotation Hedging Strategy With Volatility Index" is a comprehensive trading indicator developed to optimally leverage the S&P500 volatility index. It is designed to switch between distinct ETF sectors, strategically hedging to moderate risk exposure during harsh market volatility.
HOW DOES IT WORK
The core of this indicator is grounded on the S&P500 volatility index (VIX) close price and its 60-day moving average. This serves to determine whether the prevailing market volatility is above or below the quarterly average.
In periods of elevated market volatility, risk exposure escalates significantly. Traders retaining stocks in sectors with disproportionately high volatility face increased vulnerability to negative returns. To tackle this, our indicator employs a two-pronged approach utilizing two sequential candlestick close prices to confirm if volatility surpasses the average value.
Upon confirming above-average volatility, a hedging table is deployed to spotlight ETFs with low volatility, such as the Utilities Select Sector SPDR Fund (XLU), to derisk the overall portfolio.
Conversely, in low-volatility conditions, sectors yielding higher returns like the Technology Select Sector SPDR Fund (XLK) are preferred. The hedging table is utilized to earmark high-return sector ETFs.
Thus, during highly volatile market periods, the strategy recommends enhancing portfolio allocation to low-volatility ETFs. During low-volatility windows, the portfolio is calibrated towards high-volatility ETFs for heightened returns.
IMPORTANT CONSIDERATION
In real trading, additional considerations encompassing trading commissions, management fees, and ancillary rotation costs should be factored in. False signals may arise, potentially leading to losses from these fees.
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.
Buy Sell Strategy With Z-Score [TradeDots]The "Buy Sell Strategy With Z-Score" is a trading strategy that harnesses Z-Score statistical metrics to identify potential pricing reversals, for opportunistic buying and selling opportunities.
HOW DOES IT WORK
The strategy operates by calculating the Z-Score of the closing price for each candlestick. This allows us to evaluate how significantly the current price deviates from its typical volatility level.
The strategy first takes the scope of a rolling window, adjusted to the user's preference. This window is used to compute both the standard deviation and mean value. With these values, the strategic model finalizes the Z-Score. This determination is accomplished by subtracting the mean from the closing price and dividing the resulting value by the standard deviation.
This approach provides an estimation of the price's departure from its traditional trajectory, thereby identifying market conditions conducive to an asset being overpriced or underpriced.
APPLICATION
Firstly, it is better to identify a stable trading pair for this technique, such as two stocks with considerable correlation. This is to ensure conformance with the statistical model's assumption of a normal Gaussian distribution model. The ideal performance is theoretically situated within a sideways market devoid of skewness.
Following pair selection, the user should refine the span of the rolling window. A broader window smoothens the mean, more accurately capturing long-term market trends, while potentially enhancing volatility. This refinement results in fewer, yet precise trading signals.
Finally, the user must settle on an optimal Z-Score threshold, which essentially dictates the timing for buy/sell actions when the Z-Score exceeds with thresholds. A positive threshold signifies the price veering away from its mean, triggering a sell signal. Conversely, a negative threshold denotes the price falling below its mean, illustrating an underpriced condition that prompts a buy signal.
Within a normal distribution, a Z-Score of 1 records about 68% of occurrences centered at the mean, while a Z-Score of 2 captures approximately 95% of occurrences.
The 'cool down period' is essentially the number of bars that await before the next signal generation. This feature is employed to dodge the occurrence of multiple signals in a short period.
DEFAULT SETUP
The following is the default setup on EURUSD 1h timeframe
Rolling Window: 80
Z-Score Threshold: 2.8
Signal Cool Down Period: 5
Commission: 0.03%
Initial Capital: $10,000
Equity per Trade: 30%
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.
Rise Sense Capital - RSI MACD Spot Buying IndicatorToday, I'll share a spot buying strategy shared by a member @KR陳 within the DATA Trader Alliance Alpha group. First, you need to prepare two indicators:
今天分享一個DATA交易者聯盟Alpha群組裏面的群友@KR陳分享的現貨買入策略。
首先需要準備兩個指標
RSI Indicator (Relative Strength Index) - RSI is a technical analysis tool based on price movements over a period of time to evaluate the speed and magnitude of price changes. RSI calculates the changes in price over a period to determine whether the recent trend is relatively strong (bullish) or weak (bearish).
RSI指標,(英文全名:Relative Strength Index),中文稱為「相對強弱指標」,是一種以股價漲跌為基礎,在一段時間內的收盤價,用於評估價格變動的速度 (快慢) 與變化 (幅度) 的技術分析工具,RSI藉由計算一段期間內股價的漲跌變化,判斷最近的趨勢屬於偏強 (偏多) 還是偏弱 (偏空)。
MACD Indicator (Moving Average Convergence & Divergence) - MACD is a technical analysis tool proposed by Gerald Appel in the 1970s. It is commonly used in trading to determine trend reversals by analyzing the convergence and divergence of fast and slow lines.
MACD 指標 (Moving Average Convergence & Divergence) 中文名為平滑異同移動平均線指標,MACD 是在 1970 年代由美國人 Gerald Appel 所提出,是一項歷史悠久且經常在交易中被使用的技術分析工具,原理是利用快慢線的交錯,藉以判斷股價走勢的轉折。
In MACD analysis, the most commonly used values are 12, 26, and 9, known as MACD (12,26,9). The market often uses the MACD indicator to determine the future direction of assets and to identify entry and exit points.
在 MACD 的技術分析中,最常用的值為 12 天、26 天、9 天,也稱為 MACD (12,26,9),市場常用 MACD 指標來判斷操作標的的後市走向,確定波段漲幅並找到進、出場點。
Strategy analysis by member KR陳:
策略解析 by群友 KR陳 :
Condition 1: RSI value in the previous candle is below oversold zone(30).
條件1:RSI 在前一根的數值低於超賣區(30)
buycondition1 = RSI <30
Condition 2: MACD histogram changes from decreasing to increasing.
條件2:MACD柱由遞減轉遞增
buycondition2 = hist >hist and hist <hist
Strategy Effect Display:
策略效果展示:
Slight modification:
稍微修改:
I've added the ATR-MACD, developed earlier, as a filter signal alongside the classic MACD. The appearance of an upward-facing triangle indicates that the ATR MACD histogram also triggers the condition, aiming to serve as a filtering mechanism.
我在經典的macd作爲條件的同時 也加入了之前開發的ATR-MACD作爲過濾信號 出現朝上的三角圖示代表ATR MACD的柱狀圖一樣觸發條件 希望可以以此起到過濾的作用
Asset/Usage Instructions:
使用標的/使用説明
Through backtesting, it's found that it's not suitable for smaller time frames as there's a lot of noise. It's recommended to use it in assets with a long-term bullish view, focusing on time frames of 12 hours or longer such as 12H, 16H, 1D, 1W to find spot buying opportunities.
經過回測發現 并不適用與一些小級別時區 噪音會非常多,建議在一些長期看漲的標的中切入12小時以上的時區如12H,16H, 1D, 1W 中間尋找現貨買入的機會。
A few thoughts:
Overall, it's a very good indicator strategy for spot buying in the physical market. Thanks to member @KR陳 for sharing!
一些小感言 綜合來看是一個針對現貨買入非常好的指標策略,感謝群友@KR陳的分享!
Price Prediction With Rolling Volatility [TradeDots]The "Price Prediction With Rolling Volatility" is a trading indicator that estimates future price ranges based on the volatility of price movements within a user-defined rolling window.
HOW DOES IT WORK
This indicator utilizes 3 types of user-provided data to conduct its calculations: the length of the rolling window, the number of bars projecting into the future, and a maximum of three sets of standard deviations.
Firstly, the rolling window. The algorithm amasses close prices from the number of bars determined by the value in the rolling window, aggregating them into an array. It then calculates their standard deviations in order to forecast the prospective minimum and maximum price values.
Subsequently, a loop is initiated running into the number of bars into the future, as dictated by the second parameter, to calculate the maximum price change in both the positive and negative direction.
The third parameter introduces a series of standard deviation values into the forecasting model, enabling users to dictate the volatility or confidence level of the results. A larger standard deviation correlates with a wider predicted range, thereby enhancing the probability factor.
APPLICATION
The purpose of the indicator is to provide traders with an understanding of the potential future movement of the price, demarcating maximum and minimum expected outcomes. For instance, if an asset demonstrates a substantial spike beyond the forecasted range, there's a significantly high probability of that price being rejected and reversed.
However, this indicator should not be the sole basis for your trading decisions. The range merely reflects the volatility within the rolling window and may overlook significant historical price movements. As with any trading strategies, synergize this with other indicators for a more comprehensive and reliable analysis.
Note: In instances where the number of predicted bars is exceedingly high, the lines may become scattered, presumably due to inherent limitations on the TradingView platform. Consequently, when applying three SD in your indicator, it is advised to limit the predicted bars to fewer than 80.
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.
Fibonacci Trend Reversal StrategyIntroduction
This publication introduces the " Fibonacci Retracement Trend Reversal Strategy, " tailored for traders aiming to leverage shifts in market momentum through advanced trend analysis and risk management techniques. This strategy is designed to pinpoint potential reversal points, optimizing trading opportunities.
Overview
The strategy leverages Fibonacci retracement levels derived from @IMBA_TRADER's lance Algo to identify potential trend reversals. It's further enhanced by a method called " Trend Strength Over Time " (TSOT) (by @federalTacos5392b), which utilizes percentile rankings of price action to measure trend strength. This also has implemented Dynamic SL finder by utilizing @veryfid's ATR Stoploss Finder which works pretty well
Indicators:
Fibonacci Retracement Levels : Identifies critical reversal zones at 23.6%, 50%, and 78.6% levels.
TSOT (Trend Strength Over Time) : Employs percentile rankings across various timeframes to gauge the strength and direction of trends, aiding in the confirmation of Fibonacci-based signals.
ATR (Average True Range) : Implements dynamic stop-loss settings for both long and short positions, enhancing trade security.
Strategy Settings :
- Sensitivity: Set default at 18, adjustable for more frequent or sparse signals based on market volatility.
- ATR Stop Loss Finder: Multiplier set at 3.5, applying the ATR value to determine stop losses dynamically.
- ATR Length: Default set to 14 with RMA smoothing.
- TSOT Settings: Hard-coded to identify percentile ranks, with no user-adjustable inputs due to its intrinsic calculation method.
Trade Direction Options : Configurable to support long, short, or both directions, adaptable to the trader's market assessment.
Entry Conditions :
- Long Entry: Triggered when the price surpasses the mid Fibonacci level (50%) with a bullish TSOT signal.
- Short Entry: Activated when the price falls below the mid Fibonacci level with a bearish TSOT indication.
Exit Conditions :
- Employs ATR-based dynamic stop losses, calibrated according to current market volatility, ensuring effective risk management.
Strategy Execution :
- Risk Management: Features adjustable risk-reward settings and enables partial take profits by default to systematically secure gains.
- Position Reversal: Includes an option to reverse positions based on new TSOT signals, improving the strategy's responsiveness to evolving market conditions.
The strategy is optimized for the BYBIT:WIFUSDT.P market on a scalping (5-minute) timeframe, using the default settings outlined above.
I spent a lot of time creating the dynamic exit strategies for partially taking profits and reversing positions so please make use of those and feel free to adjust the settings, tool tips are also provided.
For Developers: this is published as open-sourced code so that developers can learn something especially on dynamic exits and partial take profits!
Good Luck!
Disclaimer
This strategy is shared for educational purposes and must be thoroughly tested under diverse market conditions. Past performance does not guarantee future results. Traders are advised to integrate this strategy with other analytical tools and tailor it to specific market scenarios. I was only sharing what I've crafted while strategizing over a Solana Meme Coin.
Multi Timeframe ATR IndicatorThe Average True Range (ATR) indicator is a technical analysis tool used to measure market volatility. The ATR indicator is designed to capture the degree of price movement or price volatility over a specified period of time. It does this by calculating the true range for each bar or candlestick on a chart and then taking an average of these true range values over a set period.
In the provided Pine Script code, the ATR indicator is being calculated for two different timeframes, which allows traders to compare volatility across different periods. The script includes user-defined inputs for the length of the ATR calculation and the type of smoothing (RMA or SMA) to be applied to the true range values. The 'smoothingFunc' function within the script determines whether to use the RMA (Relative Moving Average) or SMA (Simple Moving Average) based on the user's selection.
The true range for each bar is calculated as the maximum of the following three values: the difference between the current high and low, the absolute value of the difference between the current high and the previous close, and the absolute value of the difference between the current low and the previous close. This calculation is designed to ensure that gaps and limit moves are properly accounted for in the volatility measurement.
The script then uses the 'smoothingFunc' to calculate the ATR values for the two timeframes, and these values are plotted on the chart as two separate lines, allowing traders to visually assess the volatility levels.
Overall, this custom ATR indicator is a versatile tool for traders who wish to analyse market volatility and compare it across different timeframes, potentially aiding in making more informed trading decisions based on the prevailing market conditions.
VIX and SKEW RSI Moving AveragesSKEW and VIX are both indicators of market volatility and risk, but they represent different aspects.
VIX (CBOE Volatility Index) :.
The VIX is a well-known indicator for predicting future market volatility. It is calculated primarily based on S&P 500 options premiums and indicates the degree of market instability and risk.
Typically, when the VIX is high, market participants view the future as highly uncertain and expect sharp volatility in stock prices. It is generally considered an indicator of market fear.
SKEW Index :.
The SKEW is a measure of how much market participants estimate the risk of future declines in stock prices, calculated by the CBOE (Chicago Board Options Exchange) and derived from the premium on S&P 500 options.
If the SKEW is high, market participants consider the risk of future declines in stock prices to be high. This generally indicates a "fat tail at the base" of the market and suggests that the market perceives it as very risky.
These indicators are used by market participants to indicate their concerns and expectations about future stock price volatility. In general, when the VIX is high and the SKEW is high, the market is considered volatile and risky. Conversely, when the VIX is low and the SKEW is low, the market is considered relatively stable and low risk.
Inverse Relationship between SKEW and VIX
It is often observed that there is an inverse correlation between SKEW and VIX. In general, the relationship is as follows
High VIX and low SKEW: When the VIX is high and the SKEW is low, the market is considered volatile while the risk of future stock price declines is low. This indicates that the market is exposed to sharp volatility, but market participants do not expect a major decline.
Low VIX and High SKEW: A low VIX and high SKEW indicates that the market is relatively stable, while the risk of future declines in stock prices is considered high. This indicates that the market is calm, but market participants are wary of a sharp future decline.
This inverse correlation is believed to be the result of market participants' psychology and expectations affecting the movements of the VIX and SKEW. For example, when the VIX is high, it is evident that the market is volatile, and under such circumstances, people tend to view the risk of a sharp decline in stock prices as low. Conversely, when the VIX is low, the market is considered relatively stable and the risk of future declines is likely to be higher.
SKEWVIX RSIMACROSS
In order to compare the trends of the SKEW and VIX, the 50-period moving average of the Relative Strength Index (RSI) was used for verification. the RSI is an indicator of market overheating or overcooling, and the 50-period moving average can be used to determine the medium- to long-term trend. This analysis reveals how the inverse correlation between the SKEW and the VIX relates to the long-term moving average of the RSI.
how to use
Moving Average Direction
Rising blue for VIXRSI indicates increased uncertainty in the market
Rising red for SKEWRSI indicates optimism and beyond
RSI moving average crossing
When the SKEW is dominant, market participants are considered less concerned about a black swan event (significant unexpected price volatility). This suggests that the market is stable and willing to take risks. On the other hand, when the VIX is dominant, it indicates increased market volatility. Investors are more concerned about market uncertainty and tend to take more conservative positions to avoid risk. The direction of the moving averages and the crossing of the moving averages of the two indicators can give an indication of the state of the market.
SKEW>VIX Optimistic/Goldilocks
VIX>SKEW Uncertainty/turbulence
The market can be judged as follows.
BestRegards
KC-MACD Entry Master @shrilssThe KC-MACD Entry Master is designed to enhance trading strategies by utilizing Keltner Channels and MACD for dynamic market analysis. This indicator excels in visually identifying market conditions with a sophisticated bar coloring system and an informative MACD Traffic Light feature.
Key Features:
- Dynamic Bar Coloring: The core feature of this indicator is its ability to adjust the color of bars based on their positioning relative to the Keltner Channels and the EMA (Exponential Moving Average). It colors bars lime or red when the closing price is within the Keltner Channels but above or below the EMA, respectively. Additionally, it uses a fuchsia color to indicate breakouts when the price extends beyond the Keltner Channels. This visual aid helps traders quickly identify potential buying or selling opportunities based on market volatility and price action.
- MACD Traffic Light: Positioned at the bottom of the chart, this unique feature displays the histogram color of the MACD, set by default to a 3/10/16 configuration—known as the 3-10 Oscillator. This Traffic Light gives traders an at-a-glance view of the underlying momentum and trend shifts, further aiding in decision-making processes.
- MACD-Based Entry Signals: By calculating the fast and slow moving averages specified by the user, the script determines MACD values and their crossover with a smoothed signal line. Entry points are then highlighted with shapes (e.g., "Buy" or "Sell") plotted on the chart when conditions are met, including alignment with the bar colors for enhanced accuracy.
Long Bar Highlighter @shrilssThe Long Bar Highlighter is designed to detect long bars that exhibit significant price expansion beyond recent price levels. It highlights bars that exceed the length of the previous four bars, marking them for their potential importance in market movements. Additionally, the indicator plots directional shapes based on the closing prices, which helps traders visualize potential upward or downward momentum. An optional ATR crossover setting refines these signals, focusing on stronger trends for more optimal trading opportunities.
FOMO Alert (Miu)This indicator won't plot anything to the chart.
Please follow steps below to set your alarms based on price range variation:
1) Add indicator to the chart
2) Go to settings
3) Choose timeframe which will be used to calculate bars
4) Choose how many bars which will be used to calculate max and min range
5) Choose max and min range variation (%) to trigger alerts
5) Choose up to 6 different symbols to get alert notification
6) Once all is set go back to the chart and click on 3 dots to set alert in this indicator, rename your alert and confirm
7) You can remove indicator after alert is set and it'll keep working as expected
What does this indicator do?
This indicator will generate alerts based on following conditions:
- If min and max prices reach the range (%) from amount of bars on timeframe set for any symbol checked it will trigger an alert.
- If next set of bars reaches higher range than before it will trigger an alert with new data
- If next set of bars doesn't reach higher range than before it will not trigger alerts, even if they are above the range set (this is to prevent the alert to keep triggering with high frequency)
Once condition is met it will send an alert with the following information:
- Symbol name (e.g: BTC, ETH, LTC)
- Range achieved (e.g: 3,03%)
- Current symbol price and current bar direction (e.g: 63,477.1 ▲)
This script will request lowest and highest prices through request.security() built-in function from all different symbols within the range set. It also requests symbols' price (close) and amount of digits (mintick) for each symbol to send alerts with correct value.
This script was developed with main purpose to send alerts when there are strong price movements and I decided to share with community so anyone can set different parameters for different purposes.
Feel free to give feedbacks on comments section below.
Enjoy!
[Sharpe projection SGM]Dynamic Support and Resistance: Traces adjustable support and resistance lines based on historical prices, signaling new market barriers.
Price Projections and Volatility: Calculates future price projections using moving averages and plots annualized standard deviation-based volatility bands to anticipate price dispersion.
Intuitive Coloring: Colors between support and resistance lines show up or down trends, making it easy to analyze quickly.
Analytics Dashboard: Displays key metrics such as the Sharpe Ratio, which measures average ROI adjusted for asset volatility
Volatility Management for Options Trading: The script helps evaluate strike prices and strategies for options, based on support and resistance levels and projected volatility.
Importance of Diversification: It is necessary to diversify investments to reduce risks and stabilize returns.
Disclaimer on Past Performance: Past performance does not guarantee future results, projections should be supplemented with other analyses.
The script settings can be adjusted according to the specific needs of each user.
The mean and standard deviation are two fundamental statistical concepts often represented in a Gaussian curve, or normal distribution. Here's a quick little lesson on these concepts:
Average
The mean (or arithmetic mean) is the result of the sum of all values in a data set divided by the total number of values. In a data distribution, it represents the center of gravity of the data points.
Standard Deviation
The standard deviation measures the dispersion of the data relative to its mean. A low standard deviation indicates that the data is clustered near the mean, while a high standard deviation shows that it is more spread out.
Gaussian curve
The Gaussian curve or normal distribution is a graphical representation showing the probability of distribution of data. It has the shape of a symmetrical bell centered on the middle. The width of the curve is determined by the standard deviation.
68-95-99.7 rule (rule of thumb): Approximately 68% of the data is within one standard deviation of the mean, 95% is within two standard deviations, and 99.7% is within three standard deviations.
In statistics, understanding the mean and standard deviation allows you to infer a lot about the nature of the data and its trends, and the Gaussian curve provides an intuitive visualization of this information.
In finance, it is crucial to remember that data dispersion can be more random and unpredictable than traditional statistical models like the normal distribution suggest. Financial markets are often affected by unforeseen events or changes in investor behavior, which can result in return distributions with wider standard deviations or non-symmetrical distributions.
Tweet/X Post Timestamp - By LeviathanThis script allows you to generate visual timestamps of X/Twitter posts directly on your chart, highlighting the precise moment an X post/tweet was made. All you have to do is copy and paste the post URL.
◽️ Use Cases:
- News Trading: Traders can use this indicator to visually align market price actions with news or announcements made on X (formerly Twitter), aiding in the analysis of news impact on market volatility.
- Behavioral Analysis: Traders studying the influence of social media on price can use the timestamps to track correlations between specific posts and market reactions.
- Proof of Predictions: Traders can use this indicator to timestamp their market forecasts shared on X (formerly Twitter), providing a visual record of their predictions relative to actual market movements. This feature allows for transparent verification of the timing and accuracy of their analyses
◽️ Process of Timestamp Calculation
The calculation of the timestamp from a tweet ID involves the following steps:
Extracting the Post ID:
The script first parses the input URL provided by the user to extract the unique ID of the tweet or X post. This ID is embedded in the URL and is crucial for determining the exact posting time.
Calculating the Timestamp:
The post ID undergoes a mathematical transformation known as a right shift by 22 bits. This operation aligns the ID's timestamp to a base reference time used by the platform.
Adding Base Offset:
The result from the right shift is then added to a base offset timestamp (1288834974657 ms, the epoch used by Twitter/X). This converts the processed ID into a UNIX timestamp reflecting the exact moment the post was made.
Date-Time Conversion:
The UNIX timestamp is further broken down into conventional date and time components (year, month, day, hour, minute, second) using calculations that account for leap years and varying days per month.
Label Placement:
Based on user settings, labels displaying the timestamp, username, and other optional information such as price changes or pivot points are dynamically placed on the chart at the bar corresponding to the timestamp.
Dise prev Gen Long/Short
This script builds levels based on the High and Low of the previous trading day; a middle line is also added, which is the average value of these data. The indicator generates a long signal when the High level of the previous day is broken, as well as a short signal when the low is broken. The idea of the indicator is to capture volatility in the crypto market. You can try small takes of 1-2% of the movement, they will be more likely to work out. The script is intended rather to search for interesting “strong” assets within a day, for further analysis of whether it is worth trading or not.
EMA Scalping StrategyEMA Slope Indicator Overview:
The indicator plots two exponential moving averages (EMAs) on the chart: a 9-period EMA and a 15-period EMA.
It visually represents the EMAs on the chart and highlights instances where the slope of each EMA exceeds a certain threshold (approximately 30 degrees).
Scalping Strategy:
Using the EMA Slope Indicator on a 5-minute timeframe for scalping can be effective, but it requires adjustments to account for the shorter time horizon.
Trend Identification: Look for instances where the 9-period EMA is above the 15-period EMA. This indicates an uptrend. Conversely, if the 9-period EMA is below the 15-period EMA, it suggests a downtrend.
Slope Analysis: Pay attention to the slope of each EMA. When the slope of both EMAs is steep (exceeds 30 degrees), it signals a strong trend. This can be a favorable condition for scalping as it suggests potential momentum.
Entry Points:
For Long (Buy) Positions: Consider entering a long position when both EMAs are sloping upwards strongly (exceeding 30 degrees) and the 9-period EMA is above the 15-period EMA. Look for entry points when price retraces to the EMAs or when there's a bullish candlestick pattern.
For Short (Sell) Positions: Look for opportunities to enter short positions when both EMAs are sloping downwards strongly (exceeding -30 degrees) and the 9-period EMA is below the 15-period EMA. Similar to long positions, consider entering on retracements or bearish candlestick patterns.
Exit Strategy: Use tight stop-loss orders to manage risk, and aim for small, quick profits. Since scalping involves short-term trading, consider exiting positions when the momentum starts to weaken or when the price reaches a predetermined profit target.
Risk Management:
Scalping involves high-frequency trading with smaller profit targets, so it's crucial to implement strict risk management practices. This includes setting stop-loss orders to limit potential losses and not risking more than a small percentage of your trading capital on each trade.
Backtesting and Optimization:
Before implementing the strategy in live trading, backtest it on historical data to assess its performance under various market conditions. You may also consider optimizing the strategy parameters (e.g., EMA lengths) to maximize its effectiveness.
Continuous Monitoring:
Keep a close eye on market conditions and adjust your strategy accordingly. Market dynamics can change rapidly, so adaptability is key to successful scalping.
Candle Strength based on Relative Strength of EMAOverview:
The EMA-Based Relative Strength Labels indicator provides a dynamic method to visualize the strength of price movements relative to an Exponential Moving Average (EMA). By comparing the current price to the EMA, it assigns labels (A, B, C for bullish and X, Y, Z for bearish) to candles, indicating the intensity of bullish or bearish behavior.
Key Features:
Dynamic EMA Comparison: The indicator calculates the difference between the current price and the EMA, expressing it as a percentage to determine relative strength.
Configurable Thresholds: Users can set custom thresholds for strong, moderate, and low bullish or bearish movements, allowing for tailored analysis based on personal trading strategy or market behavior.
Clear Visual Labels: Each candle is labeled directly on the chart, making it easy to spot significant price movements at a glance.
Usage:
Trend Confirmation: The labels help confirm the prevailing trend's strength, aiding traders in decision-making regarding entry or exit points.
Risk Management: By identifying the strength of the price movements, traders can better manage stop-loss placements and avoid potential false breakouts.
Strategy Development: Incorporate the indicator into trading systems to enhance strategies that depend on trend strength and momentum.
How It Works:
The script calculates the EMA of the closing prices and measures the relative strength of each candle to this average.
Bullish candles above the EMA and bearish candles below the EMA are further analyzed to determine their strength based on predefined percentage thresholds.
Labels 'A', 'B', and 'C' are assigned for varying degrees of bullish strength, while 'X', 'Y', and 'Z' denote levels of bearish intensity.
Customization:
Users can adjust the EMA period and modify the strength thresholds for both bullish and bearish conditions to suit different instruments and timeframes.
Best Practices:
Combine this indicator with volume analysis and other technical tools for comprehensive market analysis.
Regularly update the thresholds based on market volatility and personal risk tolerance to maintain the effectiveness of the labels.
Pine Script Chart ViewerDisplay your custom charts exported from anywhere in TradingView.
Put your candles on candles :
var Candle candles = array.from(...)
For instance:
var Candle candles = array.from(Candle.new(2.0, 4.0, 1.0, 3.0), Candle.new(3.0, 5.0, 2.0, 4.0))
Candle details:
Candle.new(open_1, high_1, low_1, close_1)
Swing Harmony IndicatorThis indicator is called "Swing Harmony Indicator" and it calculates the average of the highest high and lowest low prices over a certain period, along with a simple moving average of the closing prices. It then plots these values on the chart, with the color of the average line dynamically changing based on whether the second average is less than or greater than the first average.
Dynamic Price Oscillator (Zeiierman)█ Overview
The Dynamic Price Oscillator (DPO) by Zeiierman is designed to gauge the momentum and volatility of asset prices in trading markets. By integrating elements of traditional oscillators with volatility adjustments and Bollinger Bands, the DPO offers a unique approach to understanding market dynamics. This indicator is particularly useful for identifying overbought and oversold conditions, capturing price trends, and detecting potential reversal points.
█ How It Works
The DPO operates by calculating the difference between the current closing price and a moving average of the closing price, adjusted for volatility using the True Range method. This difference is then smoothed over a user-defined period to create the oscillator. Additionally, Bollinger Bands are applied to the oscillator itself, providing visual cues for volatility and potential breakout signals.
█ How to Use
⚪ Trend Confirmation
The DPO can serve as a confirmation tool for existing trends. Traders might look for the oscillator to maintain above or below its mean line to confirm bullish or bearish trends, respectively. A consistent direction in the oscillator's movement alongside price trend can provide additional confidence in the strength and sustainability of the trend.
⚪ Overbought/Oversold Conditions
With the application of Bollinger Bands directly on the oscillator, the DPO can highlight overbought or oversold conditions in a unique manner. When the oscillator moves outside the Bollinger Bands, it signifies an extreme condition.
⚪ Volatility Breakouts
The width of the Bollinger Bands on the oscillator reflects market volatility. Sudden expansions in the bands can indicate a breakout from a consolidation phase, which traders can use to enter trades in the direction of the breakout. Conversely, a contraction suggests a quieter market, which might be a signal for traders to wait or to look for range-bound strategies.
⚪ Momentum Trading
Momentum traders can use the DPO to spot moments when the market momentum is picking up. A sharp move of the oscillator towards either direction, especially when crossing the Bollinger Bands, can indicate the start of a strong price movement.
⚪ Mean Reversion
The DPO is also useful for mean reversion strategies, especially considering its volatility adjustment feature. When the oscillator touches or breaches the Bollinger Bands, it indicates a deviation from the normal price range. Traders might look for opportunities to enter trades anticipating a reversion to the mean.
⚪ Divergence Trading
Divergences between the oscillator and price action can be a powerful signal for reversals. For instance, if the price makes a new high but the oscillator fails to make a corresponding high, it may indicate weakening momentum and a potential reversal. Traders can use these divergence signals to initiate counter-trend moves.
█ Settings
Length: Determines the lookback period for the oscillator and Bollinger Bands calculation. Increasing this value smooths the oscillator and widens the Bollinger Bands, leading to fewer, more significant signals. Decreasing this value makes the oscillator more sensitive to recent price changes, offering more frequent signals but with increased noise.
Smoothing Factor: Adjusts the degree of smoothing applied to the oscillator's calculation. A higher smoothing factor reduces noise, offering clearer trend identification at the cost of signal timeliness. Conversely, a lower smoothing factor increases the oscillator's responsiveness to price movements, which may be useful for short-term trading but at the risk of false signals.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Market Trend OscillatorMarket Trend Oscillator segments the market into ranged bound and trending aspect. The threshold level segregates both types of market. With higher level, both the risk and reward lower down.
The MTO indicator, is based on Standard Deviation, difference between highest high and lowest low, ATR and ADR. There are two different volatility aspect which are:
Volatility according to the movement of one price e.g. closing price.
Volatility according to the candles.
The minimum of both these aspects gives an insight into the volatility of the market. To segregate a dynamic value with ATR and ADR is used with the threshold level. Moreover, the volatilities can be smoothed to have a smoother decision making.
Coiled Moving AveragesThis indicator detects when 3 moving averages converge and become coiled. This indicates volatility contraction which often leads to volatility expansion, i.e. large price movements.
Moving averages are considered coiled when the percent difference from each moving average to the others is less than the Coil Tolerance % input value.
This indicator is unique in that it detects when moving averages converge within a specified percent range. This is in contrast to other indicators that only detect moving average crossovers, or the distance between price and a moving average.
This indicator includes options such as:
- % difference between the MAs to be considered coiled
- type and length of MAs
- background color to indicate when the MAs are coiled
- arrows to indicate if price is above or below the MAs when they become coiled
While coiling predicts an increased probability for volatility expansion, it does not necessarily predict the direction of expansion. However, the arrows which indicate whether price is above or below the moving average coil may increase the odds of a move in that direction. Bullish alignment of the moving averages (faster MAs above the slower MAs) may also increase the odds of a bullish break, while bearish alignment may increase the odds of a bearish break.
Note that mean reversion back to the MA coil is common after initial volatility expansion. This can present an entry opportunity for traders, as mean reversion may be followed by continuation in the direction of the initial break.
Experiment with different settings and timeframes to see how coiled MAs can help predict the onset of volatility.