Multi Timeframe Trend StrengthThis code is an advancement of my previous percentile-based trend strength. It follows the same concept, except this code display the trend and trend strength in multiple timeframe (1 min, 5 min, 15 min, 1hr and 4hr).
This gives an indication of the trend is evolving and allows to see how short-term trend matches with the long-term trend.
How it works:
The script assesses trend strength through percentile values derived from high and low prices across various time periods. It categorizes the current trend as either Bullish, Bearish, or N/A (No Trend) with the following steps:
Percentile Calculations: The code calculates the 75th percentile of high prices (e.g., percentile_13H) and the 25th percentile of low prices (e.g., percentile_13L) for specified Fibonacci-based periods (13, 21, 34, 55, 89, and 144). These percentiles serve as thresholds for identifying strong trends.
Calculate Highest High and Lowest Low: It computes the highest high (75th percentile high price of the longest period) and lowest low (25th percentile low price of the longest period), referred to as highest_high and lowest_low. These values establish critical price levels.
Trend Strength Conditions: For each percentile and period, the code checks if the percentile exceeds the highest high (trendBull) or falls below the lowest low (trendBear). These conditions gauge the strength of bullish and bearish trends.
Count Bull and Count Bear: Variables countBull and countBear tally the number of bullish and bearish conditions met, helping assess trend strength.
Weak Bull and Weak Bear Count: The code calculates weak bullish and bearish conditions, occurring when percentiles fall within the range defined by highest_high and lowest_low but don't meet strong trend criteria.
Bull Strength and Bear Strength: bullStrength and bearStrength are calculated based on counts of bullish, bearish, weak bullish, and weak bearish conditions, representing overall trend strength.
Strong Bull and Bear Conditions: These conditions arise when the 75th percentile of high prices (bull conditions) or the 25th percentile of low prices (bear conditions) surpass or dip below the highest high or lowest low, respectively, for the specified period. Strong conditions indicate robust trends with significant price movements.
Weak Bull and Bear Conditions: Weak conditions occur when percentiles fall within the range between highest_high and lowest_low, suggesting some bullish or bearish tendencies without reaching extreme levels. These imply less decisive trends.
Current Trend Identification: The current trend is determined by comparing bullStrength and bearStrength. A greater bullStrength indicates a Bull trend, greater bearStrength implies a Bear trend, and equal values denote No Trend (N/A).
Multitimeframe
Ehlers SuperSmootherJohn F. Ehlers has provided the SuperSmoother filter in several of his works, including his book "Cyclical Analytics for Traders", Chapter 3.
The SuperSmoother filter is utilized whenever one might typically apply a moving average of any kind. The outcome is that the output signal from the SuperSmoother filter displays significantly less lag compared to an equivalent amount of smoothing from a moving average. The lag difference between a moving average and the SuperSmoother filter becomes even more pronounced when critical periods are extended.
Market data contains noise, and the purpose of smoothing filters is to mitigate this noise. In fact, there are various types of noise inherent in market data. One type of noise is systemic, originating from random trading activities. Another type is aliasing noise, which arises due to the use of discrete data. Aliasing noise dominates the data when considering shorter cycle durations.
It's tempting to perceive market data as a continuous wave, but that's a misconception. Taking the closing price as representative of a bar provides just a single data point. Whether you opt for the midpoint between the high and low instead of the closing price, you're still limited to one sample per bar. Given the discrete nature of this data, certain spectral implications must be considered. For instance, the shortest feasible analysis period (without aliasing) is a two-bar cycle. This is referred to as the Nyquist frequency, at 0.5 cycles per sample.
An ideally sampled two-beat sinusoidal cycle becomes rectified when discretized. However, peak sampling for the cycle isn't always guaranteed, and interference between the sampling rate and the data frequency results in aliasing noise. This noise decreases as the data period lengthens. For example, a four-beat cycle implies four samples per cycle. With more samples, the sampled data provides a better representation of the sinusoidal component. The replica becomes even more accurate for an eight-bar data component. The increased precision of discrete data signifies that aliasing noise decreases as cycle durations expand.
A smoothing filter should possess the selectivity to reduce the aliasing noise below systemic noise levels. Given that aliasing noise increases by 6 dB per octave above the filter's selected cutoff frequency and the SuperSmoother's attenuation rate is 12 dB per octave, the SuperSmoother filter emerges as an effective tool to virtually eliminate aliasing noise in its output signal.
There are already several SuperSmoother indicators on Tradingview, but I like to structure the code and highlight the main components as functions rather than hiding them in the code. I hope this is useful for those who are starting to learn Pine Script.
Extended Hour CandleThe Extended Hour Candle shows extended hour candle formations on the Daily chart. This indicator can be useful for those who want to analyse price movements during extended trading sessions without switching to intraday charts with "Extended trading hours" enabled.
How to Use:
Add the Extended Hour Candle indicator to a TradingView chart.
Adjust the color settings according to personal preferences, using the options to set the desired colors for up and down candles.
See the Candle during extended trading hours on the Daily chart
The Opening Range / First Bar By Market Mindset - Zero To EndlesThe script shows the opening range of the instrument based on different resolutions and timeframes.
Inputs :
1. Resolution
It decides the calculation frequency of the script.
In Auto resolution, Standard values have been used.
2. Timeframe
It decides the timeframe for the OHLC values.
By default, it will use the chart timeframe and so chart OHLC values.
3. Lookback
It decides the no. of ranges shown on the chart.
Middle Line can be hidden from the settings.
The script can be used for any instrument and on any timeframe.
If price is above the opening range or the middle line, a trader should look for long opportunities.
If price is below the opening range or the middle line, a trader should look for short opportunities.
A sideways or choppy move is exoected if Middle line is crossed again and again.
For trading, wait for atleast 1st bar to close. and let the opening range build up first.
Happy Trading
Bunch of WillyThe indicator allows you to track overbought/oversold conditions using the Williams indicator on several higher timeframes of the same ticker on one chart. Based on the relative position of the lines of different timeframes and their position relative to the exponential moving average, you can track the occurrence of situations of simultaneous overbought/oversold of several timeframes, which is a cleaner reversal signal than overbought/oversold on just one chart timeframe. So far the script itself does not indicate these points, but perhaps in one of the next updates I will fix this.
In addition, the exponential moving average can be used to determine the direction of the trend.
Индикатор позволяет на одном графике отслеживать перекупленность/перепроданость по индикатору Вильямса на нескольких более высоких таймфреймах того же тикера. Основываясь на взаимном положении линий разных таймфреймов и их положении относительно экспоненциальной скользящей средней можно отслеживать возникновение ситуаций одновременной перекупленности/перепроданности нескольких таймфреймов что является более чистым разворотным сигналом чем перекупленность/перепроданность на одном лишь таймфрейме графика. Пока скрипт сам не обозначает эти моменты, но возможно в одном из следующих обновлений я это исправлю.
Кроме того по экспоненциальной скользящей средней можно определять направление тренда.
HTF Candle Insights (Expo)█ Overview
The HTF Candle Insights indicator helps traders see what's happening in larger time frames (HTF) while they're looking at smaller ones. This tool lets traders get a complete picture of market trends and price movements, helping them make smarter trading choices. It's really useful for traders who want to understand the main market trends without constantly switching between different chart timeframes.
In simpler terms , this indicator brings the big picture into the smaller frame, so traders don't miss out on what's important while focusing on the details.
█ How It Works
The indicator plots HTF candles on the existing chart, allowing users to view them concurrently with the candles of the current timeframe. This dual visual representation helps in discerning the prevalent market trends and significant price levels from both the current and higher timeframes.
█ How to Use
Trend Analysis
Traders can leverage this indicator to analyze overall market trends by observing HTF candles alongside the current timeframe candles. Recognizing HTF trends aids in aligning trades with the dominant market movement, potentially increasing the probability of successful trades.
Support and Resistance Identification
By viewing the high, low, and mid-levels of HTF candles, traders can identify potential support and resistance zones, enabling them to establish strategic entry and exit points, place stop-losses effectively, and manage risk proficiently.
█ Settings
Timeframe and Candle Amount:
Users can specify the higher timeframe and the number of HTF candles they wish to visualize on their current chart.
Visual Adjustments:
Traders can customize the color schemes for upward and downward candles and their wicks, and adjust the visibility and colors of the range lines, allowing for a tailored visual experience.
Range Lines:
Users have the option to display the high/low range of the displayed candles, and, if preferred, the mid-range line, enabling them to gain insights into significant price levels and ranges.
Table Display:
The indicator offers the ability to display a table, which provides an overview of the current chart's timeframe and the specified HTF.
-----------------
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!
TMA MTFThis indicator plots three different Triple Moving Averages (TMAs) for two different time frames on a price chart:
Middle TMA Line: This is the main TMA line, calculated based on a user-defined number of past bars. It's represented by a solid line on the chart.
Upper TMA Line: This line is calculated by adding a certain multiple of the Average True Range (ATR) to the main TMA line. It helps identify potential resistance levels and is plotted as a solid line.
Lower TMA Line: Similar to the upper line, this line is calculated by subtracting a multiple of the ATR from the main TMA line. It helps identify potential support levels and is also plotted as a solid line.
Additionally, you have the option to overlay these TMA lines on a higher timeframe (HTF) if desired. When you enable this feature, it plots the same three TMA lines but calculated using data from a higher timeframe, which can provide additional context for your trading decisions.
The indicator uses different colors for the TMA lines based on their relationships:
Green: The middle TMA line is above the higher timeframe middle TMA line, suggesting a potential bullish (upward) trend.
Red: The middle TMA line is below the higher timeframe middle TMA line, suggesting a potential bearish (downward) trend.
In addition, it plots the upper and lower TMA lines in shades of purple and maroon, respectively, on the higher timeframe for reference.
Overall, this indicator helps traders identify potential areas of support and resistance and assess the trend direction by comparing the TMA lines of different timeframes.
Variable:
TMA_Period:
This input variable allows you to specify the number of past bars that are used to calculate the main Triple Moving Average (TMA) line. A larger value will result in a smoother TMA line, while a smaller value will make it more responsive to recent price changes.
ATR_Period:
This input variable determines the number of past bars used to calculate the Average True Range (ATR). The ATR is a measure of price volatility. A longer ATR period considers a broader range of price movement, while a shorter period reacts more quickly to recent volatility.
ATR_Multiplier:
This input allows you to set a multiplier for the ATR on the current timeframe. The ATR value is multiplied by this factor to calculate the upper and lower TMA lines. A higher multiplier will result in wider TMA bands, while a lower multiplier will make them narrower.
ATR_Multiplier_HTF:
Similar to ATR_Multiplier, this input sets a multiplier for the ATR on a higher timeframe (HTF). It affects the width of the HTF TMA bands.
TF_1:
This input variable lets you choose the desired higher timeframe (HTF) for the indicator. You can select from various timeframes, including 1 minute, 5 minutes, 15 minutes, 30 minutes, 60 minutes, 240 minutes (4 hours), daily (D), weekly (W), monthly (M), or choose "Auto" to let the script automatically determine the HTF based on the current timeframe.
src:
This input allows you to choose the price source used for calculations. By default, it's set to 'close,' which means the closing prices of each bar are used. You can change this to other price sources like 'open,' 'high,' 'low,' or 'ohlc4' (a combination of open, high, low, and close prices).
ma_type:
This input lets you select the type of moving average used in the calculations. You have three options: Weighted Moving Average (WMA), Double Weighted Moving Average (DWMA), and Triple Weighted Moving Average (TWMA).
Plot_TMA_HTF_Midline:
If set to 'true,' it will plot the middle TMA line of the higher timeframe (HTF) on the chart. If set to 'false,' the HTF middle TMA line will not be displayed.
Daily TrendDescription:
The "Daily Trend" script is a powerful technical analysis tool designed for TradingView. This indicator helps traders identify key support and resistance levels based on daily price data. It offers a visual representation of these levels, along with other technical indicators like Exponential Moving Averages (EMA), Supertrend, and Parabolic SAR.
Features:
Past Candle Price Levels: This script calculates and displays past daily candle price levels, including R1, R2, R3, R4, S1, S2, S3, and S4. These levels are vital for identifying potential reversals and breakout points.
Exponential Moving Average (EMA): The script includes an EMA indicator with a customizable period to help traders spot the trend direction and potential crossovers.
Supertrend Indicator: The Supertrend indicator is used to identify trend changes. It plots the Supertrend line and highlights the trend direction with color-coded regions.
Parabolic SAR: The Parabolic SAR indicator is integrated into the script to assist traders in identifying potential entry and exit points in the market.
Customizable Alerts: Traders can customize the indicator by choosing which past candle price levels and other features to display on the chart.
How to Use:
Apply the "Daily Trend" script to your TradingView chart.
Customize the indicator by enabling or disabling specific features, such as past candle price levels and EMA.
Pay attention to the color-coded regions for Supertrend and Parabolic SAR to determine the current trend direction.
Look for potential reversal or bounce signals based on the indicator's signals and the price action.
Consider using this script in conjunction with your trading strategy for enhanced technical analysis.
Risk Warning: Trading involves significant risk, and past performance is not indicative of future results. Always practice proper risk management and consider the broader context of the market before making trading decisions.
Forex & Stock Daily WatchList And Screener [M]Hi, this is a watchlist and screener indicator for Forex and Stocks.
This indicator is designed for traders who trade in the forex markets and monitor developments in indices and other currency pairs.
It includes information on 14 indices such as the volatility index, Baltic dry index, etc. You can customize the indices as you wish. The indices table contains the index's price (or points), daily change, stochastic value, and trend direction.
The second table is designed for trading forex and stock currency pairs.
In this table, you will find information such as price, volume, change, stochastic, RSI, trend direction, and MACD result for all traded pairs. You can customize all the currency pairs in this table as you wish, and you can also tailor the oscillator settings to your preferences.
In the settings section, you can use checkboxes to hide the pairs in both tables.
The "Customize" section in the settings allows you to personalize the table appearances according to your preferences.
ICT HTF FVGs (fadi)ICT HTF FVGs displays the higher timeframe FVGs on current chart. This allows the trader to easily visualize the higher timeframe FVGs without having to mark them manually and see when price reaches point of interest for possible reversals or reaction.
This indicator attempts to provide as much flexibility possible by being able to define the following:
Higher Timeframe Settings
Timeframe to monitor
Bullish FVG color for this timeframe
Bearish FVG color for this timeframe
Maximum number of FVGs to display for this timeframe
Distance from current bar. This prevents overcrowding of FVGs
Hide Lower Timeframes from current chart. If this option is turned off, 5m timeframe FVGs will be displayed on an hourly chart as an example.
Show Border for the FVGs. Border color is derived from the FVG color
Show Mitigated FVG on the chart. The labels are removed to prevent the labels from overlapping with the candles on the chart/
Show C.E. Draws a line at the middle point of the FVG. This is usually an area of interest.
Show Label Shows the label with label color, background color, and label size.
Alxuse Stochastic RSI for tutorial All abilities of Stochastic RSI, moreover :
Drawing upper band and lower band & the ability to change values, change colors, turn on/off show.
Crossing K line and D line in multi timeframe & there are symbols (Circles) with green color (Buy) and red color (Sell) & the ability to change colors, turn on/off show.
Crossing K line and D line in multi timeframe according to the values of upper band and lower band & there are symbols (Triangles) with green color (Long) and red color (Short) & the ability to change colors, turn on/off show.
The ability used in the alert section and create customized alerts.
To receive valid alerts the replay section , the timeframe of the chart must be the same as the timeframe of the indicator.
Stochastic RSI (STOCH RSI)
Definition
The Stochastic RSI indicator (Stoch RSI) is essentially an indicator of an indicator. It is used in technical analysis to provide a stochastic calculation to the RSI indicator. This means that it is a measure of RSI relative to its own high/low range over a user defined period of time. The Stochastic RSI is an oscillator that calculates a value between 0 and 1 which is then plotted as a line. This indicator is primarily used for identifying overbought and oversold conditions.
The basics
It is important to remember that the Stoch RSI is an indicator of an indicator making it two steps away from price. RSI is one step away from price and therefore a stochastic calculation of the RSI is two steps away. This is important because as with any indicator that is multiple steps away from price, Stoch RSI can have brief disconnects from actual price movement. That being said, as a range bound indicator, the Stoch RSI's primary function is identifying crossovers as well as overbought and oversold conditions.
The basics
It is important to remember that the Stoch RSI is an indicator of an indicator making it two steps away from price. RSI is one step away from price and therefore a stochastic calculation of the RSI is two steps away. This is important because as with any indicator that is multiple steps away from price, Stoch RSI can have brief disconnects from actual price movement. That being said, as a range bound indicator, the Stoch RSI's primary function is identifying crossovers as well as overbought and oversold conditions.
Overbought/Oversold
Overbought and Oversold conditions are traditionally different than the RSI. While RSI overbought and oversold conditions are traditionally set at 70 for overbought and 30 for oversold, Stoch RSI are typically .80 and .20 respectively. When using the Stoch RSI, overbought and oversold work best when trading along with the underlying trend.
During an uptrend, look for oversold conditions for points of entry.
During a downtrend, look for overbought conditions for points of entry.
Summary
When using Stoch RSI in technical analysis, a trader should be careful. By adding the Stochastic calculation to RSI, speed is greatly increased. This can generate many more signals and therefore more bad signals as well as the good ones. Stoch RSI needs to be combined with additional tools or indicators in order to be at its most effective. Using trend lines or basic chart pattern analysis can help to identify major, underlying trends and increase the Stoch RSI's accuracy. Using Stoch RSI to make trades that go against the underlying trend is a dangerous proposition.
The added features to the indicator are made for training, it is advisable to use it with caution in tradings.
Alxuse MACD for tutorialAll abilities of MACD, moreover :
Drawing upper band and lower band & the ability to change values, change colors, turn on/off show.
Crossing MACD line and SIGNAL line in multi timeframe & there are symbols (Circles) with green color (Buy) and red color (Sell) & the ability to change colors, turn on/off show.
Crossing MACD line and SIGNAL line in multi timeframe according to the values of upper band and lower band & there are symbols (Triangles) with green color (Long) and red color (Short) & the ability to change colors, turn on/off show.
The ability used in the alert section and create customized alerts.
To receive valid alerts the replay section , the timeframe of the chart must be the same as the timeframe of the indicator.
MACD (Moving Average Convergence/Divergence)
Definition
MACD is an extremely popular indicator used in technical analysis. MACD can be used to identify aspects of a security's overall trend. Most notably these aspects are momentum, as well as trend direction and duration. What makes MACD so informative is that it is actually the combination of two different types of indicators. First, MACD employs two Moving Averages of varying lengths (which are lagging indicators) to identify trend direction and duration. Then, MACD takes the difference in values between those two Moving Averages (MACD Line) and an EMA of those Moving Averages (Signal Line) and plots that difference between the two lines as a histogram which oscillates above and below a center Zero Line. The histogram is used as a good indication of a security's momentum.
MACD Line is a result of taking a longer term EMA and subtracting it from a shorter term EMA.The most commonly used values are 26 days for the longer term EMA and 12 days for the shorter term EMA, but it is the trader's choice.
The Signal Line.
The Signal Line is an EMA of the MACD Line described in Component 1. The trader can choose what period length EMA to use for the Signal Line however 9 is the most common.
The MACD Histogram.
As time advances, the difference between the MACD Line and Signal Line will continually differ. The MACD histogram takes that difference and plots it into an easily readable histogram. The difference between the two lines oscillates around a Zero Line.
A general interpretation of MACD is that when MACD is positive and the histogram value is increasing, then upside momentum is increasing. When MACD is negative and the histogram value is decreasing, then downside momentum is increasing.
What to look for
The MACD indicator is typically good for identifying three types of basic signals; Signal Line Crossovers, Zero Line Crossovers, and Divergence.
SIGNAL LINE CROSSOVERS
A Signal Line Crossover is the most common signal produced by the MACD. First one must consider that the Signal Line is essentially an indicator of an indicator. The Signal Line is calculating the Moving Average of the MACD Line. Therefore the Signal Line lags behind the MACD line. That being said, on the occasions where the MACD Line crosses above or below the Signal Line, that can signify a potentially strong move.
The strength of the move is what determines the duration of Signal Line Crossover. Understanding and being able to analyze move strength, as well as being able to recognize false signals, is a skill that comes with experience.
The first type of Signal Line Crossover to examine is the Bullish Signal Line Crossover. Bullish Signal Line Crossovers occur when the MACD Line crosses above the Signal Line.
The second type of Signal Line Crossover to examine is the Bearish Signal Line Crossover. Bearish Signal Line Crossovers occur when the MACD Line crosses below the Signal Line.
Zero line crossovers
Zero Line Crossovers have a very similar premise to Signal Line Crossovers. Instead of crossing the Signal Line, Zero Line Crossovers occur when the MACD Line crossed the Zero Line and either becomes positive (above 0) or negative (below 0).
The first type of Zero Line Crossover to examine is the Bullish Zero Line Crossover. Bullish Zero Line Crossovers occur when the MACD Line crosses above the Zero Line and go from negative to positive.
The second type of Zero Line Crossover to examine is the Bearish Zero Line Crossover. Bearish Zero Line Crossovers occur when the MACD Line crosses below the Zero Line and go from positive to negative.
Divergence
Divergence is another signal created by the MACD. Simply put, divergence is when the MACD and actual price are not in agreement.
For example, Bullish Divergence occurs when price records a lower low, but the MACD records a higher low. The movement of price can provide evidence of the current trend, however changes in momentum as evidenced by the MACD can sometimes precede a significant reversal.
Bearish Divergence is, of course, the opposite. Bearish Divergence occurs when price records a higher high while the MACD records a lower high.
Summary
What makes the MACD such a valuable tool for technical analysis is that it is almost like two indicators in one. It can help to identify not just trends, but it can measure momentum as well. It takes two separate lagging indicators and adds the aspect of momentum which is much more active or predictive That kind of versatility is why it has been and is used by trader's and analysts across the entire spectrum of finance.
Despite MACD's obvious attributes, just like with any indicator, the trader or analyst needs to exercise caution. There are just some things that MACD doesn't do well which may tempt a trader regardless. Most notably, traders may be tempted into using MACD as a way to find overbought or oversold conditions. This is not a good idea. Remember, MACD is not bound to a range, so what is considered to be highly positive or negative for one instrument may not translate well to a different instrument.
With sufficient time and experience, almost anybody who wants to analyze chart data should be able to make good use out of the MACD.
The added features to the indicator are made for training, it is advisable to use it with caution in tradings.
Open and Close Time Vertical LinesMarks vertical lines for open and close times on any time frame. Go to settings to change the time frame, color, and width.
Risk Management and Positionsize - MACD exampleMastering Risk Management
Risk management is the cornerstone of successful trading, and it's often the difference between turning a profit and suffering a loss. In light of its importance, I share a risk management tool which you can use for your trading strategies. The script not only assists in position sizing but also comes with built-in technical features that help in market timing. Let's delve into the nitty-gritty details.
Input Parameter: MarginFactor
One of the key features of the script is the MarginFactor input parameter. This element lets you control the portion of your equity used for placing each trade. A MarginFactor of -0.5 means 50% of your total equity will be deployed in placing the position size. Although Tradingview has a built-in option to adjust position sizing in a same way, I personally prefer to have the logic in my pinecode script. The main reason is userexperience in managing and testing different settings for different charts, timeframes and instruments (with the same strategy).
Stoploss and MarginFactor
If your strategy has a 4% stop-loss, you can choose to use only 50% of your equity by setting the MarginFactor to -0.5. In this case, you are effectively risking only 2% of your total capital per trade, which aligns well with the widely-accepted rule of thumb suggesting a 1-2% risk per trade. Similar if your stoploss is only 1% you can choose to change the MarginFactor to 1, resulting in a positionsize of 200% of your equity. The total risk would be again 2% per trade if your stoploss is set to 1%.
Max Drawdown and MarginFactor
Your MarginFactor setting can also be aligned with the maximum drawdown of your strategy, seen during a backtested period of 2-3 years. For example, if the max drawdown is 15%, you could calibrate your MarginFactor accordingly to limit your risk exposure.
Option to Toggle Number of Contracts
The script offers the option to toggle between using a percentage of equity for position sizing or specifying a fixed number of contracts. Utilizing a percentage of equity might yield unrealistic backtest results, especially over longer periods. This occurs because as the capital grows, the absolute position size also increases, potentially inflating the accumulated returns generated by the backtester. On the other hand, setting a fixed number of contracts as your position size offers a more stable and realistic ROI over the backtested period, as it removes the compounding effect on position sizes.
Key Features Strategy
MACD High Time Frame Entry and Exit Logic
The strategy employs a high time frame MACD (Moving Average Convergence Divergence) to make entry and exit decisions. You can easily adjust the timeframe settings and MACD settings in the inputsection to trade on lower timeframes. For more information on the HTF MACD with dynamic smoothing see:
Moving Average High Time Frame Filter
To reduce market 'noise', the strategy incorporates a high time frame moving average filter. This ensures that the trades are aligned with the dominant market trend (trading the trend). In the inputsection traders can easily switch between different type of moving averages. For more information about this HTF filter see:
Dynamic Smoothing
The script includes a feature for dynamic smoothing. The script contains The timeframeToMinutes(tf) function to convert any given time frame into its equivalent in minutes. For example, a daily (D) time frame is converted into 1440 minutes, a weekly (W) into 10,080 minutes, and so forth. Next the smoothing factor is calculated by dividing the minutes of the higher time frame by those of the current time frame. Finally, the script applies a Simple Moving Average (SMA) over the MACD, SIGNAL, and HIST values, MA filter using the dynamically calculated smoothing factor.
User Convenience: One of the major benefits is that traders don't need to manually adjust the smoothing factor when switching between different time frames. The script does this dynamically.
Visual Consistency: Dynamic smoothing helps traders to more accurately visualize and interpret HTF indicators when trading on lower time frames.
Time Frame Restriction: It's crucial to note that the operational time frame should always be lower than the time frame selected in the input sections for dynamic smoothing to function as intended.
By incorporating this dynamic smoothing logic, the script offers traders a nuanced yet straightforward way to adapt High Time Frame indicators for lower time frame trading, enhancing both adaptability and user experience.
Limitations: Exit Strategy
It's crucial to note that the script comes with a simplified exit strategy, devoid of features like a stop-loss, trailing stop-loss or multiple take profits. This means that while the script focuses on entries and risk management, it might result in higher losses if market conditions unexpectedly turn unfavorable.
Conclusion
Effective risk management is pivotal for trading success, and this TradingView script is designed to give you a better idea how to implement positions sizing with your preferred strategy. However, it's essential to note that this tool should not be considered financial advice. Always perform your due diligence and consult with financial advisors before making any trading decisions.
Feel free to use this risk management tool as building block in your trading scripts, Happy Trading!
RSI + Divergences + Alerts [MisterMoTA]The indicator RSI + Divergences + Alerts by MisterMoTA is an RSI indicator that fills the RSI and RSI moving average with 4 different colors (growing up, falling up, falling down and rising down colors), users can customize colors from dashboard , also can be disabled the fill if the user want a standard RSI.
The dafault value of RSI is 14 and value of the moving average is 50 ( a dynamic 50 rsi line is better for trend identification than a standard 50 line) and users can change the values from indicator settings.
For detecting the divergences displayed in the indicator, I integrated in our script the default Divergences indicator from Tradingview, users can display, hide and change colors for regular and hidden divergences.
RSI indicator display also trend conditions for RSI and RSI MA, the RSI MA angle is calculated using ATR value, the slope of the RSI Noving Average can help to identify trend conditions too.
The script comes with 12 different alerts, if need different alerts please let me know in the comments and will update the script with your request:
Alert for Regular Bullish Divergence
Alert for Regular Bearish Divergence
Alert for Hidden Bullish Divergence
Alert for Hidden Bearish Divergence
Alert for RSI Overbought
Alert for RSI Extreme Overbought
"Alert for RSI Oversold
Alert for RSI Extreme Oversold
Alert for RSI Crossing Above RSI MA
Alert for RSI Crossing Bellow RSI MA
Alert for RSI Crossing Above 50
Alert for RSI Crossing Bellow 50
Please follow me for other script like this one.
Kind regards,
MisterMoTA
@tk · fractal emas█ OVERVIEW
This script is an indicator that plots short, medium and long moving averages for multiple fractals. This script was based on sharks EMAs by rlvs indicator, that plots multiple rays for each fractals into the chart. The main feature of this indicator is the customizability. The calculation itself is simple as moving average.
█ MOTIVATION
The trader can customize all aspects of the plotted data. The text size, extended line length, the moving average type — exponential, simple, etc... — the length of fractal rays, line style, line width and visibility. To keep minimalist, this indicator simplifies the logic of line colors based on the purpose of each moving averages. To prevent overnoise the chart with multiple lines with multiple colors for each fractal timefraes, the trader needs to keep in mind that the all lines with the "short" moving average color for example, will represents the short moving averages lines for all fractals. This logic is applied for medium and long moving averages either.
█ CONCEPT
The trading concept to use this indicator is to make entries on uptrend or downtrend pullbacks when the asset price reaches the short, medium or long moving averages price levels. But this strategy don't works alone. It needs to be aligned together with others indicators like RSI, Chart Patterns, Support and Resistance, and so on... Even more confluences that you have, bigger are your chances to increase the probability for a successful trade. So, don't use this indicator alone. Compose a trading strategy and use it to improve your analysis.
█ CUSTOMIZATION
This indicator allows the trader to customize the following settings:
GENERAL
Text size
Changes the font size of the labels to improve accessibility.
Type: string
Options: `tiny`, `small`, `normal`, `large`.
Default: `small`
SHORT
Type
Select the Short Moving Average calculation type.
Type: string
Options: `EMA`, `SMA`, `HMA`, `VWMA`, `WMA`.
Default: `EMA`
Length
Changes the base length for the Short Moving Average calculation.
Type: int
Default: 12
Source
Changes the base source for the Short Moving Average calculation.
Type: float
Default: close
Color
The base color that will represent the Short Moving Average.
Type: color
Default: color.rgb(255, 235, 59) (yellow)
Fractal Style
The fractal ray line style.
Type: string
Options: `dotted`, `dashed`, `solid`.
Default: `dotted`
Fractal Width
The fractal ray line width.
Type: string
Options: `1px`, `2px`, `3px`, `4px`.
Default: `1px`
Fractal Ray Length
The fractal ray line length.
Type: int
Default: 12
MEDIUM
Type
Select the Medium Moving Average calculation type.
Type: string
Options: `EMA`, `SMA`, `HMA`, `VWMA`, `WMA`.
Default: `EMA`
Length
Changes the base length for the Medium Moving Average calculation.
Type: int
Default: 26
Source
Changes the base source for the Medium Moving Average calculation.
Type: float
Default: close
Color
The base color that will represent the Short Moving Average.
Type: color
Default: color.rgb(0, 230, 118) (lime)
Fractal Style
The fractal ray line style.
Type: string
Options: `dotted`, `dashed`, `solid`.
Default: `dotted`
Fractal Width
The fractal ray line width.
Type: string
Options: `1px`, `2px`, `3px`, `4px`.
Default: `1px`
Fractal Ray Length
The fractal ray line length.
Type: int
Default: 12
LONG
Type
Select the Long Moving Average calculation type.
Type: string
Options: `EMA`, `SMA`, `HMA`, `VWMA`, `WMA`.
Default: `EMA`
Length
Changes the base length for the Long Moving Average calculation.
Type: int
Default: 200
Source
Changes the base source for the Long Moving Average calculation.
Type: float
Default: close
Color
The base color that will represent the Short Moving Average.
Type: color
Default: color.rgb(255, 82, 82) (red)
Fractal Style
The fractal ray line style.
Type: string
Options: `dotted`, `dashed`, `solid`.
Default: `dotted`
Fractal Width
The fractal ray line width.
Type: string
Options: `1px`, `2px`, `3px`, `4px`.
Default: `1px`
Fractal Ray Length
The fractal ray line length.
Type: int
Default: 12
VISIBILITY
Show Fractal Rays · (Short)
Shows short moving average fractal rays.
Type: bool
Default: true
Show Fractal Rays · (Medium)
Shows short moving average fractal rays.
Type: bool
Default: true
Show Fractal Rays · (Long)
Shows short moving average fractal rays.
Type: bool
Default: true
█ FUNCTIONS
The script contains the following functions:
`fn_labelizeTimeFrame`
Labelize timeframe period in minutes and hours.
Parameters:
tf: (string) Timeframe period to be labelized.
Returns: (string) Labelized timeframe string.
`fn_builtInLineStyle`
Converts simple string to built-in line style variable value.
Parameters:
lineStyle: (string) The line style simple string.
Returns: (string) Built-in line style string value.
`fn_builtInLineWidth`
Converts simple pixel string to line width number value.
Parameters:
lineWidth: (string) The line width pixel simple string.
Returns: (string) Built-in line width number value.
`fn_requestFractal`
Requests fractal data based on `period` given an expression.
Parameters:
period: (string) The period timeframe of fractal.
expression: (series float) The expression to retrieve data from fractal.
Returns: (mixed) A result determined by `expression`.
`fn_plotRay`
Plots line after chart bars.
Parameters:
y: (float) Y axis line position.
label: (string) Label to be ploted after line.
color: (color) Line and label color.
length: (int) Line length.
show: (bool) Flag to display the line. (default: `true`)
lineStyle: (string) Line style to be applied. (default: `line.style_dotted`)
lineWidth: (int) Line width. (default: `1`)
Returns: void
`fn_plotEmaRay`
Plots moving average line for a specific period.
Parameters:
period: (simple string) Period of fractal to retrieve
expression: (series float) The expression to retrieve data from fractal.
color: (color) Line and label color.
length: (int) Line length. (default: `12`)
show: (bool) Flag to display the line. (default: `true`)
lineStyle: (string) Line style to be applied. (default: `line.style_dotted`)
lineWidth: (string) Line width. (default: `1px`)
Returns: void
`fn_plotExtendedEmaRay`
Draws extended line for current timeframe moving average.
Parameters:
coordY: (float) Extended line Y axis position.
textValue: (simple string) Extended line label text.
textColor: (color) Extended line text color.
length: (int) Extended length. (default: `5`)
Returns: void
Incomplete Session Candle - Incomplete Timeframe Candle Marker The "Incomplete Session Candle - Incomplete Timeframe Candle Marker" is an advanced tool tailored for technical analysts who understand the importance of accurate timeframes in their charting. While the indicator is not limited to the Indian market, its genesis is rooted in the nuances of trading sessions like those in India, which span 375 minutes from 9:15 AM to 3:30 PM.
Key Features:
Detects if the current timeframe is intraday (minutes or hours).
Calculates the expected duration of the candle for the chosen timeframe.
Highlights candles that don't achieve their expected session duration by placing a cross shape above the bar.
Compatible across various intraday timeframes, aiding traders in spotting discrepancies promptly.
Why We Made This: Not Just for India:
While we looked at the Indian market, this indicator works everywhere. Regular timeframes like 30 minutes, 1 hour, and 2 hours often end with incomplete candles, especially at the end of the trading day. For example:
A 30-minute timeframe makes 13 candles, but the last one is only 15 minutes long.
A 1-hour timeframe shows 7 candles, but the last one is just the last 15 minutes.
By switching to different timeframes like 25 minutes, 75 minutes, and 125 minutes, you get more complete information for better trading decisions. Learn more about this in our article: "Power of 25, 75, and 125-Minute Timeframes in the Indian Market", recognized by Trading View's Editors' Pick.
Benefits:
The indicator extends its benefits even to users without access to certain timeframes. It accommodates traders using a 1-hour timeframe (pertaining to Indian traders). By employing this indicator, traders consistently remain mindful of incomplete candles within their chosen timeframe
For those who utilize concepts like RBR, RBD, DBR, and DBD, this indicator is paramount. An incomplete candle can skew analysis, leading to potential misinterpretations of base or leg candles.
Final thoughts:
In markets like the Indian stock market, adopting such a tool is not just beneficial, but necessary. Whether you have access to unconventional timeframes or are using traditional ones, recognizing and accounting for the limitations of incomplete candles is critical & it's important to know if your candles fit the timeframe properly. This indicator gives you a better view of the market, which helps you make smarter trades.
Lastly, Thank you for your support! Your likes & comments. If you want to give any feedback then you can give in comment section.
Let's conquer the markets together!
Options Scalping NiftyThis Indicator is Owned by Team Option Scalping.
Top Right Corner TABLE ( 6 , 10 )
When you are trading in Nifty futures , we have to check major Stocks which is contributing to Nifty move. So we have given that in this tab.
This table consist of 5 Major Indices and 5 Stocks :
• BankNifty
• Nifty
•FinNifty
• Dow
• VIX
• RIL
• HDFCBANK
• INFY
• TCS
• ICICBANK
And following data of each stock has been provided:
• LTP
• Daily Change
• Daily Percentage Change
• 15-minute Change Percentage
• 1-Hour Change Percentage
This Table is completely different from Our other publish indicator named "Options Scalping V2". That consist of banking stocks data, and this consist of Nifty Stocks data. Data set are same but constituents are different.
MTF Fair Value Gap [BigBeluga]The MTF Fair Value Gap (FVG) indicator provides multi-timeframe options to observe lower or higher gaps in different timeframes within your current one. This can enhance the confluence in your trading decisions.
🔶 USAGE
An FVG is formed when a candle has an 'empty' body, leaving a gap. These areas are often filled before the market continues to trend in its original direction.
In practical terms, FVGs serve to highlight support areas (bullish FVGs) and resistance zones (bearish FVGs). As a gap is filled, signaling the end of the existing imbalance, it tends to foreshadow an impending price reversal.
While this approach is inherently contrarian, individuals seeking a more trend-following strategy can opt to use FVG identification as straightforward signals. This entails taking a long position upon detecting a bullish FVG and adopting a short position in the presence of a bearish FVG.
🔹 Mitigation
The mitigation point is where the user selects when the FVG is considered filled or no longer usable.
Source => Choose the candle's low/high or close as the mitigation point.
Point => Choose the FVG's mitigation point to trigger after the candle's Source has filled it. Users can choose between the middle point or the top/bottom of the FVG.
ccc
🔹 MTF
This script can display MTF FVGs from different timeframes while showing the current one. This is extremely useful as it avoids the need to switch timeframes frequently and can add significant confluence with the current FVG.
🔹 Threshold
The Threshold is an input to remove insignificant FVGs that are too small to be truly useful. Users can choose between:
Auto => Automatically remove unusable FVGs.
Manual => Set an automatic Threshold.
🔶 TIPS
Users can choose how many FVGs to display on the current chart for better visualization.
Users can choose which FVGs to display: only the current one, only MTF ones, or both.
Support and Resistance Signals MTF [LuxAlgo]The Support and Resistance Signals MTF indicator aims to identify undoubtedly one of the key concepts of technical analysis Support and Resistance Levels and more importantly, the script aims to capture and highlight major price action movements, such as Breakouts , Tests of the Zones , Retests of the Zones , and Rejections .
The script supports Multi-TimeFrame (MTF) functionality allowing users to analyze and observe the Support and Resistance Levels/Zones and their associated Signals from a higher timeframe perspective.
This script is an extended version of our previously published Support-and-Resistance-Levels-with-Breaks script from 2020.
Identification of key support and resistance levels/zones is an essential ingredient to successful technical analysis.
🔶 USAGE
Support and resistance are key concepts that help traders understand, analyze and act on chart patterns in the financial markets. Support describes a price level where a downtrend pauses due to demand for an asset increasing, while resistance refers to a level where an uptrend reverses as a sell-off happens.
The creation of support and resistance levels comes as a result of an initial imbalance of supply/demand, which forms what we know as a swing high or swing low. This script starts its processing using the swing highs/lows. Swing Highs/Lows are levels that many of the market participants use as a historical reference to place their trading orders (buy, sell, stop loss), as a result, those price levels potentially become and serve as key support and resistance levels.
One of the important features of the script is the signals it provides. The script follows the major price movements and highlights them on the chart.
🔹 Breakouts (non-repaint)
A breakout is a price moving outside a defined support or resistance level, the significance of the breakout can be measured by examining the volume. This script is not filtering them based on volume but provides volume information for the bar where the breakout takes place.
🔹 Retests
Retest is a case where the price action breaches a zone and then revisits the level breached.
🔹 Tests
Test is a case where the price action touches the support or resistance zones.
🔹 Rejections
Rejections are pin bar patterns with high trading volume.
Finally, Multi TimeFrame (MTF) functionality allows users to analyze and observe the Support and Resistance Levels/Zones and their associated Signals from a higher timeframe perspective.
🔶 SETTINGS
The script takes into account user-defined parameters to detect and highlight the zones, levels, and signals.
🔹 Support & Resistance Settings
Detection Timeframe: Set the indicator resolution, the users may examine higher timeframe detection on their chart timeframe.
Detection Length: Swing levels detection length
Check Previous Historical S&R Level: enables the script to check the previous historical levels.
🔹 Signals
Breakouts: Toggles the visibility of the Breakouts, enables customization of the color and the size of the visuals
Tests: Toggles the visibility of the Tests, enables customization of the color and the size of the visuals
Retests: Toggles the visibility of the Retests, enables customization of the color and the size of the visuals
Rejections: Toggles the visibility of the Rejections, enables customization of the color and the size of the visuals
🔹 Others
Sentiment Profile: Toggles the visibility of the Sentiment Profiles
Bullish Nodes: Color option for Bullish Nodes
Bearish Nodes: Color option for Bearish Nodes
🔶 RELATED SCRIPTS
Support-and-Resistance-Levels-with-Breaks
Buyside-Sellside-Liquidity
Liquidity-Levels-Voids
Double Supertrend HTF FilterDouble Supertrend HTF Filter: A Comprehensive Market Direction Tool
The Double Supertrend HTF Filter is an innovative tool designed for traders who seek a more holistic view of market trends. At its core, the indicator combines two Supertrends from different higher timeframes, providing a layered perspective on the market's direction. Instead of juggling between multiple timeframes or charts, traders get a consolidated view with this indicator. One of its standout features is the horizontal line at the bottom of the chart, which visually represents the alignment of the two Supertrends – a simple yet powerful way to gauge the combined sentiment of the two higher timeframes on your chart.
The Supertrend Indicator: Origins and Rationale
The Supertrend indicator, a popular tool among traders, was developed by Olivier Seban. At its essence, the Supertrend is a trend-following indicator, designed to identify and visualize the current market trend. It operates using average true range (ATR) values and price data, effectively smoothing out market noise to present clearer trend directions. When prices move with a consistent momentum upwards or downwards, the Supertrend remains below or above the price respectively, signaling the prevailing trend's direction. The rationale behind the Supertrend is its ability to adapt to price volatility. By factoring in the average true range, it dynamically adjusts itself, ensuring that it's not just based on price but also the inherent volatility of the market. This adaptability makes it a valuable tool for traders, offering insights into potential trend reversals and potential entry or exit points.
Filter Usage
The main idea behind the Double Supertrend HTF is to use the indicator as a filter in addition to a signal indicator to your liking. To illustrate, consider incorporating it with a MACD Oscillator, such as the one detailed in this article: When the solid line at the bottom of the chart turns green, it signals that both supertrends are up and thus allows for long positions, indicating a bullish sentiment across both the chosen higher timeframes. Conversely, a red line permits short positions, hinting at a bearish trend. Should the line turn yellow, it's a sign of caution. The market is indecisive, and it might be prudent to refrain from taking any trades until a clearer direction emerges.
Features of the Indicator
Understanding that traders have different preferences, the Double Supertrend HTF Filter comes with customizable features. With the easy user interface you can change the timeframe, ATR and factor to your preferred trading strategy. The default settings are set for the 30 minutes and 4 hour timeframe, which is my personal preference for scalping trades on lower timeframes (eg. 1min, 5 min, 10 min, 15 min). While the dual Supertrend lines offer valuable insights, a chart can become cluttered when combined with other indicators. Therefore, traders have the option to toggle on or off the display of the Supertrends. This ensures that you have the flexibility to maintain a clean chart view while still benefiting from the insights the tool provides at the bottom of the chart.
A Note on Usage
It's essential to highlight that the Double Supertrend HTF Filter is for educational purposes. While it offers a unique perspective on market trends and can be a valuable addition to a trader's toolkit, it's merely an example of how one can use the Supertrend as a filter. Always conduct thorough research and consider your trading strategy before making any decisions.
If you have any comments or ideas how to combine this filter with other indicators feel free to leave a comment.
ICT Clean Midnight [dR-Algo]
Are you a trader who values clean charts and precise indicators? Are you an avid follower of ICT Concepts? If so, the Midnight Marker is tailored for you. This ultra-simple, highly effective TradingView script draws a nearly transparent blue line at midnight on your chart, keeping your interface as clean as possible while delivering essential information.
Why is "ICT Clean Midnight" so Special?
Focus on Price Action: The minimalist design ensures that you can focus solely on price action, which is a core principle of ICT teachings.
Easy Back Testing: Whether you're trading live or back-testing strategies, the midnight marker helps you quickly identify key time points.
Customizable: Though designed to be subtle, the line's color and opacity can be easily customized to suit your charting needs.
This indicator embodies ICT's principle of maintaining a clutter-free, focus-driven trading environment. Perfect for both novice traders wanting to adopt ICT concepts and seasoned traders looking for minimalistic yet effective tools.
Multi Time Frame Composite BandsMulti Time Frame Composite Bands utilizes Fibonacci numbers (5, 8, 13, 21, 34) as period lengths for calculations. The indicator calculates a composite high line (C_high) by averaging the highest prices over Fibonacci periods, incorporating moving averages (SMA) of high prices for added refinement and smoothing. Similarly, a composite low line (C_low) is calculated by averaging the lowest prices with moving averages of low prices. The midline, obtained from the mean of C_high and C_low.
This band can function as volatility bands unlike traditional volatility indicators like Bollinger Bands , ATR bands it does not use traditional measures of volatility such standard deviation , ATR. This hugs closely to the price and during trending markets the some part of the candles stay outside the band and when the entire candle digress outside the band a price correction or reversal can be anticipated. This can be considered as a smoothed Donchian channel.