Regression Line (Log)This indicator is based on the "Linear Regression Channel (Log)," which, in turn, is derived from TradingView's "Linear Regression Channel."
The "Regression Line (Log)" indicator is a valuable tool for traders and investors seeking to gain insights into long-term market trends. This indicator is personally favored for its ability to provide a comprehensive view of price movements over extended periods. It offers a unique perspective compared to traditional linear regression lines and moving averages, making it a valuable addition to the toolkit of experienced traders and investors.
Indicator Parameters:
Before delving into the details, it's worth noting that the chosen number of periods (2870) is a personal preference. This specific value is utilized for the S&P 500 index due to its alignment with various theories regarding the beginning of the modern economic era in the stock market. Different analysts propose different starting points, such as the 1950s, 1970s, or 1980s. However, users are encouraged to adjust this parameter to suit their specific needs and trading strategies.
How It Works:
The "Regression Line (Log)" indicator operates by transforming the closing price data into a logarithmic scale. This transformation can make the linear regression more suitable for data with exponential trends or rapid growth. Here's a breakdown of its functioning and why it can be advantageous for long-term trend analysis:
1. Logarithmic Transformation : The indicator begins by applying a logarithmic transformation to the closing price. This transformation helps capture price movements proportionally, making it especially useful for assets that exhibit exponential or rapid growth. This transformation can render linear regression more suitable for data with exponential or fast-paced trends.
2. Linear Regression on Log Scale : After the logarithmic transformation, the indicator calculates a linear regression line (lrc) on this log-transformed data. This step provides a smoother representation of long-term trends compared to a linear regression line on a linear scale.
3. Exponential Reversion : To present the results in a more familiar format, the indicator reverts the log-transformed regression line back to a linear scale using the math.exp function. This final output is the "Linear Regression Curve," which can be easily interpreted on standard price charts.
Advantages:
- Long-Term Trend Clarity : The logarithmic scale better highlights long-term trends and exponential price movements, making it a valuable tool for investors seeking to identify extended trends.
- Smoothing Effect : The logarithmic transformation and linear regression on a log scale smooth out price data, reducing noise and providing a clearer view of underlying trends.
- Adaptability : The indicator allows traders and investors to customize the number of periods (length) to align with their preferred historical perspective or trading strategy.
- Complementary to Other Tools : While not meant to replace other technical indicators, the "Regression Line (Log)" indicator complements traditional linear regression lines and moving averages, offering an alternative perspective for more comprehensive analysis.
Conclusion:
In summary, the "Regression Line (Log)" indicator is a versatile tool that can enhance your ability to analyze long-term market trends. Its logarithmic transformation provides a unique perspective on price data, particularly suited for assets with exponential growth patterns. While the choice of the number of periods is a personal one, it can be adapted to fit various historical viewpoints. This indicator is best utilized as part of a well-rounded trading strategy, in conjunction with other technical tools, to aid in informed decision-making.
Trend
Market TrendMarket Trend by Trading Ninjaa
Description:
The "Market Trend" indicator is designed to provide traders with a clear visual representation of the prevailing market direction. By utilizing a higher timeframe moving average, this tool offers insights into the broader market trend. The indicator identifies:
Uptrends: When the price is above the higher timeframe moving average, the background is shaded green.
Downtrends: When the price is below the higher timeframe moving average, the background is shaded red.
Sideways Markets: Recognized by decreased volatility, these periods are shaded in gray.
Usage:
Green Background: Indicates bullish market conditions. Traders might consider long entries or avoiding short trades.
Red Background: Suggests bearish market conditions. Might be used as a signal to consider short entries or avoid long positions.
Gray Background: Highlights potential sideways or consolidating market conditions. Traders might exercise caution, considering range-bound strategies.
Tips:
This indicator is best used in conjunction with other technical tools for confirmation. Always backtest any new strategy involving this indicator before considering it for live trading.
Hybrid EMA AlgoLearner⭕️Innovative trading indicator that utilizes a k-NN-inspired algorithmic approach alongside traditional Exponential Moving Averages (EMAs) for more nuanced analysis. While the algorithm doesn't actually employ machine learning techniques, it mimics the logic of the k-Nearest Neighbors (k-NN) methodology. The script takes into account the closest 'k' distances between a short-term and long-term EMA to create a weighted short-term EMA. This combination of rule-based logic and EMA technicals offers traders a more sophisticated tool for market analysis.
⭕️Foundational EMAs: The script kicks off by generating a 50-period short-term EMA and a 200-period long-term EMA. These EMAs serve a dual purpose: they provide the basic trend-following capability familiar to most traders, akin to the classic EMA 50 and EMA 200, and set the stage for more intricate calculations to follow.
⭕️k-NN Integration: The indicator distinguishes itself by introducing k-NN (k-Nearest Neighbors) logic into the mix. This machine learning technique scans prior market data to find the closest 'neighbors' or distances between the two EMAs. The 'k' closest distances are then picked for further analysis, thus imbuing the indicator with an added layer of data-driven context.
⭕️Algorithmic Weighting: After the k closest distances are identified, they are utilized to compute a weighted EMA. Each of the k closest short-term EMA values is weighted by its associated distance. These weighted values are summed up and normalized by the sum of all chosen distances. The result is a weighted short-term EMA that packs more nuanced information than a simple EMA would.
TTP SuperTrend ADXThis indicator uses the strength of the trend from ADX to decide how the SuperTrend (ST) should behave.
Motivation
ST is a great trend following indicator but it's not capable of adapting to the trend strength.
The ADX, Average Directional Index measures the strength of the trend and can be use to dynamically tweak the ST factor so that it's sensitivity can adapt to the trend strength.
Implementation
The indicator calculates a normalised value of the ADX based on the data available in the chart.
Based on these values ST will use different factors to increase or reduce the factor use by ST: expansion or compression.
ST expansion vs compression
Expanding the ST would mean that the stronger a trends get the ST factor will grow causing it to distance further from the price delaying the next ST trend flip.
Compressing the ST would mean that the stronger a trends get the ST factor will shrink causing it to get closer to the price speeding up the next ST trend flip.
Features
- Alerts for trend flip
- Alerts for trend status
- Backtestable stream
- SuperTrend color gets more intense with the strength of the trend
Machine Learning Regression Trend [LuxAlgo]The Machine Learning Regression Trend tool uses random sample consensus (RANSAC) to fit and extrapolate a linear model by discarding potential outliers, resulting in a more robust fit.
🔶 USAGE
The proposed tool can be used like a regular linear regression, providing support/resistance as well as forecasting an estimated underlying trend.
Using RANSAC allows filtering out outliers from the input data of our final fit, by outliers we are referring to values deviating from the underlying trend whose influence on a fitted model is undesired. For financial prices and under the assumptions of segmented linear trends, these outliers can be caused by volatile moves and/or periodic variations within an underlying trend.
Adjusting the "Allowed Error" numerical setting will determine how sensitive the model is to outliers, with higher values returning a more sensitive model. The blue margin displayed shows the allowed error area.
The number of outliers in the calculation window (represented by red dots) can also be indicative of the amount of noise added to an underlying linear trend in the price, with more outliers suggesting more noise.
Compared to a regular linear regression which does not discriminate against any point in the calculation window, we see that the model using RANSAC is more conservative, giving more importance to detecting a higher number of inliners.
🔶 DETAILS
RANSAC is a general approach to fitting more robust models in the presence of outliers in a dataset and as such does not limit itself to a linear regression model.
This iterative approach can be summarized as follow for the case of our script:
Step 1: Obtain a subset of our dataset by randomly selecting 2 unique samples
Step 2: Fit a linear regression to our subset
Step 3: Get the error between the value within our dataset and the fitted model at time t , if the absolute error is lower than our tolerance threshold then that value is an inlier
Step 4: If the amount of detected inliers is greater than a user-set amount save the model
Repeat steps 1 to 4 until the set number of iterations is reached and use the model that maximizes the number of inliers
🔶 SETTINGS
Length: Calculation window of the linear regression.
Width: Linear regression channel width.
Source: Input data for the linear regression calculation.
🔹 RANSAC
Minimum Inliers: Minimum number of inliers required to return an appropriate model.
Allowed Error: Determine the tolerance threshold used to detect potential inliers. "Auto" will automatically determine the tolerance threshold and will allow the user to multiply it through the numerical input setting at the side. "Fixed" will use the user-set value as the tolerance threshold.
Maximum Iterations Steps: Maximum number of allowed iterations.
TICK Strength Background ShadeThis indicator shades the background of each candle based on the strength off the current TICK.US chart. User can define the strength levels, which are by default set to 1-299 (lightest), 300-599, and 600+ (darkest). Best used on lower timeframe charts to help identify whether or not to remain in a trend, or if a trend is possibly reversing when you start to see the opposite color begin to appear following a trend.
OrderBlock [kyleAlgo]The principle of this indicator
ATR (Average True Range) Setting: The code uses ATR to help calculate the Supertrend indicator.
Supertrend Trend Direction: Identify bullish and bearish trends with the Supertrend method.
Order Block Recognition: This part of the code recognizes and creates order blocks, visualizing them as boxes on the chart. If the number of blocks exceeds the maximum limit, old blocks will be deleted.
Function to prevent overlapping: check whether the new order block overlaps with the existing order block through the isOverlapping function.
Order block color setting: The code sets the color according to whether the block is bullish or bearish, and whether it breaks above or below. Afterwards the color of the existing order blocks will be updated.
Sensitivity settings: Through the input settings of factor and atrPeriod, the sensitivity of Supertrend and the detection of order blocks can be affected.
Visualization: Use TradingView's box.new function to draw and visualize order blocks on the chart.
Practicality:
Support and Resistance Levels: Order blocks may represent areas of support and resistance in the market. By visualizing these areas, traders can better understand when price reversals are likely to occur.
Trading Signals: Traders may be able to identify trading signals based on the color changes of blocks and price breakouts. For example, if the price breaks above a bullish block, this could be a signal to buy.
Risk Management: By using ATR to adjust the sensitivity of Supertrend, the symbol helps traders to adjust their strategies according to market volatility. This can be used as a risk management tool to help identify stop loss and take profit points.
Multi-timeframe analysis: Although the code itself does not implement multi-timeframe analysis directly, it can be done by applying this indicator on different timeframes. This helps to analyze the market from different angles.
Flexibility and Customization: Through sensitivity settings, traders can customize the indicator according to their needs and trading style.
Reduced screen clutter: By removing overlapping order blocks and limiting the maximum number of order blocks, this code helps reduce clutter on charts, allowing traders to analyze the market more clearly.
Overall, this "Pine Script" can be a powerful analytical tool for trend traders and those looking to improve their trading decisions by visualizing key market areas. It can be used alone or combined with other indicators and trading systems for enhanced functionality.
Fibo Levels with Volume Profile and Targets [ChartPrime]The Fib Levels With Volume Profile and Targets (FIVP) is a trading tool designed to provide traders with a unique understanding of price movement and trading volume through the lens of Fibonacci levels. This dynamic indicator merges the concepts of Fibonacci retracement levels with trading volume analytics to offer predictive insights into potential price trajectories.
Features:
1. Fibonacci Levels: The FPI showcases three prominent Fibonacci levels on both sides of the current price, offering an intricate picture of potential support and resistance levels.
2. Support and Resistance Recognition: Harnessing the power of Fibonacci levels, the FPI provides traders with potential areas of support and resistance, aiding in informed decision-making for entries, exits, and stop placements.
3. Customizable Timeframe Settings: In order to cater to different trading strategies and styles, users can manually select their preferred timeframe for the Fibonacci calculations, ensuring optimal relevance and accuracy for their trading approach.
4. Volume Analytics: One of the standout features of the FIVP is its ability to calculate trading volume for every bar that is sandwiched between the top and lower Fibonacci levels. This ensures traders have a clear vision of where the majority of trading activity is occurring, lending weight to the credibility of the displayed support and resistance zones.
5. Volume-Derived Price Targeting: The Possible Target Arrow function is an innovative feature. By analyzing and comparing the trading volume in the bearish and bullish zones, it provides an arrow indicating the potential direction the market might take. If the bull volume surpasses the bear volume, the market is likely skewing bullish and vice versa.
Usage
Ideal for both novice and seasoned traders, the FPI offers a rich tapestry of information. It allows for refined technical analysis, more precise entries and exits, and a holistic view of the interplay between price and trading volume. Whether you're scalping, day trading, or swing trading, the Fibonacci Profile Indicator is designed to enhance your trading strategy, providing a comprehensive perspective of the market's potential movements.
LNL Trend SystemLNL Trend System is an ATR based day trading system specifically designed for intra-day traders and scalpers. The System works on any chart time frame & can be applied to any market. The study consist of two components - the Trend Line and the Stop Line. Trend System is based on a special ATR calculation that is achieved by combining the previous values of the 13 EMA in relation to the ATR which creates a line of deviations that visually look similar to the basic moving average but actually produce very different results ESPECIALLY in sideways market.
Trend Line:
Trend Line is a simple line which is basically a fast gauge represented by the 13 EMA that can change the color based on the current trend structure defined by multiple averages (8,13,21,34 EMAs). Trend Line is there to simply add the confluence for the current trend. Colors of the line are pretty much self-explanatory. Whenever the line turns red it states that the current structure is bearish. Vice versa for green line. Gray line represents neutral market structure.
Stop Line:
Stop Line is an ATR deviaton line with special calculation based on the previous bar ATRs and position of the price in relation to the current and previous values of 13 EMA. As already stated, this creates an ATR deviation marker either above or below the price that trails the price up or down until they touch. Whenever the price comes into the Stop Line it means it is making an ATR expansion move up or down .This touch will usually resolve into a reaction (a bounce) which provides trade opportunities.
Trend Bars:
When turned ON, Trend Bars can provide additional confulence of the current trend alongside with the Trend Line color. Trend Bars are based on the DMI and ADX indicators. Whenever the DMI is bearish and ADX is above 20 the candles paint themselfs red. And vice versa applies for the green candles and bullish DMI. Whenever the ADX falls below the 20, candles are netural (Gray) which means there is no real trend in place at the moment.
Trend Mode:
There are total of 5 different trend modes available. Each mode is visualizing different ATR settings which provides either aggressive or more conservative approach. The more tigher the mode, the more closer the distance between the price and the Stop Line. First two modes were designed for slower markets, whereas the "Loose" and "FOMC" modes are more suitable for products with high volatility.
Trend Modes:
1. Tight
Ideal for the slowest markets. Slowest market can be any market with unusually small average true range values or just simply a market that does have a personality of a "sleeper". Tight Mode can be also used for aggresive entries in the most ridiculous trends. Sometimes price will barely pullback to the Trend Line not even the Stop Line.
2. Normal
Normal Mode is the golden mean between the modes. "Normal" provides the ideal ATR lengths for the most used markets such as S&P Futures (ES) or SPY, AAPL and plenty of other highly popular stocks. More often than not, the length of this mode is respected considering there is no breaking news or high impact market event scheduled.
3. Loose
The "Loose" mode is basically a normal mode but a little bit more loose. This mode is useful whenever the ATRs jump higher than usual or during the days of highly anticipated news events. This mode is also better suited for more active markets such as NQ futures.
4. FOMC
The FOMC mode is called FOMC for a reason. This mode provides the maximum amount of wiggle room between the price and the Stop Line. This mode was designed for the extreme volatility, breaking news events or post-FOMC trading. If the market quiets down, this mode will not get the Stop Line touch as frequently as othete modes, thus it is not very useful to run this on markets with the average volatlity. Although never properly tested, perhaps the FOMC mode can find its value in the crypto market?
5. The Net
The net mode is basically a combination of all modes into one stop line system which creates "the net" effect. The Net provides the widest Stop Line zone which can be mainly appreciated by traders that like to use scale-in scale-out methods for their trading. Not to mention the visual side of the indicator which looks pretty great with the net mode on.
HTF (Higher Time Frame) Trend System:
The system also includes additional higher time frame (HTF) trend system. This can be set to any time frame by manual HTF mode. HTF mode set to "auto" will automatically choose the best suitable higher time frame trend system based on how appropriate the aggregation is. For everything below 5min the HTF Trend System will stay on 5min. Anything between 5-15min = 30min. 30min - 120min will turn on the 240min. 180min and higher will result in Daily time frame. Anything above the Daily will result in Weekly HTF aggregation, above W = Monthly, above M = Quarterly.
Background Clouds:
In terms of visualization, each trend system is fully customizable through the inputs settings. There is also an option to turn on/off the background clouds behind the stop lines. These clouds can make the charts more clean & visible.
Tips & Tricks:
1. Different Trend Modes
Try out different modes in different markets. There is no one single mode that will fit to everyone on the same type of market. I myself actually prefer more Loose than the Normal.
2. Stop Line Mirroring
Whenever the Stop Lines start to mirror each other (there is one above the price and one below) this means the price is entering a ranging sideways market. It does not matter which Stop Line will the price touch first. They can both be faded until one of them flips.
3. Signs of the Ranging Market
Watch out for signs of ranging market. Whenever the Trend System looses its colors whether on trend line or trend bars, if everything turns neutral (gray) that is usually a solid indication of a range type action for the following moments. Also as already stated before, the Stop Line mirroring is a good sign of the range market.
4. Trailing Tool, Trend System as an Additional Study?
In case you are not a fan of the colorful green / red charts & candles. You can switch all of them off and just leave the Stop Line on. This way you can use the benefits of the trend system and still use other studies on top of that. Similarly as the Parabolic SAR is often used.
5. The Flip Setup
One of my favorite trades is the Flip Setup on the 5min charts. Whenever the Stop Line is broken , the very first opposing touch after the Trend System flips is a usually a highly participated touch. If there is a strong reaction, this means this is likely a beginning of a new trend. Once I am in the position i like to trail the Stop Line on the 1min charts.
Hope it helps.
Pivot Point SuperTrend Strategy +TrendFilterIn the dynamic world of financial markets, traders are always on the lookout for innovative strategies to identify trends and make timely trades. The "Pivot Point SuperTrend strategy +TrendFilter" has emerged as an intriguing approach, combining two popular indicators - Pivot Points and SuperTrend, while introducing an additional trend filter for added precision. This strategy draws inspiration from Lonesome TheBlue's "Pivot Point SuperTrend" script, aiming to provide traders with a reliable tool for trend following while minimizing false signals.
The Core Concept:
The strategy's foundation lies in the fusion of Pivot Points and SuperTrend indicators, and the addition of a robust trend filter. It begins by calculating Pivot Highs and Lows over a specified period, serving as crucial reference points for trend analysis. Through a weighted average calculation, these Pivot Points create a center line, refining the overall indicator.
Next, based on the center line and the Average True Range (ATR) with a user-defined Factor, upper and lower bands are generated. These bands adapt to market volatility, adding flexibility to the strategy. The heart of the "Pivot Point SuperTrend" strategy lies in accurately identifying the prevailing trend, with the indicator smoothly transitioning between bullish and bearish signals as the price interacts with the SuperTrend bands.
The additional trend filter introduced into the strategy further enhances its capabilities. This filter is based on a moving average, providing a dynamic assessment of the trend's strength and direction. By combining this trend filter with the original Pivot Point SuperTrend signals, the strategy aims to make more informed and reliable trading decisions.
Advantages of "Pivot Point SuperTrend" with Trend Filter:
1. Enhanced Precision: The incorporation of a trend filter improves the strategy's accuracy by confirming the overall trend direction before generating signals.
2. Trend Continuation: The integration of Pivot Points and SuperTrend, along with the trend filter, aims to prolong trades during strong market trends, potentially maximizing profit opportunities.
3. Reduced Whipsaws: The strategy's weighted average calculation, coupled with the trend filter, helps minimize false signals and reduces whipsaws during uncertain or sideways market conditions.
4. Support and Resistance Insights: The strategy continues to provide additional support and resistance levels based on the Pivot Points, offering valuable contextual information to traders.
Heikin Ashi MTF Trend [Pt]█ Introduction
The Heikin Ashi MTF Trend indicator takes a simple approach to understand the trend by visualizing Heikin Ashi candle colors across multiple timeframes and representing it in a simple and visual manner. It utilizes the Heikin Ashi (HA) candles across four custom timeframes to detect trend shifts and strength. The indicator also offers alert conditions for potential bullish and bearish trend shifts.
█ Features
► Multiple Timeframes (MTF) Trend Detection: The script fetches HA data from four different timeframes. This multi-timeframe approach gives a holistic view of the market sentiment.
► Weighted Trend Score: The individual trend scores of the four timeframes are multiplied with their respective weights and summed up to provide a cumulative trend score that is used to determine bar colors and trend shifts.
► Visual Trend Depiction : It displays the trend using default green/red squares for each timeframe and a gradient-filled bar to represent the cumulative trend score.
► Trend Change Alerts: Users can set alerts for bullish and bearish trend shifts.
█ Alerts
◊ Bull Trend Signal Alert: Alert when there is a bullish trend shift.
◊ Bear Trend Signal Alert: Alert when there is a bearish trend shift.
█ Usage Tips
◊ The greater the discrepancy in the weights across the timeframes, the more emphasis is placed on the higher weighted timeframe.
◊ While the gradient bar provides a quick trend overview, it's essential to view the trend squares to understand the individual timeframe sentiments.
◊ Always consider using this tool in conjunction with other indicators or methods for confirmation and enhanced trading strategy.
Happy Trading~~
Support & Resistance Dynamic [LuxAlgo]The Support & Resistance Dynamic indicator aims to return real-time predictive support and resistance zones that are relevant to a detected trend. This makes this indicator similar to our previously published Predictive Ranges indicator.
Users can additionally extend the most recent historical support and resistance zones.
🔶 USAGE
Hypothetical resistance levels in an up-trend or supports in a down-trend would tend to be broken more easily, as such the indicator primary objective is to return reliable real-time support and resistance levels by taking this into account.
When the market is up-trending the indicator will only return support zones, while a down-trending market will cause the indicator to only return resistance zones.
If the price significantly breaks a support/resistance, rendering it unreliable, it can be a sign of a potential reversal.
Users can return support/resistance levels/zones for shorter-term trends by reducing the Multiplicative Factor setting.
🔹 Extension
Users can extend past estimated support/resistance levels, the amount of extended levels is determined by the users. Certain levels can stay relevant in the future, and can also aid in measuring the significance of a breakout, with further past levels being reached being indicative of more significant trends.
🔶 DETAILS
To determine if the price is up-trending or down-trending in order to show either support or resistance, the same method used in the predictive ranges script is used. A central tendency is estimated, if price significantly deviates from it upward an uptrend is detected, else a significant deviation downward would indicate a downtrend.
The central tendency estimate is used for the construction of the support and resistance levels.
🔶 SETTINGS
Multiplicative Factor: Determines the frequency at which new supports/resistances are returned, with lower values returning more frequent levels/zones.
ATR Length: ATR averaging length used as deviation threshold for the central tendency estimate.
Extend Last: Determines the amount of most recent historical supports/resistances to extend to the latest bar.
Multi-Timeframe Trend Detector [Alifer]Here is an easy-to-use and customizable multi-timeframe visual trend indicator.
The indicator combines Exponential Moving Averages (EMA), Moving Average Convergence Divergence (MACD), and Relative Strength Index (RSI) to determine the trend direction on various timeframes: 15 minutes (15M), 30 minutes (30M), 1 hour (1H), 4 hours (4H), 1 day (1D), and 1 week (1W).
EMA Trend : The script calculates two EMAs for each timeframe: a fast EMA and a slow EMA. If the fast EMA is greater than the slow EMA, the trend is considered Bullish; if the fast EMA is less than the slow EMA, the trend is considered Bearish.
MACD Trend : The script calculates the MACD line and the signal line for each timeframe. If the MACD line is above the signal line, the trend is considered Bullish; if the MACD line is below the signal line, the trend is considered Bearish.
RSI Trend : The script calculates the RSI for each timeframe. If the RSI value is above a specified Bullish level, the trend is considered Bullish; if the RSI value is below a specified Bearish level, the trend is considered Bearish. If the RSI value is between the Bullish and Bearish levels, the trend is Neutral, and no arrow is displayed.
Dashboard Display :
The indicator prints arrows on the dashboard to represent Bullish (▲ Green) or Bearish (▼ Red) trends for each timeframe.
You can easily adapt the Dashboard colors (Inputs > Theme) for visibility depending on whether you're using a Light or Dark theme for TradingView.
Usage :
You can adjust the indicator's settings such as theme (Dark or Light), EMA periods, MACD parameters, RSI period, and Bullish/Bearish levels to adapt it to your specific trading strategies and preferences.
Disclaimer :
This indicator is designed to quickly help you identify the trend direction on multiple timeframes and potentially make more informed trading decisions.
You should consider it as an extra tool to complement your strategy, but you should not solely rely on it for making trading decisions.
Always perform your own analysis and risk management before executing trades.
The indicator will only show a Dashboard. The EMAs, RSI and MACD you see on the chart image have been added just to demonstrate how the script works.
DETAILED SCRIPT EXPLANATION
INPUTS:
theme : Allows selecting the color theme (options: "Dark" or "Light").
emaFastPeriod : The period for the fast EMA.
emaSlowPeriod : The period for the slow EMA.
macdFastLength : The fast length for MACD calculation.
macdSlowLength : The slow length for MACD calculation.
macdSignalLength : The signal length for MACD calculation.
rsiPeriod : The period for RSI calculation.
rsiBullishLevel : The level used to determine Bullish RSI condition, when RSI is above this value. It should always be higher than rsiBearishLevel.
rsiBearishLevel : The level used to determine Bearish RSI condition, when RSI is below this value. It should always be lower than rsiBullishLevel.
CALCULATIONS:
The script calculates EMAs on multiple timeframes (15-minute, 30-minute, 1-hour, 4-hour, daily, and weekly) using the request.security() function.
Similarly, the script calculates MACD values ( macdLine , signalLine ) on the same multiple timeframes using the request.security() function along with the ta.macd() function.
RSI values are also calculated for each timeframe using the request.security() function along with the ta.rsi() function.
The script then determines the EMA trends for each timeframe by comparing the fast and slow EMAs using simple boolean expressions.
Similarly, it determines the MACD trends for each timeframe by comparing the MACD line with the signal line.
Lastly, it determines the RSI trends for each timeframe by comparing the RSI values with the Bullish and Bearish RSI levels.
PLOTTING AND DASHBOARD:
Color codes are defined based on the EMA, MACD, and RSI trends for each timeframe. Green for Bullish, Red for Bearish.
A dashboard is created using the table.new() function, displaying the trend information for each timeframe with arrows representing Bullish or Bearish conditions.
The dashboard will appear in the top-right corner of the chart, showing the Bullish and Bearish trends for each timeframe (15M, 30M, 1H, 4H, 1D, and 1W) based on EMA, MACD, and RSI analysis. Green arrows represent Bullish trends, red arrows represent Bearish trends, and no arrows indicate Neutral conditions.
INFO ON USED INDICATORS:
1 — EXPONENTIAL MOVING AVERAGE (EMA)
The Exponential Moving Average (EMA) is a type of moving average (MA) that places a greater weight and significance on the most recent data points.
The EMA is calculated by taking the average of the true range over a specified period. The true range is the greatest of the following:
The difference between the current high and the current low.
The difference between the previous close and the current high.
The difference between the previous close and the current low.
The EMA can be used by traders to produce buy and sell signals based on crossovers and divergences from the historical average. Traders often use several different EMA lengths, such as 10-day, 50-day, and 200-day moving averages.
The formula for calculating EMA is as follows:
Compute the Simple Moving Average (SMA).
Calculate the multiplier for weighting the EMA.
Calculate the current EMA using the following formula:
EMA = Closing price x multiplier + EMA (previous day) x (1-multiplier)
2 — MOVING AVERAGE CONVERGENCE DIVERGENCE (MACD)
The Moving Average Convergence Divergence (MACD) is a popular trend-following momentum indicator used in technical analysis. It helps traders identify changes in the strength, direction, momentum, and duration of a trend in a financial instrument's price.
The MACD is calculated by subtracting a longer-term Exponential Moving Average (EMA) from a shorter-term EMA. The most commonly used time periods for the MACD are 26 periods for the longer EMA and 12 periods for the shorter EMA. The difference between the two EMAs creates the main MACD line.
Additionally, a Signal Line (usually a 9-period EMA) is computed, representing a smoothed version of the MACD line. Traders watch for crossovers between the MACD line and the Signal Line, which can generate buy and sell signals. When the MACD line crosses above the Signal Line, it generates a bullish signal, indicating a potential uptrend. Conversely, when the MACD line crosses below the Signal Line, it generates a bearish signal, indicating a potential downtrend.
In addition to the MACD line and Signal Line crossovers, traders often look for divergences between the MACD and the price chart. Divergence occurs when the MACD is moving in the opposite direction of the price, which can suggest a potential trend reversal.
3 — RELATIVE STRENGHT INDEX (RSI):
The Relative Strength Index (RSI) is another popular momentum oscillator used by traders to assess the overbought or oversold conditions of a financial instrument. The RSI ranges from 0 to 100 and measures the speed and change of price movements.
The RSI is calculated based on the average gain and average loss over a specified period, commonly 14 periods. The formula involves several steps:
Calculate the average gain over the specified period.
Calculate the average loss over the specified period.
Calculate the relative strength (RS) by dividing the average gain by the average loss.
Calculate the RSI using the following formula: RSI = 100 - (100 / (1 + RS))
The RSI oscillates between 0 and 100, where readings above 70 are considered overbought, suggesting that the price may have risen too far and could be due for a correction. Readings below 30 are considered oversold, suggesting that the price may have dropped too much and could be due for a rebound.
Traders often use the RSI to identify potential trend reversals. For example, when the RSI crosses above 30 from below, it may indicate the start of an uptrend, and when it crosses below 70 from above, it may indicate the start of a downtrend. Additionally, traders may look for bullish or bearish divergences between the RSI and the price chart, similar to the MACD analysis, to spot potential trend changes.
Higher Time Frame {HTF} Candles [QuantVue]Introducing the Higher Time Frame {HTF} Candles from QuantVue!
This script was developed to help you visually emphasize higher time frame (HTF) candles.
Higher time frames reduce the 'noise' inherent in lower time frames, providing a clearer, more accurate picture of the market's movements.
By examining higher time frames, you can better identify trends, reversals, and key areas of support and resistance.
The Higher Time Frame Candles indicator overlays higher time frame data directly onto your current chart.
You can easily specify the higher time frame candles you'd like to view, and the indicator will overlay the higher time frame candles directly over the corresponding current time frame bars.
This indicator by default will display the most current higher time frame candle plus the previous 5 candles.
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers.
HyperTrend [LuxAlgo]The HyperTrend indicator aims to provide a real-time estimate of an underlying linear trend in the price. Support and resistance extremities are constructed from this estimate which can provide trade opportunities within the overall trend.
Most tools that return lines on a chart are either subject to backpainting or repainting. We aimed to provide a reliable real-time method to estimate linear trends in the price, enhancing traders' decision making processes when it comes to trading trends in price, hence the term 'HyperTrend'.
🔶 USAGE
Users can use the HyperTrend to easily determine the trend direction in the price, with an average sloping upward indicating an uptrend, and an average sloping downward indicating a downtrend.
The channels upper extremity can act as a resistance, while the lower extremity can act as a support. Contact with candle wicks can signal timely reversals/retracements.
Using a higher "Multiplicative Factor" value will return less frequent new channels, and is suitable to analyze longer-term trends. The slope settings on the other end allow us to control the slope of the returned channels, with higher values returning flatter results (similar to our previously posted predictive ranges).
🔹 Channel Average
The channel average can return an estimate of the current (and future) trend in the price, the chart below shows an interval where a linear regression is displayed alongside the channel average:
Unlike the linear regression, the average does not have any lookahead bias, this of course comes at the price of accuracy in most cases.
Users can also use this average as a support or resistance. The breakout of a TC average that has been tested multiple times can be considered more significant in suggesting a trend reversal.
🔶 SETTINGS
Multiplicative Factor: Control the allowed degree of deviation of the price from the average line. Higher values will return less frequent new channels.
Slope: Controls the steepness of the returned lines. Higher values will return flatter results.
Width %: Width percentage of the channel. Lower results will return narrower channels.
RibboNN Machine Learning [ChartPrime]The RibboNN ML indicator is a powerful tool designed to predict the direction of the market and display it through a ribbon-like visual representation, with colors changing based on the prediction outcome from a conditional class. The primary focus of this indicator is to assist traders in trend following trading strategies.
The RibboNN ML in action
Prediction Process:
Conditional Class: The indicator's predictive model relies on a conditional class, which combines information from both longcon (long condition) and short condition. These conditions are determined using specific rules and criteria, taking into account various market factors and indicators.
Direction Prediction: The conditional class provides the basis for predicting the direction of the market move. When the prediction value is greater than 0, it indicates an upward trend, while a value less than 0 suggests a downward trend.
Nearest Neighbor (NN): To attempt to enhance the accuracy of predictions, the RibboNN ML indicator incorporates a Nearest Neighbor algorithm. This algorithm analyzes historical data from the Ribbon ML's predictive model (RMF) and identifies patterns that closely resemble the current conditional prediction class, thereby offering more robust trend forecasts.
Ribbon Visualization:
The Ribbon ML indicator visually represents its predictions through a ribbon-like display. The ribbon changes colors based on the direction predicted by the conditional class. An upward trend is represented by a green color, while a downward trend is depicted by a red color, allowing traders to quickly identify potential market directions.
The introduction of the Nearest Neighbor algorithm provides the Ribbon ML indicator with unique and adaptive behaviors. By dynamically analyzing historical patterns and incorporating them into predictions, the indicator can adapt to changing market conditions and offer more reliable signals for trend following trading strategies.
Manipulation of the NN Settings:
Smaller Value of Neighbours Count:
When the value of "Neighbours Count" is small, the algorithm considers only a few nearest neighbors for making predictions.
A smaller value of "Neighbours Count" leads to more flexible decision boundaries, which can result in a more granular and sensitive model.
However, using a very small value might lead to overfitting, especially if the training data contains noise or outliers.
Larger Value of "Neighbours Count":
When the value of "Neighbours Count" is large, the algorithm considers a larger number of nearest neighbors for making predictions.
A larger value of "Neighbours Count" leads to smoother decision boundaries and helps capture the global patterns in the data.
However, setting a very large value might result in a loss of local patterns and make the model less sensitive to changes in the data.
RAINBOW AVERAGES - INDICATOR - (AS) - 1/3
-INTRODUCTION:
This is the first of three scripts I intend to publish using rainbow indicators. This script serves as a groundwork for the other two. It is a RAINBOW MOVING AVERAGES indicator primarily designed for trend detection. The upcoming script will also be an indicator but with overlay=false (below the chart, not on it) and will utilize RAINBOW BANDS and RAINBOW OSCILLATOR. The third script will be a strategy combining all of them.
RAINBOW moving averages can be used in various ways, but this script is mainly intended for trend analysis. It is meant to be used with overlay=true, but if the user wishes, it can be viewed below the chart. To achieve this, you need to change the code from overlay=true to false and turn off the first switch that plots the rainbow on the chart (or simply move the indicator to a new pane below). By doing this, you will be able to see how all four conditions used to detect trends work on the chart. But let's not get ahead of ourselves.
-WHAT IS IT:
In its simplest form, this indicator uses 10 moving averages colored like a rainbow. The calculation is as follows:
MA0: This is the main moving average and can be defined with the type (SMA, EMA, RMA, WMA, SINE), length, and price source. However, the second moving average (MA1) is calculated using MA0 as its source, MA2 uses MA1 as the data source, and so on, until the last one, MA9. Hence, there are 10 moving averages. The first moving average is special as all the others derive from it. This indicator has many potential uses, such as entry/exit signals, volatility indication, and stop-loss placement, but for now, we will focus on trend detection.
-TREND DETECTION:
The indicator offers four different background color options based on the user's preference:
0-NONE: No background color is applied as no trend detection tools is being used (boring)
1-CHANGE: The background color is determined by summing the changes of all 10 moving averages (from two bars). If the sum is positive and not falling, the background color is GREEN. If the sum is negative and not rising, the background color is RED. From early testing, it works well for the beginning of a movement but not so much for a lasting trend.
2-RAINBW: The background color is green when all the moving averages are in ascending order, indicating a bullish trend. It is red when all the moving averages are in descending order, indicating a bearish trend. For example, if MA1>MA2>MA3>MA4..., the background color is green. If MA1 threshold, and red indicates width < -threshold.
4-DIRECT: The background color is determined by counting the number of moving averages that are either above or below the input source. If the specified number of moving averages is above the source, the background color is green. If the specified number of moving averages is below the source, the background color is red. If all ten MAs are below the price source, the indicator will show 10, and if all ten MAs are above, it will show -10. The specific value will be set later in the settings (same for 3-TSHOLD variant). This method works well for lasting trends.
Note: If the indicator is turned into a below-chart version, all four color options can be seen as separate indicators.
-PARAMETERS - SETTINGS:
The first line is an on/off switch to plot the skittles indicator (and some info in the tooltip). The second line has already been discussed, which is the background color and the selection of the source (only used for MA0!).
The line "MA1: TYP/LEN" is where we define the parameters of MA0 (important). We choose from the types of moving averages (SMA, EMA, RMA, WMA, SINE) and set the length.
Important Note: It says MA1, but it should be MA0!.
The next line defines whether we want to smooth MA1 (which is actually MA0) and the period for smoothing. When smoothing is turned on, MA0 will be smoothed using a 3-pole super smoother. It's worth noting that although this only applies to MA0, as the other MAs are derived from it, they will also be smoothed.
In the line below, we define the type and length of MAs for MA2 (and other MAs except MA0). The same type and length are used for MA1 to MA9. It's important to remember that these values should be smaller. For example, if we set 55, it means that MA1 is the average of 55 periods of MA0, MA2 will be 55 periods of MA1, and so on. I encourage trying different combinations of MA types as it can be easily adjusted for ur type of trading. RMA looks quirky.
Moving on to the last line, we define some inputs for the background color:
TSH: The threshold value when using 3-TSHOLD-BGC. It's a good idea to change the chart to a pane below for easier adjustment. The default values are based on EURUSD-5M.
BG_DIR: The value that must be crossed or equal to the MA score if using 4-DIRECT-BGC. There are 10 MAs, so the maximum value is also 10. For example, if you set it to 9, it means that at least 9 MAs must be below/above the price for the script to detect a trend. Higher values are recommended as most of the time, this indicator oscillates either around the maximum or minimum value.
-SUMMARY OF SETTINGS:
L1 - PLOT MAs and general info tooltip
L2 - Select the source for MA0 and type of trend detection.
L3 - Set the type and length of MA0 (important).
L4 - Turn smoothing on/off for MA0 and set the period for super smoothing.
L5 - Set the type and length for the rest of the MAs.
L6 - Set values if using 4-DIRECT or 3-TSHOLD for the trend detection.
-OTHERS:
To see trend indicators, you need to turn off the plotting of MAs (first line), and then choose the variant you want for the background color. This will plot it on the chart below.
Keep in mind that M1 int settings stands for MA0 and MA2 for all of the 9 MAs left.
Yes, it may seem more complicated than it actually is. In a nutshell, these are 10 MAs, and each one after MA0 uses the previous one as its source. Plus few conditions for range detection. rest is mainly plots and colors.
There are tooltips to help you with the parameters.
I hope this will be useful to someone. If you have any ideas, feedback, or spot errors in the code, LET ME KNOW.
Stay tuned for the remaining two scripts using skittles indicators and check out my other scripts.
-ALSO:
I'm always looking for ideas for interesting indicators and strategies that I could code, so if you don't know Pinescript, just message me, and I would be glad to write your own indicator/strategy for free, obviously.
-----May the force of the market be with you, and until we meet again,
RSI Momentum Trend ScreenerIntroducing The RSI Momentum Trend Screener, to have the ability to scan 40 symbols at once
The screener is based on RSI Momentum Trend Indicator
It will show Positive Or Negative based on the symbol condition.
You can change the values on the screener, symbols, activate/disable symbols and change table position and color
Multi Kernel Regression [ChartPrime]The "Multi Kernel Regression" is a versatile trading indicator that provides graphical interpretations of market trends by using different kernel regression methods. It's beneficial because it smoothes out price data, creating a clearer picture of price movements, and can be tailored according to the user's preference with various options.
What makes this indicator uniquely versatile is the 'Kernel Select' feature, which allows you to choose from a variety of regression kernel types, such as Gaussian, Logistic, Cosine, and many more. In fact, you have 17 options in total, making this an adaptable tool for diverse market contexts.
The bandwidth input parameter directly affects the smoothness of the regression line. While a lower value will make the line more sensitive to price changes by sticking closely to the actual prices, a higher value will smooth out the line even further by placing more emphasis on distant prices.
It's worth noting that the indicator's 'Repaint' function, which re-estimates work according to the most recent data, is not a deficiency or a flaw. Instead, it’s a crucial part of its functionality, updating the regression line with the most recent data, ensuring the indicator measurements remain as accurate as possible. We have however included a non-repaint feature that provides fixed calculations, creating a steady line that does not change once it has been plotted, for a different perspective on market trends.
This indicator also allows you to customize the line color, style, and width, allowing you to seamlessly integrate it into your existing chart setup. With labels indicating potential market turn points, you can stay on top of significant price movements.
Repaint : Enabling this allows the estimator to repaint to maintain accuracy as new data comes in.
Kernel Select : This option allows you to select from an array of kernel types such as Triangular, Gaussian, Logistic, etc. Each kernel has a unique weight function which influences how the regression line is calculated.
Bandwidth : This input, a scalar value, controls the regression line's sensitivity towards the price changes. A lower value makes the regression line more sensitive (closer to price) and higher value makes it smoother.
Source : Here you denote which price the indicator should consider for calculation. Traditionally, this is set as the close price.
Deviation : Adjust this to change the distance of the channel from the regression line. Higher values widen the channel, lower values make it smaller.
Line Style : This provides options to adjust the visual style of the regression lines. Options include Solid, Dotted, and Dashed.
Labels : Enabling this introduces markers at points where the market direction switches. Adjust the label size to suit your preference.
Colors : Customize color schemes for bullish and bearish trends along with the text color to match your chart setup.
Kernel regression, the technique behind the Multi Kernel Regression Indicator, has a rich history rooted in the world of statistical analysis and machine learning.
The origins of kernel regression are linked to the work of Emanuel Parzen in the 1960s. He was a pioneer in the development of nonparametric statistics, a domain where kernel regression plays a critical role. Although originally developed for the field of probability, these methods quickly found application in various other scientific disciplines, notably in econometrics and finance.
Kernel regression became really popular in the 1980s and 1990s along with the rise of other nonparametric techniques, like local regression and spline smoothing. It was during this time that kernel regression methods were extensively studied and widely applied in the fields of machine learning and data science.
What makes the kernel regression ideal for various statistical tasks, including financial market analysis, is its flexibility. Unlike linear regression, which assumes a specific functional form for the relationship between the independent and dependent variables, kernel regression makes no such assumptions. It creates a smooth curve fit to the data, which makes it extremely useful in capturing complex relationships in data.
In the context of stock market analysis, kernel regression techniques came into use in the late 20th century as computational power improved and these techniques could be more easily applied. Since then, they have played a fundamental role in financial market modeling, market prediction, and the development of trading indicators, like the Multi Kernel Regression Indicator.
Today, the use of kernel regression has solidified its place in the world of trading and market analysis, being widely recognized as one of the most effective methods for capturing and visualizing market trends.
The Multi Kernel Regression Indicator is built upon kernel regression, a versatile statistical method pioneered by Emanuel Parzen in the 1960s and subsequently refined for financial market analysis. It provides a robust and flexible approach to capturing complex market data relationships.
This indicator is more than just a charting tool; it reflects the power of computational trading methods, combining statistical robustness with visual versatility. It's an invaluable asset for traders, capturing and interpreting complex market trends while integrating seamlessly into diverse trading scenarios.
In summary, the Multi Kernel Regression Indicator stands as a testament to kernel regression's historic legacy, modern computational power, and contemporary trading insight.
RSI Divergence Screener by zdmreThis screener tracks the following for up to 20 assets:
-All selected tickers will be screened in same timeframes (as in the chart).
-Values in table indicate that how many days passed after the last Bullish or Bearish of RSI Divergence.
For example, when BTCUSDT appears Bullish-Days Ago (15) , Bitcoin has switched to a Bullish Divergence signal 15 days ago.
Thanks to @QuantNomad and @MUQWISHI for building the base for this screener.
*Use it at your own risk
Note:
Screener shows the information about the RSI Divergence Scanner by zdmre with default settings.
Based indicator:
Moving Average-TREND POWER v2.0-(AS)HELLO:
-This indicator is a waaaay simpler version of my other script - Moving Average-TREND POWER v1.1-(AS).
HOW DOES IT WORK:
-Script counts number of bars below or above selected Moving Average (u can se them by turning PLOT BARS on). Then multiplies number of bars by 0.01 and adds previous value. So in the uptrend indicator will be growing faster with every bar when price is above MA. When MA crosess price Value goes to zero so it shows when the market is ranging.
If Cross happens when number of bars is higher than Upper threshold or below Lower threshold indicator will go back to zero only if MA crosses with high in UPtrend and low in DNtrend. If cross happens inside THSs Value will be zero when MA crosses with any type of price source like for example (close,high,low,ohlc4,hl etc.....).This helps to get more crosess in side trend and less resets during a visible trend
HOW TO SET:
Just select what type of MA you want to use and Length. Then based on your preference set values of THSs'
OTHER INFORMATIONS:
-Script was created and tested on EURUSD 5M.
-For bigger trends choose slowerMAs and bigger periods and the other way around for short trends (FasterMAs/shorter periods)
-Below script code you can find not used formulas for calculating indicator value(thanks chat GPT), If you know some pinescript I encourage you to try try them or maybe bulid better ones. Script uses most basic one.
-Pls give me some feedback/ideas to improve and check out first version. Its way more complicated for no real reason but still worth to take a look'
-Also let me know if you find some logical errors in the code.
Enjoy and till we meet again.
VWAP angle TrendThe VWAP Angle Trend is an indicator built with the aim of providing valuable insights into the reversal points of the #VWAP using Angle
This is achieved by calculating the angle between the current VWAP and its previous value over a customizable lookback period and normalizing it with ATR
By analyzing the angle, we can gain an understanding of the strength and direction of the VWAP, which can help them identify potential trend reversals or continuations.
After observing the market over a lengthy period, I have come to realize that as the angle increases above 65 or decreases under -65 , it confirms a higher likelihood of a trend reversal.
the indicator highlights these zones where a trend reversal is more likely to occur.
The indicator can help you to assess the strength and direction of VWAP, enabling you to make more informed trading decisions.
By identifying periods of strong momentum or potential exhaustion, you can seek opportunities for entering or exiting positions, and potentially capitalize on trend movements in the market.
QFL Screener [ ZCrypto ]The QFL Screener is a robust tool inspired by Quickfingersluc's trading strategy.
Known as the Base Strategy or Mean Reversals, QFL focuses on identifying moments of panic selling and buying , presenting opportunities to enter trades at deeply discounted prices.
The QFL Screener is designed to enhance your trading efficiency by simultaneously scanning 40 symbols.
You have the flexibility to enable or disable specific symbols from the screening process, allowing you to tailor the screener to your preferred markets and instruments.
The Screener has a built-in alerts system . As soon as the QFL conditions align for any of the scanned symbols, you'll receive instant notifications, empowering you to take prompt action and seize potential trading opportunities.
In addition, I've incorporated a visual element to complement the alerts. Once the conditions are true, a green arrow shape will appear directly on the chart, providing a clear and intuitive signal of the QFL opportunity.
To provide a clear overview, our screener presents a comprehensive table that highlights when the QFL condition becomes true for each symbol. This table acts as a visual guide, enabling you to monitor the status of multiple symbols at a glance, streamlining your trading decision-making process.
With the QFL Screener, you gain an edge in identifying profitable trade setups based on Quickfingersluc's renowned approach. Experience the convenience of simultaneous screening, real-time alerts, and an intuitive table display, all in one user-friendly tool.