ATR-Based Strategy with Trailing StopsATR-Based Strategy with Trailing Stops
Unlock the power of adaptive risk management and trend-following for your trading.
🔍 Introduction:
This strategy is designed for traders looking to:
Enter trends confidently.
Maximize profits with adaptive trailing stops.
Control risk dynamically using the ATR (Average True Range).
Whether you're a beginner or an experienced trader, this tool simplifies trend-following and helps you stay on the right side of the market.
✨ Key Features:
ATR-Based Trailing Stops: Automatically adapts to market volatility, ensuring precise exits.
Dynamic Position Sizing: Protects your capital by calculating trade sizes based on risk and volatility.
Crossover Signals: Combines fast- and slow-moving averages for accurate trend identification.
Performance Metrics: Use TradingView's Strategy Tester to analyze performance, including profit factor, drawdown, and win rate.
⚙️ How It Works:
Entry Signals: The strategy generates buy/sell signals when moving averages cross over.
Risk Management:
Take profit and stop loss levels are calculated dynamically using ATR.
Trailing stops lock in profits as the trend progresses.
Customizable Settings:
Adjust moving average lengths, ATR multiplier, and risk percentage to fit your trading style.
📈 Who Should Use It?:
Swing Traders: Capitalize on medium-term trends with clear entry/exit points.
Trend Followers: Stay in profitable trades while protecting against reversals.
Beginner Traders: Learn risk management principles with built-in tools.
🚀 Why Choose This Indicator?:
Simplicity: Automates entry, exit, and risk management, saving you time and effort.
Adaptability: Works across all asset classes (crypto, stocks, forex) and timeframes.
Proven Performance: Backtest results show consistent profitability with manageable drawdowns.
Education: Perfect for learning ATR-based trading strategies.
📌 Important Notes:
Always test the strategy on historical data using TradingView's Strategy Tester.
Combine this indicator with additional tools like volume, trendlines, or Fibonacci levels for better results.
This is not financial advice—use it responsibly.
Technical
Sharpe Ratio Z-ScoreThis indicator calculates the Sharpe Ratio and its Z-Score , which are used to evaluate the risk-adjusted return of an asset over a given period. The Sharpe Ratio is computed using the average return and the standard deviation of returns, while the Z-Score standardizes this ratio to assess how far the current Sharpe Ratio deviates from its historical average.
The Sharpe Ratio is a measure of how much return an investment has generated relative to the risk it has taken. In the context of this script, the risk-free rate is assumed to be 0, but in real applications, it would typically be the return on a safe investment, like a Treasury bond. A higher Sharpe Ratio indicates that the investment's returns are higher compared to its risk, making it a more favorable investment. Conversely, a lower Sharpe Ratio suggests that the investment may not be worth the risk.
Calculation:
Daily Returns Calculation: The script calculates the daily return of the asset. This measures the percentage change in the asset’s closing price from one period to the next.
Sharpe Ratio Calculation: The Sharpe Ratio is calculated by taking the average daily return and dividing it by the standard deviation of the returns, then multiplying by the square root of the period length.
Usage:
Traders and Investors can use the Sharpe Ratio to evaluate how well the asset is compensating for risk. A high Sharpe Ratio indicates a high return per unit of risk, whereas a low or negative Sharpe Ratio suggests poor risk-adjusted returns. In overbought times, an asset would have high/positive returns per unit of risk. In oversold times, an asset would have low/negative returns per unit of risk.
The Z-Score provides a way to compare the current Sharpe Ratio to its historical distribution, offering a more standardized view of how extreme or typical the current ratio is.
Positive Z-score: Indicates that the asset's return is significantly lower than its risk, suggesting potential oversold conditions.
Negative Z-score: Indicates that the asset's return is significantly higher than its risk, suggesting potential overbought conditions.
Red Zone (-3 to -2): Strong overbought conditions.
Green Zone (2 to 3): Strong oversold conditions.
Sharpe Ratio Limitations:
While the Sharpe Ratio is widely used to evaluate risk-adjusted returns, it has its limitations.
Fat Tails: It assumes that returns are normally distributed and does not account for extreme events or "fat tails" in the return distribution. This can be problematic for assets like cryptocurrencies, which may experience large, sudden price swings that skew the return distribution.
Single Risk Factor: The Sharpe Ratio only considers standard deviation (total volatility) as a measure of risk, ignoring other types of risks like skewness or kurtosis, which may also impact an asset’s performance.
Time Frame Sensitivity: The accuracy of the Sharpe Ratio and its Z-Score is heavily influenced by the time frame chosen for the calculation. A longer period may smooth out short-term fluctuations, while a shorter period might be more sensitive to recent volatility.
Overbought and Oversold Zones: The script marks overbought and oversold conditions based on the Z-Score, but this is not a guarantee of market reversal. It’s important to combine this tool with other technical indicators and fundamental analysis for a more comprehensive market evaluation.
Volatility: The Sharpe Ratio and Z-Score depend on the volatility (standard deviation) of the asset’s returns. For highly volatile assets, such as cryptocurrencies, the Sharpe Ratio may not fully capture the true risk or may be misleading if the volatility is transient.
Doesn't Account for Downside Risk: The Sharpe Ratio treats upside and downside volatility equally, which may not reflect how investors perceive risk. Some investors may be more concerned with downside risk, which the Sharpe Ratio does not distinguish from upside fluctuations.
Important Considerations:
The Sharpe Ratio should not be used in isolation. While it provides valuable insights into risk-adjusted returns, it is important to combine it with other performance and risk indicators to form a more comprehensive market evaluation. Relying solely on the Sharpe Ratio may lead to misleading conclusions, particularly in volatile or non-normally distributed markets.
When integrated into a broader investment strategy, the Sharpe Ratio can help traders and investors better assess the risk-return profile of an asset, identifying periods of potential overperformance or underperformance. However, it should be used alongside other tools to ensure more informed decision-making, especially in highly fluctuating markets.
Fibonacci-Only StrategyFibonacci-Only Strategy
This script is a custom trading strategy designed for traders who leverage Fibonacci retracement levels to identify potential trade entries and exits. The strategy is versatile, allowing users to trade across multiple timeframes, with built-in options for dynamic stop loss, trailing stops, and take profit levels.
Key Features:
Custom Fibonacci Levels:
This strategy calculates three specific Fibonacci retracement levels: 19%, 82.56%, and the reverse 19% level. These levels are used to identify potential areas of support and resistance where price reversals or breaks might occur.
The Fibonacci levels are calculated based on the highest and lowest prices within a 100-bar period, making them dynamic and responsive to recent market conditions.
Dynamic Entry Conditions:
Touch Entry: The script enters long or short positions when the price touches specific Fibonacci levels and confirms the move with a bullish (for long) or bearish (for short) candle.
Break Entry (Optional): If the "Use Break Strategy" option is enabled, the script can also enter positions when the price breaks through Fibonacci levels, providing more aggressive entry opportunities.
Stop Loss Management:
The script offers flexible stop loss settings. Users can choose between a fixed percentage stop loss or an ATR-based stop loss, which adjusts based on market volatility.
The ATR (Average True Range) stop loss is multiplied by a user-defined factor, allowing for tailored risk management based on market conditions.
Trailing Stop Mechanism:
The script includes an optional trailing stop feature, which adjusts the stop loss level as the market moves in favor of the trade. This helps lock in profits while allowing the trade to run if the trend continues.
The trailing stop is calculated as a percentage of the difference between the entry price and the current market price.
Multiple Take Profit Levels:
The strategy calculates seven take profit levels, each at incremental percentages above (for long trades) or below (for short trades) the entry price. This allows for gradual profit-taking as the market moves in the trade's favor.
Each take profit level can be customized in terms of the percentage of the position to be closed, providing precise control over exit strategies.
Strategy Backtesting and Results:
Realistic Backtesting:
The script has been backtested with realistic account sizes, commission rates, and slippage settings to ensure that the results are applicable to actual trading scenarios.
The backtesting covers various timeframes and markets to ensure the strategy's robustness across different trading environments.
Default Settings:
The script is published with default settings that have been optimized for general use. These settings include a 15-minute timeframe, a 1.0% stop loss, a 2.0 ATR multiplier for stop loss, and a 1.5% trailing stop.
Users can adjust these settings to better fit their specific trading style or the market they are trading.
How It Works:
Long Entry Conditions:
The strategy enters a long position when the price touches the 19% Fibonacci level (from high to low) or the reverse 19% level (from low to high) and confirms the move with a bullish candle.
If the "Use Break Strategy" option is enabled, the script will also enter a long position when the price breaks below the 19% Fibonacci level and then moves back up, confirming the break with a bullish candle.
Short Entry Conditions:
The strategy enters a short position when the price touches the 82.56% Fibonacci level and confirms the move with a bearish candle.
If the "Use Break Strategy" option is enabled, the script will also enter a short position when the price breaks above the 82.56% Fibonacci level and then moves back down, confirming the break with a bearish candle.
Stop Loss and Take Profit Logic:
The stop loss for each trade is calculated based on the selected method (fixed percentage or ATR-based). The strategy then manages the trade by either trailing the stop or taking profit at predefined levels.
The take profit levels are set at increments of 0.5% above or below the entry price, depending on whether the position is long or short. The script gradually exits the trade as these levels are hit, securing profits while minimizing risk.
Usage:
For Fibonacci Traders:
This script is ideal for traders who rely on Fibonacci retracement levels to find potential trade entries and exits. The script automates the process, allowing traders to focus on market analysis and decision-making.
For Trend and Swing Traders:
The strategy's flexibility in handling both touch and break entries makes it suitable for trend-following and swing trading strategies. The multiple take profit levels allow traders to capture profits in trending markets while managing risk.
Important Notes:
Originality: This script uniquely combines Fibonacci retracement levels with dynamic stop loss management and multiple take profit levels. It is not just a combination of existing indicators but a thoughtful integration designed to enhance trading performance.
Disclaimer: Trading involves risk, and it is crucial to test this script in a demo account or through backtesting before applying it to live trading. Users should ensure that the settings align with their individual risk tolerance and trading strategy.
VIX - SKEW DivergenceThe CBOE VIX is a well-known index representing market expectations for volatility over the next 30 days.
The CBOE SKEW is an index reflecting the perceived tail risk over the next 30 days.
When the SKEW rises over a certain level (~140/150), that means investors are hedging their exposure with options, because they are worried about an incoming market crash or a "black swan". If that happens when the VIX is very low and apparently there is no uncertainty, this can warn of a sudden change in direction of the market. You will see for yourself that an increasing divergence often anticipates a sharp fall of leading stock indexes, usually within two to four months.
This is probably not very relevant for the short-term trader but mid/long-term traders and market analysts may find it useful to clearly visualize the extent of the distance between the VIX and the SKEW. For that reason, I wrote this highly customizable script with which you can plot the two indexes and fill the space within them with a color gradient to highlight the maximum and minimum divergence. Additionally, you can fill the beneath VIX area with four different colors. It is also possible to plot the divergence value itself, so if you want you can draw trendlines and support/resistance levels on it.
Please note that the divergence per se doesn't predict anything and it's meant to be used synergistically with other technical analysis tools.
More informations here:
www.cboe.com
www.cboe.com
Fibonacci Moving AverageThe Fibonacci Moving Average is a powerful indicator that takes into account many underlying moving averages to give out an approximate short-term/long-term view of the markets. Its strength lies with dynamic support and resistance levels. I have created this indicator in order to improve trend-following entry positions.
ATR-Adjusted RSIThis indicator adjusts the RSI values using the Average True Range. It is used the same way as a normal RSI.
TV signal for DCA backtestThis script allows you to backtest Trading View's "Technical Ratings" (Buy, Strong buy, Sell, Strong Sell) using Gavin's backtest script.
To use it add the backtest script to the chart together with this script and then from the back test settings connect the external indicator. You should select "TV Signal" as the source.
Backtesting works best on the 5m chart, but you can still change this script from its settings to higher timeframes.
Encoding
Buy is 1
Strong Buy is 2
Sell is -1
Strong Sell is -2
In the backtest script you can decide which rating you want to use for open deal and which one for close deal.
For example, if you were backtesting a long bot you could enter a long position when TV signal is Buy (1) and close the deal when TV signal is Sell (-1).
You have the full flexibility to decide which technical rating to use for your backtesting.
Enjoy!
MTF Technical Ratings [Anan]█ OVERVIEW
This indicator is a modified version of "Technical Ratings" v5.0 available in the public library to provide a quick overview of Technical Ratings in 6 optional timeframes.
█ FEATURES
- Multi-timeframe Table.
- Display Technical Ratings for "MAs" with a percentage.
- Display Technical Ratings for "Oscillators" with a percentage.
- Display Technical Ratings for "All" with a percentage.
- Full control of displaying any row(MAs / Oscillators / All) or any column(Multi-timeframe)
- Full control of Table position and size.
- Full control of displaying any row or column.
ORIGINAL DESCRIPTION ABOUT TECHNICAL RATING v1.0
█ OVERVIEW
This indicator calculates TradingView's well-known "Strong Buy", "Buy", "Neutral", "Sell" or "Strong Sell" states using the aggregate biases of 26 different technical indicators.
█ CALCULATIONS
The indicator calculates the aggregate value of two groups of indicators: moving averages and oscillators.
The "MAs" group is comprised of 15 different components:
• Six Simple Moving Averages of periods 10, 20, 30, 50, 100 and 200
• Six Exponential Moving Averages of the same periods
• A Hull Moving Average of period 9
• A Volume-weighed Moving Average of period 20
• Ichimoku
The "Oscillators" group includes 11 components:
• RSI
• Stochastic
• CCI
• ADX
• Awesome Oscillator
• Momentum
• MACD
• Stochastic RSI
• Wiliams %R
• Bull Bear Power
• Ultimate Oscillator
The state of each group's components is evaluated to a +1/0/-1 value corresponding to its bull/neutral/bear bias. The resulting value for each of the two groups are then averaged to produce the overall value for the indicator, which oscillates between +1 and -1. The complete conditions used in the calculations are documented in the Help Center.
CustomScreenerTo apply your indicator with screener , please modify the section which i mention "Start your indicator pine script" & "End your indicator pine script"
At the pinescript section you will able to change the ticket symbol .
I only able to show screener result with 10 item in 1 times . To view more result, please go to setting and change stock list "1-10">"11,20">"21-30".....
Able to screener 100 items with this indicator.
Kindly change the exchange and stock in the pinescript according your watchlist.
As examples, my indicator is to determine the stock in which trend, i want to find out all stock with aqua color trend
The screener result show only 9 of 10 are in aqua color trend.
Krowns 10 PACK Combo (5 EMAs, 5 SMAs) - v2Version 2 - Krowns Crypto 10 pack moving average set - written by "Kick Back Time" also known as Mr.Scrogers Neighborhood
...after receiving a lot of likes from the first version I thought I would go ahead and put out the updated version that I've been using
There's a few things I've changed to make it easier to adapt to.
This set is very similar to what Krown uses - I rarely look at the 100 SMA, but I do like the 128 SMA, so I made it default over the 100...
It's all adjustable in values, colors, line thicknesses, etc... it's all good
Tweeks/Improvements:
1) now has a shorter overlay title so it takes up less space on the chart and is less distractive
2) the 30, 50 and 128 SMA's are now default pink which stand out well and are easier to associate as SMA's
Ichimoku PanOptic TM-V1Modified Ichimoku indicator with signals from PanOptic Method by User Ichimoku_Trader.
TUX CandlesThis indicator has a lot of information. This is the first version so stay tuned for updates, and please let me know of any bugs.
Candlestick Indicators:
Doji
Shooting Star
Evening Star
Hammer
Hanging Man
Candlestick Formations
Tri-star
Bearish Harami
Bullish Harami
Bearish Harami Cross
Bullish Harami Cross
Bullish Engulfing
Bearish Engulfing
Rising Three
Falling Three
Bearish Abandoned Baby
Bullish Abandoned Baby
Three Black Crows
Three White Soldiers
Technical Indicators:
(You can set you MA periods)
Moving Average Cross
Move Average Crossover