Swing Percentile Lines [QuantVue]The Swing High/Low Percentile Indicator is designed to help traders identify key price levels based on the most recent swing high and low. By anchoring to the most recent swing high and swing low, the indicator automatically generates percentile lines ( 25%, 50%, 75%) that act as dynamic support and resistance levels.
What Does the Indicator Do?
The Swing High/Low Percentile Indicator works by identifying the most recent significant price swings, whether it's a swing high or swing low. It then calculates the range between these points and divides the distance into percentage-based levels. These levels are plotted on the chart as clear, easy-to-read lines at 25%, 50%, and 75% of the range between the swing high and low.
These percentile lines serve as dynamic price zones where traders can anticipate potential reactions, whether the market is trending or consolidating.
How Can Traders Use the Indicator?
Support and Resistance: The percentile lines act as evolving support and resistance zones. Traders can anticipate price bounces or breaks at these levels, providing opportunities for trend-following or reversal trades.
Trend Identification: The indicator helps traders determine the strength of a trend. In a strong uptrend, price will likely stay above the 50% or 75% lines, while in a downtrend, it may remain below the 50% or 25% lines. This gives traders an edge in recognizing the overall market direction.
Entry and Exit Points: Traders can use the percentile lines to time their entries and exits. For example, entering a trade on a pullback to the 25% or 50% line offers a favorable risk-to-reward ratio. Similarly, the percentile lines serve as natural profit targets, allowing traders to plan exits as the price approaches the 50% or 75% levels.
Risk Management: The clear delineation of price levels makes it easy for traders to set stop-loss orders. For example, if price falls below the 25% line in an uptrend, it may signal weakness, prompting an exit or reduced position size.
Breakout and Breakdown Scenarios: When price breaks above a recent swing high or below a swing low, the percentile lines provide traders with pullback entry opportunities or key levels to watch for continuation of the move.
Pivotstrategy
Pivot Data [QuantVue]The Pivot Data Indicator is designed to provide traders with valuable insights by identifying and analyzing pivot points on the price chart. It calculates both pivot highs and lows, then presents detailed statistics on the distance and time between these pivots.
a pivot point is defined as a specific point on the chart where the price either reaches a high or a low, with no bars higher or lower than it for a set number of bars on both sides (left and right). Essentially, it's a local high or low point, with the market moving in the opposite direction after the pivot forms.
For example:
A pivot high occurs when there are no bars with higher prices for a specified number of bars before and after that point.
A pivot low occurs when there are no bars with lower prices for the same number of bars on either side.
The number of bars to the left and right is adjustable via the Pivot Lookback Bars setting, allowing you to define how many bars are used to determine these pivot points.
Key features include:
Pivot Highs and Lows Identification: Automatically marks significant pivot highs and lows based on a user-defined lookback period, helping traders identify potential trend reversals or continuation points.
Prediction Labels: Provides forecasted pivot levels based on historical pivot price and time patterns, with options to show predictions for pivot highs, lows, or any pivot point.
Customizable Table Display: Displays a table summarizing important statistics, such as the average price percentage and the number of bars between pivots, along with the distance and time from the most recent pivot.
Traders can use this tool to map out potential levels of support and resistance based on historical data on pivot points.
False Breakouts [TradingFinder] Fake Breakouts Failure🔵 Introduction
Technical indicators are essential tools for analysts and traders in financial markets, helping them predict price movements and make better trading decisions. One of the key concepts in technical analysis that should be carefully considered is the "False Breakout."
This phenomenon occurs when a price temporarily breaks through a significant support or resistance level but fails to hold and quickly returns to its previous range. Understanding this concept and applying it in trading can reduce risks and increase profitability.
🟣 What is a False Breakout?
A Fake Breakout, as the name suggests, refers to a breakout that appears to occur but fails to sustain, leading the price to quickly revert back to its previous range. This situation often happens when inexperienced or non-professional traders, under psychological pressure and eager to enter the market quickly, initiate trades.
This creates opportunities for professional traders to take advantage of these short-term fluctuations and execute successful trades.
🟣 The Importance of Recognizing False Breakouts
Recognizing False Breakouts is crucial for any trader aiming for success in financial markets. False Breakouts typically occur when the market approaches a critical support or resistance level.
In these situations, many traders are waiting to see if the price will break through this level. However, when the price quickly returns to its previous range, it indicates weakness in the movement and the inability to sustain the breakout.
🟣 How to identify False Breakouts?
To identify Fake Breakouts, it is important to carefully analyze price charts and look for signs of a quick price reversal after breaking a key level.
Here are some chart patterns that may help you identify a False Breakout :
1. Pin Bar Pattern : The Pin Bar is a candlestick pattern that indicates a price reversal. This pattern usually appears near support and resistance levels, showing that the price attempted to break through a key level but failed and reversed.
2. Fakey Pattern : This pattern, which consists of several candlesticks, indicates a False Breakout and a quick price return to the previous range. It usually appears near key levels and can signal a trend reversal.
3. Using Multiple Timeframes : One way to identify False Breakouts is by using charts of different timeframes. Sometimes, a breakout on a one-hour chart may be a False Breakout on a daily chart. Analyzing charts across multiple timeframes can help you accurately identify this phenomenon.
🔵 How to Use
Once you identify a False Breakout, you can use it as a trading signal. For this, it is best to look for trading opportunities in the opposite direction of the False Breakout. In other words, if a False Breakout occurs at a resistance level, you might consider selling opportunities, and if it happens at a support level, you might look for buying opportunities.
Here are some key points for trading based on False Breakouts :
1. Patience and Discipline : Patience and discipline are crucial when trading with False Breakouts. Wait for the False Breakout to clearly form before entering a trade.
2. Use Stop Loss : Setting an appropriate stop loss is vital when trading based on False Breakouts. Typically, the stop loss can be placed near the level where the False Breakout occurred.
3. Seek Confirmations : Before entering a trade, look for additional confirmations. These can include other analyses or technical indicators that show the price is likely to return to its previous level.
🔵 Settings
🟣 Logical settings
Swing period : You can set the swing detection period.
Max Swing Back Method : It is in two modes "All" and "Custom". If it is in "All" mode, it will check all swings, and if it is in "Custom" mode, it will check the swings to the extent you determine.
Max Swing Bac k: You can set the number of swings that will go back for checking.
🟣 Display settings
Displaying or not displaying swings and setting the color of labels and lines.
🟣 Alert Settings
Alert False Breakout : Enables alerts for Breakout.
Message Frequency : Determines the frequency of alerts. Options include 'All' (every function call), 'Once Per Bar' (first call within the bar), and 'Once Per Bar Close' (final script execution of the real-time bar). Default is 'Once per Bar'.
Show Alert Time by Time Zone : Configures the time zone for alert messages. Default is 'UTC'.
🔵Conclusion
False Breakouts, as a key concept in technical analysis, are powerful tools for identifying sudden price changes and using them in trading. Understanding this phenomenon and applying it can help traders perform better in financial markets and avoid potential losses.
To benefit from False Breakouts, traders need to carefully analyze charts and use the appropriate analytical tools. By leveraging this strategy, traders can achieve lower-risk and higher-reward trades.
Pivot Point Calculator [JP&Dia]English User Guide
Script Name: Pivot Point Calculator
What Does This Script Do? This script calculates classic and Camarilla pivot points used in financial markets. Pivot points are used to identify key support and resistance levels, and this script helps traders better understand market movements.
How to Use It?
Add the script to your charts on TradingView.
Enter your desired time frame in the “Enter Time Frame” field (e.g., M, W, D).
Choose either or both “Classic Pivot” and “Camarilla Pivot” options to display them.
The script will automatically calculate the pivot points and display them on the chart.
Why Is This Script Unique? This script combines both classic and Camarilla pivot calculations, allowing users to easily utilize both pivot styles through a single script.
How Can People Benefit? Traders can use this script to identify potential buy-sell points and market trends. They can also conduct their market analyses more efficiently and effectively.
Script Adı: Pivot Noktası Hesaplayıcı
Script Ne İşe Yarar? Bu script, finansal piyasalarda kullanılan klasik ve Camarilla pivot noktalarını hesaplar. Pivot noktaları, önemli destek ve direnç seviyelerini belirlemek için kullanılır ve bu script, yatırımcıların piyasa hareketlerini daha iyi anlamalarına yardımcı olur.
Nasıl Kullanılır?
Scripti TradingView’deki grafiklerinize ekleyin.
“Zaman Dilimi Girin” alanına istediğiniz zaman dilimini girin (Örneğin: M, W, D).
“Classic Pivot” ve “Camarilla Pivot” seçeneklerinden birini veya her ikisini de seçerek gösterilmesini sağlayabilirsiniz.
Script otomatik olarak pivot noktalarını hesaplayacak ve grafik üzerinde gösterecektir.
Neden Özgü Bir Script? Bu script, hem klasik hem de Camarilla pivot hesaplamalarını birleştirir ve kullanıcıların her iki pivot stilini de tek bir script üzerinden kolayca kullanmalarını sağlar.
İnsanlar Nasıl Faydalanabilir? Yatırımcılar, bu scripti kullanarak potansiyel alım-satım noktalarını ve piyasa trendlerini belirleyebilirler. Ayrıca, piyasa analizlerini daha verimli ve etkili bir şekilde yapabilirler.
AI SuperTrend x Pivot Percentile - Strategy [PresentTrading]█ Introduction and How it is Different
The AI SuperTrend x Pivot Percentile strategy is a sophisticated trading approach that integrates AI-driven analysis with traditional technical indicators. Combining the AI SuperTrend with the Pivot Percentile strategy highlights several key advantages:
1. Enhanced Accuracy in Trend Prediction: The AI SuperTrend utilizes K-Nearest Neighbors (KNN) algorithm for trend prediction, improving accuracy by considering historical data patterns. This is complemented by the Pivot Percentile analysis which provides additional context on trend strength.
2. Comprehensive Market Analysis: The integration offers a multi-faceted approach to market analysis, combining AI insights with traditional technical indicators. This dual approach captures a broader range of market dynamics.
BTC 6H L/S Performance
Local
█ Strategy: How it Works - Detailed Explanation
🔶 AI-Enhanced SuperTrend Indicators
1. SuperTrend Calculation:
- The SuperTrend indicator is calculated using a moving average and the Average True Range (ATR). The basic formula is:
- Upper Band = Moving Average + (Multiplier × ATR)
- Lower Band = Moving Average - (Multiplier × ATR)
- The moving average type (SMA, EMA, WMA, RMA, VWMA) and the length of the moving average and ATR are adjustable parameters.
- The direction of the trend is determined based on the position of the closing price in relation to these bands.
2. AI Integration with K-Nearest Neighbors (KNN):
- The KNN algorithm is applied to predict trend direction. It uses historical price data and SuperTrend values to classify the current trend as bullish or bearish.
- The algorithm calculates the 'distance' between the current data point and historical points. The 'k' nearest data points (neighbors) are identified based on this distance.
- A weighted average of these neighbors' trends (bullish or bearish) is calculated to predict the current trend.
For more please check: Multi-TF AI SuperTrend with ADX - Strategy
🔶 Pivot Percentile Analysis
1. Percentile Calculation:
- This involves calculating the percentile ranks for high and low prices over a set of predefined lengths.
- The percentile function is typically defined as:
- Percentile = Value at (P/100) × (N + 1)th position
- Where P is the desired percentile, and N is the number of data points.
2. Trend Strength Evaluation:
- The calculated percentiles for highs and lows are used to determine the strength of bullish and bearish trends.
- For instance, a high percentile rank in the high prices may indicate a strong bullish trend, and vice versa for bearish trends.
For more please check: Pivot Percentile Trend - Strategy
🔶 Strategy Integration
1. Combining SuperTrend and Pivot Percentile:
- The strategy synthesizes the insights from both AI-enhanced SuperTrend and Pivot Percentile analysis.
- It compares the trend direction indicated by the SuperTrend with the strength of the trend as suggested by the Pivot Percentile analysis.
2. Signal Generation:
- A trading signal is generated when both the AI-enhanced SuperTrend and the Pivot Percentile analysis agree on the trend direction.
- For instance, a bullish signal is generated when both the SuperTrend is bullish, and the Pivot Percentile analysis shows strength in bullish trends.
🔶 Risk Management and Filters
- ADX and DMI Filter: The strategy uses the Average Directional Index (ADX) and the Directional Movement Index (DMI) as filters to assess the trend's strength and direction.
- Dynamic Trailing Stop Loss: Based on the SuperTrend indicator, the strategy dynamically adjusts stop-loss levels to manage risk effectively.
This strategy stands out for its ability to combine real-time AI analysis with established technical indicators, offering traders a nuanced and responsive tool for navigating complex market conditions. The equations and algorithms involved are pivotal in accurately identifying market trends and potential trade opportunities.
█ Usage
To effectively use this strategy, traders should:
1. Understand the AI and Pivot Percentile Indicators: A clear grasp of how these indicators work will enable traders to make informed decisions.
2. Interpret the Signals Accurately: The strategy provides bullish, bearish, and neutral signals. Traders should align these signals with their market analysis and trading goals.
3. Monitor Market Conditions: Given that this strategy is sensitive to market dynamics, continuous monitoring is crucial for timely decision-making.
4. Adjust Settings as Needed: Traders should feel free to tweak the input parameters to suit their trading preferences and to respond to changing market conditions.
█Default Settings and Their Impact on Performance
1. Trading Direction (Default: "Both")
Effect: Determines whether the strategy will take long positions, short positions, or both. Adjusting this setting can align the strategy with the trader's market outlook or risk preference.
2. AI Settings (Neighbors: 3, Data Points: 24)
Neighbors: The number of nearest neighbors in the KNN algorithm. A higher number might smooth out noise but could miss subtle, recent changes. A lower number makes the model more sensitive to recent data but may increase noise.
Data Points: Defines the amount of historical data considered. More data points provide a broader context but may dilute recent trends' impact.
3. SuperTrend Settings (Length: 10, Factor: 3.0, MA Source: "WMA")
Length: Affects the sensitivity of the SuperTrend indicator. A longer length results in a smoother, less sensitive indicator, ideal for long-term trends.
Factor: Determines the bandwidth of the SuperTrend. A higher factor creates wider bands, capturing larger price movements but potentially missing short-term signals.
MA Source: The type of moving average used (e.g., WMA - Weighted Moving Average). Different MA types can affect the trend indicator's responsiveness and smoothness.
4. AI Trend Prediction Settings (Price Trend: 10, Prediction Trend: 80)
Price Trend and Prediction Trend Lengths: These settings define the lengths of weighted moving averages for price and SuperTrend, impacting the responsiveness and smoothness of the AI's trend predictions.
5. Pivot Percentile Settings (Length: 10)
Length: Influences the calculation of pivot percentiles. A shorter length makes the percentile more responsive to recent price changes, while a longer length offers a broader view of price trends.
6. ADX and DMI Settings (ADX Length: 14, Time Frame: 'D')
ADX Length: Defines the period for the Average Directional Index calculation. A longer period results in a smoother ADX line.
Time Frame: Sets the time frame for the ADX and DMI calculations, affecting the sensitivity to market changes.
7. Commission, Slippage, and Initial Capital
These settings relate to transaction costs and initial investment, directly impacting net profitability and strategy feasibility.
Pivot Percentile Trend - Strategy [presentTrading]
█ Introduction and How it is Different
The "Pivot Percentile Trend - Strategy" from PresentTrading represents a paradigm shift in technical trading strategies. What sets this strategy apart is its innovative use of pivot percentiles, a method that goes beyond traditional indicator-based analyses. Unlike standard strategies that might depend on single-dimensional signals, this approach takes a multi-layered view of market movements, blending percentile calculations with SuperTrend indicators for a more nuanced and dynamic market analysis.
This strategy stands out for its ability to process multiple data points across various timeframes and pivot lengths, thereby capturing a broader and more detailed picture of market trends. It's not just about following the price; it's about understanding its position in the context of recent historical highs and lows, offering a more profound insight into potential market movements.
BTC 6h L/S
Where traditional methods might react to market changes, the Pivot Percentile Trend strategy anticipates them, using a calculated approach to identify trend strengths and weaknesses. This foresight gives traders a significant advantage, allowing for more strategic decision-making and potentially increasing the chances of successful trades.
In essence, this strategy introduces a more comprehensive and proactive approach to trading, harnessing the power of advanced percentile calculations combined with the robustness of SuperTrend indicators. It's a strategy designed for traders who seek a deeper understanding of market dynamics and a more calculated approach to their trading decisions.
Local picture
█ Strategy, How It Works: Detailed Explanation
🔶 Percentile Calculations
- The strategy employs percentile calculations to assess the relative position of current market prices against historical data.
- For a set of lengths (e.g., `length * 1`, `length * 2`, up to `length * 7`), it calculates the 75th percentile for high values (`percentilesHigh`) and the 25th percentile for low values (`percentilesLow`).
- These percentiles provide a sense of where the current price stands compared to recent price ranges.
Length - 10
Length - 15
🔶 SuperTrend Indicator
- The SuperTrend indicator is a key component, providing trend direction signals.
- It uses the `currentTrendValue`, derived from the difference between bull and bear strengths calculated from the percentile data.
* used the Supertrend toolkit by @EliCobra
🔶 Trend Strength Counts
- The strategy calculates counts of bullish and bearish indicators based on comparisons between the current high and low against high and low percentiles.
- `countBull` and `countBear` track the number of times the current high is above the high percentiles and the current low is below the low percentiles, respectively.
- Weak bullish (`weakBullCount`) and bearish (`weakBearCount`) counts are also determined by how often the current lows and highs fall within the percentile range.
*The idea of this strength counts mainly comes from 'Trend Strength Over Time' @federalTacos5392b
🔶 Trend Value Calculation
- The `currentTrendValue` is a crucial metric, computed as `bullStrength - bearStrength`.
- It indicates the market's trend direction, where a positive value suggests a bullish trend and a negative value indicates a bearish trend.
🔶 Trade Entry and Exit Logic
- The entry points for trades are determined by the combination of the trend value and the direction indicated by the SuperTrend indicator.
- For a long entry (`shouldEnterLong`), the `currentTrendValue` must be positive and the SuperTrend indicator should show a downtrend.
- Conversely, for a short entry (`shouldEnterShort`), the `currentTrendValue` should be negative with the SuperTrend indicating an uptrend.
- The strategy closes positions when these conditions reverse.
█ Trade Direction
The strategy is versatile, allowing traders to choose their preferred trading direction: long, short, or both. This flexibility enables traders to tailor their strategies to their market outlook and risk appetite.
█ Default Settings and Customization
1. Trade Direction: Selectable as Long, Short, or Both, affecting the type of trades executed.
2. Indicator Source: Pivot Percentile Calculations, key for identifying market trends and reversals.
3. Lengths for Percentile Calculation: Various configurable lengths, influencing the scope of trend analysis.
4. SuperTrend Settings: ATR Length 20, Multiplier 18, affecting indicator sensitivity and trend detection.
5. Style Options: Custom colors for bullish (green) and bearish (red) trends, aiding visual interpretation.
6. Additional Settings: Includes contrarian signals and UI enhancements, offering strategic and visual flexibility.
Long-Only Opening Range Breakout (ORB) with Pivot PointsIntraday Trading Strategy: Long-Only Opening Range Breakout (ORB) with Pivot Points
Background:
Opening Range Breakout (ORB) is a popular long-only trading strategy that capitalizes on the early morning volatility in financial markets. It's based on the idea that the initial price movements during the first few minutes or hours of the trading day can set the tone for the rest of the session. The strategy involves identifying a price range within which the asset trades during the opening period and then taking long positions when the price breaks out to the upside of this range.
Pivot Points are a widely used technical indicator in trading. They represent potential support and resistance levels based on the previous day's price action. Pivot points are calculated using the previous day's high, low, and close prices and can help traders identify key price levels for making trading decisions.
How to Use the Script:
Initialization: This script is written in Pine Script, a domain-specific language for trading strategies on the TradingView platform. To use this script, you need to have access to TradingView.
Apply the Script: You can do this by adding it to your favorites, then selecting the script in the indicators list under favorites or by searching for it by name under community scripts.
Customize Settings: The script allows you to customize various settings through the TradingView interface. These settings include:
Opening Session: You can set the time frame for the opening session.
Max Trades per Day: Specify the maximum number of long trades allowed per trading day.
Initial Stop Loss Type: Choose between using a percentage-based stop loss or the previous candles low for stop loss calculations.
Stop Loss Percentage: If you select the percentage-based stop loss, specify the percentage of the entry price for the stop loss.
Backtesting Start and End Time: Set the time frame for backtesting the strategy.
Strategy Signals:
The script will display pivot points in blue (R1, R2, R3, R4, R5) and half-pivot points in gray (R0.5, R1.5, R2.5, R3.5, R4.5) on your chart.
The green line represents the opening range.
The script generates long (buy) signals based on specific conditions:
---The open price is below the opening range high (h).
---The current high price is above the opening range high.
---Pivot point R1 is above the opening range high.
---It's a long-only strategy designed to capture upside breakouts.
---It also respects the maximum number of long trades per day.
The script manages long positions, calculates stop losses, and adjusts long positions according to the defined rules.
Trailing Stop Mechanism
The script incorporates a dynamic trailing stop mechanism designed to protect and maximize profits for long positions. Here's how it works:
1. Initialization:
The script allows you to choose between two types of initial stop loss:
---Percentage-based: This option sets the initial stop loss as a percentage of the entry price.
---Previous day's low: This option sets the initial stop loss at the previous day's low.
2. Setting the Initial Stop Loss (`sl_long0`):
The initial stop loss (`sl_long0`) is calculated based on the chosen method:
---If "Percentage" is selected, it calculates the stop loss as a percentage of the entry price.
---If "Previous Low" is selected, it sets the stop loss at the previous day's low.
3. Dynamic Trailing Stop (`trail_long`):
The script then monitors price movements and uses a dynamic trailing stop mechanism (`trail_long`) to adjust the stop loss level for long positions.
If the current high price rises above certain pivot point levels, the trailing stop is adjusted upwards to lock in profits.
The trailing stop levels are calculated based on pivot points (`r1`, `r2`, `r3`, etc.) and half-pivot points (`r0.5`, `r1.5`, `r2.5`, etc.).
The script checks if the high price surpasses these levels and, if so, updates the trailing stop accordingly.
This dynamic trailing stop allows traders to secure profits while giving the position room to potentially capture additional gains.
4. Final Stop Loss (`sl_long`):
The script calculates the final stop loss level (`sl_long`) based on the following logic:
---If no position is open (`pos == 0`), the stop loss is set to zero, indicating there is no active stop loss.
---If a position is open (`pos == 1`), the script calculates the maximum of the initial stop loss (`sl_long0`) and the dynamic trailing stop (`trail_long`).
---This ensures that the stop loss is always set to the more conservative of the two values to protect profits.
5. Plotting the Stop Loss:
The script plots the stop loss level on the chart using the `plot` function.
It will only display the stop loss level if there is an open position (`pos == 1`) and it's not a new trading day (`not newday`).
The stop loss level is shown in red on the chart.
By combining an initial stop loss with a dynamic trailing stop based on pivot points and half-pivot points, the script aims to provide a comprehensive risk management mechanism for long positions. This allows traders to lock in profits as the price moves in their favor while maintaining a safeguard against adverse price movements.
End of Day (EOD) Exit:
The script includes an "End of Day" (EOD) exit mechanism to automatically close any open positions at the end of the trading day. This feature is designed to manage and control positions when the trading day comes to a close. Here's how it works:
1. Initialization:
At the beginning of each trading day, the script identifies a new trading day using the `is_newbar('D')` condition.
When a new trading day begins, the `newday` variable becomes `true`, indicating the start of a new trading session.
2. Plotting the "End of Day" Signal:
The script includes a plot on the chart to visually represent the "End of Day" signal. This is done using the `plot` function.
The plot is labeled "DayEnd" and is displayed as a comment on the chart. It signifies the EOD point.
3. EOD Exit Condition:
When the script detects that a new trading day has started (`newday == true`), it triggers the EOD exit condition.
At this point, the script proceeds to close all open positions that may have been active during the trading day.
4. Closing Open Positions:
The `strategy.close_all` function is used to close all open positions when the EOD exit condition is met.
This function ensures that any remaining long positions are exited, regardless of their current profit or loss.
The function also includes an `alert_message`, which can be customized to send an alert or notification when positions are closed at EOD.
Purpose of EOD Exit
The "End of Day" exit mechanism serves several essential purposes in the trading strategy:
Risk Management: It helps manage risk by ensuring that positions are not left open overnight when markets can experience increased volatility.
Capital Preservation: Closing positions at EOD can help preserve trading capital by avoiding potential adverse overnight price movements.
Rule-Based Exit: The EOD exit is rule-based and automatic, ensuring that it is consistently applied without emotions or manual intervention.
Scalability: It allows the strategy to be applied to various markets and timeframes where EOD exits may be appropriate.
By incorporating an EOD exit mechanism, the script provides a comprehensive approach to managing positions, taking profits, and minimizing risk as each trading day concludes. This can be especially important in volatile markets like cryptocurrencies, where overnight price swings can be significant.
Backtesting: The script includes a backtesting feature that allows you to test the strategy's performance over historical data. Set the start and end times for backtesting to see how the long-only strategy would have performed in the past.
Trade Execution: If you choose to use this script for live trading, make sure you understand the risks involved. It's essential to set up proper risk management, including position sizing and stop loss orders.
Monitoring: Monitor the long-only strategy's performance over time and be prepared to make adjustments as market conditions change.
Disclaimer: Trading carries a risk of capital loss. This script is provided for educational purposes and as a starting point for your own long-only strategy development. Always do your own research and consider seeking advice from a qualified financial professional before making trading decisions.
SRTL, 2EMA & TRAMASRTL - Support Resistance and Trend Line with Double EMA and TRAMA
The SRTL indicator is a powerful tool for technical analysis that seamlessly integrates support and resistance levels, trend lines, and moving average signals. It offers traders a comprehensive view of the market's dynamics, making it a valuable addition to any trading toolkit. Here's a concise summary of its key features and functionalities:
Key Features:
- Dynamic Support and Resistance Levels based on Pivot Points
- Trend Lines based on Recent Pivot Points
- Double Exponential Moving Averages (EMA) with adjustable lengths
- Trend Regularity Adaptive Moving Average (TRAMA) for trend identification
- Buy and Sell signals based on the crossover of EMAs
The indicator is composed of 4 main components:
1. Support and resistance levels: The indicator calculates support and resistance levels based on pivot points and a channel width parameter. These levels can be used to identify potential entry and exit points for trades. The script calculates and plots dynamic support and resistance levels based on pivot points. Users can adjust the period for calculating pivot points, loopback period, and S/R strength to customize the levels' sensitivity.
2. Trend Lines: The script identifies and plots trend lines based on recent pivot points. Users can customize the number of pivot points to consider and the start date to begin plotting the trend lines. The script identifies and plots trend lines based on recent pivot points. By adjusting the number of pivot points to consider and the start date, traders can visualize potential trends and assess the market's overall direction. This feature helps traders understand the prevailing market sentiment and make informed trading decisions.
3. Double Exponential Moving Averages (EMA): The script calculates and plots two Exponential Moving Averages (EMA) with customizable lengths. A crossover of these EMAs can be used as a signal for potential trend changes. The study calculates and displays two Exponential Moving Averages (EMA) with adjustable lengths. The crossover of these EMAs serves as a crucial signal for potential trend changes. When the faster EMA crosses above the slower EMA, a "Buy" signal is generated, and when the faster EMA crosses below the slower EMA, a "Sell" signal is generated.
4. Trend Regularity Adaptive Moving Average (TRAMA): The script calculates and plots the TRAMA, a unique adaptive moving average that helps identify trends and adapt to market conditions. The indicator includes the Trend Regularity Adaptive Moving Average (TRAMA), an adaptive moving average designed to identify trends and adapt to varying market conditions. TRAMA helps traders gauge the strength of a trend and provides valuable insights into potential trend reversals.
5. Signals: The script generates "Buy - Green" and "Sell- Red" signals based on the crossover of the two EMAs and Pivot Point Trend Levels. That Also Customizable.
How to Use:
The SRTL indicator is a powerful tool for technical analysis, offering multiple layers of information for traders. When the price approaches dynamic support or resistance levels, The dynamic support and resistance levels are based on pivot points and adjust to the market's current conditions. The trend lines help visualize potential trends and can be adjusted to show different numbers of pivot points. Additionally, the Double EMA and TRAMA lines provide further insight into the market's momentum and potential reversals. Traders can assess the potential for trend reversals or breakouts. The trend lines help visualize the market's prevailing direction, and the crossover of the Double EMA signals potential entry and exit points.
Traders should use this study as part of a broader trading strategy and combine it with other technical indicators, fundamental analysis, and risk management techniques. Additionally, it's essential to test the indicator thoroughly in a demo or back testing environment before applying it to live trading to ensure its compatibility with individual trading styles and preferences.
SuperTrend Enhanced Pivot Reversal - Strategy [PresentTrading]
- Introduction and How it is Different
The SuperTrend Enhanced Pivot Reversal is a unique approach to trading that combines the best of two worlds: the precision of pivot reversal points and the trend-following power of the SuperTrend indicator. This strategy is designed to provide traders with clear entry and exit points, while also filtering out potentially false signals using the SuperTrend indicator.
BTCUSDT 6hr
ETHBTC 6hr
Unlike traditional pivot reversal strategies, this approach uses the SuperTrend indicator as a filter. This means that it only takes trades that align with the overall trend, as determined by the SuperTrend indicator. This can help to reduce the number of false signals and improve the overall profitability of the strategy.
The Pivot Reversal Strategy with SuperTrend Filter is particularly well-suited to the cryptocurrency market for the reason of High Volatility. This means that prices can change rapidly in a very short time, making it possible to make a profit quickly. The strategy's use of pivot points allows traders to take advantage of these rapid price changes by identifying potential reversal points
- Strategy: How it Works
The strategy works by identifying pivot reversal points, which are points in the price chart where the price is likely to reverse. These points are identified using a combination of the ta.pivothigh and ta.pivotlow functions, which find the highest and lowest points in the price chart over a certain period.
Once a pivot reversal point is identified, the strategy checks the direction of the SuperTrend indicator. If the SuperTrend is positive (indicating an uptrend), the strategy will only take long trades. If the SuperTrend is negative (indicating a downtrend), the strategy will only take short trades.
The strategy also includes a stop loss level, which is set as a percentage of the entry price. This helps to limit potential losses if the price moves in the opposite direction to the trade.
- Trade Direction
The trade direction can be set to "Long", "Short", or "Both". This allows the trader to choose whether they want to take only long trades (buying low and selling high), only short trades (selling high and buying low), or both. This can be useful depending on the trader's view of the market and their risk tolerance.
- Usage
To use the Pivot Reversal Strategy with SuperTrend Filter, simply input the desired parameters into the script and apply it to the price chart of the asset you wish to trade. The strategy will then identify potential trade entry and exit points, which will be displayed on the price chart.
- Default Settings
The default settings for the strategy are as follows:
ATR Length: 5
Factor: 2.618
Trade Direction: Both
Stop Loss Level: 20%
Commission: 0.1%
Slippage: 1
Currency: USD
Each trade: 10% of account equity
Initial capital: $10,000
These settings can be adjusted to suit the trader's preferences and risk tolerance. Always remember to test any changes to the settings using historical data before applying them to live trades.
K's Pivot PointsPivot points are a popular technical analysis tool used by traders to identify potential levels of support and resistance in a given timeframe. Pivot points are derived from previous price action and are used to estimate potential price levels where an asset may experience a reversal, breakout, or significant price movement.
The calculation of pivot points involves a simple formula that takes into account the high, low, and close prices from the previous trading session or a specific period. The most commonly used pivot point calculation method is the "Standard" or "Classic" method. Here's the formula:
Pivot Point (P) = (High + Low + Close) / 3
In addition to the pivot point itself, several support and resistance levels are calculated based on the pivot point value.
K's Pivot Points try to enhance them by incorporating multiple elements and by applying a re-integration strategy to validate two events:
* Found_Support: This event represents a basing market that is bound to recover or at least shape a bounce.
* Found_Resistance: This event represents a toppish market that is bound to consolidate or at least shape a pause.
K's Pivot Points are calculated following these steps:
1. Calculate the highest of highs for the previous 24 periods (preferably hours).
2. Calculate the lowest of lows for the previous 24 periods (preferably hours).
3. Calculate a 24-period (preferably hours) moving average of the close price.
4. Calculate K's Pivot Point as the average between the three previous step.
5. To find the support, use this formula: Support = (Lowest K's pivot point of the last 12 periods * 2) - Step 1
6. To find the resistance, use this formula: Resistance = (Highest K's pivot point of the last 12 periods * 2) - Step 2
The re-integration strategy to find support and resistance areas is as follows:
* A support has been found if the market breaks the support and shapes a close above it afterwards.
* A resistance has been found if the market surpasses the resistance and shapes a close below it afterwards.
The lookback period (whether 24 and 12) can be modified but the default versions work well.
Trendline Pivots [QuantVue]Trendline Pivots
The Trend Line Pivot Indicator works by automatically drawing and recognizing downward trendlines originating from and connecting pivot highs or upward trendlines originating from and connecting pivot lows.
These trendlines serve as reference points of potential resistance and support within the market.
Once identified, the trend line will continue to be drawn and progress with price until one of two conditions is met: either the price closes(default setting) above or below the trend line, or the line reaches a user-defined maximum length.
If the price closes(default setting) above a down trend line or below an up trend line, an "x" is displayed, indicating the resistance or support has been broken. At the same time, the trend line transforms into a dashed format, enabling clear differentiation from active non-breached trend lines.
This indicator is fully customizable from line colors, pivot length, the number lines you wish to see on your chart and works on any time frame and any market.
Don't hesitate to reach out with any questions or concerns.
We hope you enjoy!
Cheers.
Trend Finder++ (by Alex L.)This indicator seeks for a short term trend within a bigger long term trend and displays both in a channel with an extension lines (optional).
Use of this indicator is quite simple: when the stock is near the trend line bottom (default RED) it can be a good time to buy and when the stock is near the trend line top (default GREEN) it can be a good time to sell.
What new ideas and cool stuff this indicator offers:
- 'Trend (Months)' -
Trend channels will always be displayed over the period: last 'X' months (regardless of the 'Time Interval' set in your chart)
This allows you to go into a larger or smaller resolution and still see the same trend lines!
- ' Trend (Bars)' -
Optional. You can choose to display the Trend channel based on bars instead of months.
This can be useful for advanced traders, or in case a security is new and there isn't even 1 month of data.
- 'Show long-term trend' -
Optional. Displays a larger 3rd (even more long-term) trend in addition to the two current trends.
This is for advanced traders who want to see an even more bigger picture. It is best viewed on a weekly time interval.
- Customizable channel size, channel colors and channel style.
- 'Extend lines' -
Optional (default: yes). Trend channels' can be displayed with extension or without using this option.
- Internal Feature -
When trend channel goes below zero (can happen if stock's price falls sharply) - its below-zero portion will be drawn as 'extension' instead.
This is useful if such occurs, and we're in an auto-scaled chart - the lines will take less space on screen (for cleaner view).
Based on an idea/indicator by @ DevLucem called "Linear Regression ++"
Open Source.
Enjoy!
Opening Range with FibsThe indicator uses a time range and another instrument for time reference, so that it works in the time zone you care about. I have set the default to SPX500USD since it is in EST ( SPX , ES and many futures are on Chicago time and opening range gets confused). You can change the reference instrument in the settings.
You can also change the multipliers and use other values instead of 1.272 and 1.618 for Fib extensions.
TradingView has a limit as to how many objects an indicator can create so if you want to go back further for visual backtesting - use the replay tool - it will be able to draw up to the time you selected within its limits.
Let me know if you need anything else...
Happy Trading!
Pivot High/Low ComparisonThis script will show you at a glance the following trends:
Higher Highs (Green line on top)
Lower Highs (Red line on top)
Higher Lows (Green line on bottom)
Lower Lows (Red line on bottom)
It utilizes the Pivot High and Pivot Low functions to determine if the previous pivot was higher or lower than the current pivot .
AutoLevelsAuto Levels is a Work in progress.
It is based on the previous days ATR and the current days opening tick.
It takes that info and uses Fibonacci to automatically draw key levels for the day.
I have added the BULL BAR ( Green bar ) and Bear Bar ( Red Bar ) to signal as a Go Long / Go Short line in the sand.
The Tan bars are also proven key "Take Profit" levels.
These are, on average, major points of reversals, dip buys or consolidation.
I use this on the 5min timeframe and a close above or below a key level is my signal and direction. Auto Levels have proven to be a great indicator of major support and resistance.
Pivot Average [Misu]█ This Indicator is based on Pivot Points.
It aggregates closed Pivot Points to determine a " Pivot Average " line.
Pivot Points here refer to highs and lows.
█ Usages:
Pivot Average can be used as resistance or breakout area.
It is also very usefull to find battle zones.
It can also be used as a trend indicator: when the price is below, trend is down, when price is above, trend is up.
Mixed with momentum/volatility indicator it is very powerfull.
█ Parameters:
Deviation: Parameter used to calculate pivots.
Depth: Parameter used to calculate pivots.
Length: History Lenght used to determine Pivot Average.
Smoothing MA Lenght: MA lenght used to smooth Pivot Average.
Close Range %: Define price percentage change required to determine close pivots.
Color: Color of the Pivot Average.
Pivot-Based Channels & Bands [Misu]█ This Indicator is based on Pivot detection to show bands and channels.
The pivot price is similar to a resistance or support level. If the pivot level is breached, the price should continue in that direction. Or the price could reverse at or near this level.
█ Usages:
Use channels as a support & resistance zone.
Use bands as a support & resistance zone. It is also very powerfull to use it as a breakout.
Use mid bands & mid channels as a trend direction or trade filter as a more usual moving average.
█ Parameters:
Show Pivot Bands: show bands.
Show Pivot Mid Band: show mid bands.
Show Pivot Channels: show channels.
Show Pivot Mid Channel: show mid channels.
Deviation: deviation used to calculate pivot points.
Depth: depth used to calculate pivot points.
Trend Indicator (dow trending) - FontiramisuIndicator showing pivots and interpret a trend out of it.
Pivots are calculating with deviation parameter to validate with more precision.
Trending moves are calculated according to Dow Theory :
In an uptrend, if the price made a new high, the price must make a new high to confirm the trend, otherwise, it might signal a possible change in the trend.
In an uptrend, if the price made a new low, the price must make a new low to confirm the trend, otherwise, it might signal a possible change in the trend.
The indicator can show 2 trends with 2 different "Pivot Depth"
See indicator parameters.
Tab is display at the bottom right corner to show trend direction and if it is hesitating
Fontilab Library is used to code this indicator
fontilabLibrary "fontilab"
Provides function's indicators for pivot - trend - resistance.
pivots(src, lenght, isHigh) Detecting pivot points (and returning price + bar index.
Parameters:
src : The chart we analyse.
lenght : Used for the calcul.
isHigh : lookging for high if true, low otherwise.
Returns: The bar index and the price of the pivot.
calcDevThreshold(tresholdMultiplier, closePrice) Calculate deviation threshold for identifying major swings.
Parameters:
tresholdMultiplier : Usefull to equilibrate the calculate.
closePrice : Close price of the chart wanted.
Returns: The deviation threshold.
calcDev(basePrice, price) Custom function for calculating price deviation for validating large moves.
Parameters:
basePrice : The reference price.
price : The price tested.
Returns: The deviation.
pivotFoundWithLines(dev, isHigh, index, price, dev_threshold, isHighLast, pLast, iLast, lineLast) Detecting pivots that meet our deviation criteria.
Parameters:
dev : The deviation wanted.
isHigh : The type of pivot tested (high or low).
index : The Index of the pivot tested.
price : The chart price wanted.
dev_threshold : The deviation treshold.
isHighLast : The type of last pivot.
pLast : The pivot price last.
iLast : Index of the last pivot.
lineLast : The lst line.
Returns: The Line and bool is pivot High.
getDeviationPivots(thresholdMultiplier, depth, lineLast, isHighLast, iLast, pLast, deleteLines, closePrice, highPrice, lowPrice) Get pivot that meet our deviation criteria.
Parameters:
thresholdMultiplier : The treshold multiplier.
depth : The depth to calculate pivot.
lineLast : The last line.
isHighLast : The type of last pivot
iLast : Index of the last pivot.
pLast : The pivot price last.
deleteLines : If the line are draw or not.
closePrice : The chart close price.
highPrice : The chart high price.
lowPrice : The chart low price.
Returns: All pivot the informations.
getElIntArrayFromEnd() Get the last element of an int array.
getElFloatArrayFromEnd() Get the last element of an float array.
getElBoolArrayFromEnd() Get the last element of a bool array.
isTrendContinuation(isTrendUp, arrayBounds, lastPrice, precision) Check if last price is between bounds array.
Parameters:
isTrendUp : Is actual trend up.
arrayBounds : The trend array.
lastPrice : The pivot Price that just be found.
precision : The percent we add to actual bounds to validate a move.
Returns: na if price is between bounds, true if continuation, false if not.
getTrendPivots(trendBarIndexes, trendPrices, trendPricesIsHigh, interBarIndexes, interPrices, interPricesIsHigh, isTrendHesitate, isTrendUp, trendPrecision, pLast, iLast, isHighLast) Function to update array and trend related to pivot trend interpretation.
Parameters:
trendBarIndexes : The array trend bar index.
trendPrices : The array trend price.
trendPricesIsHigh : The array trend is high.
interBarIndexes : The array inter bar index.
interPrices : The array inter price.
interPricesIsHigh : The array inter ishigh.
isTrendHesitate : The actual status of is trend hesitate.
isTrendUp : The actual status of is trend up.
trendPrecision : The var precision to add in "iscontinuation" function.
pLast : The last pivot price.
iLast : The last pivot bar index.
isHighLast : The last pivot "isHigh".
Returns: trend & inter arrays, is trend hesitate, is trend up.
drawBoundLines(startIndex, startPrice, endIndex, endPrice, breakingPivotIndex, breakingPivotPrice, isTrendUp) Draw bounds and breaking line of the trend.
Parameters:
startIndex : Index of the first bound line.
startPrice : Price of first bound line.
endIndex : Index of second bound line.
endPrice : price of second bound line.
breakingPivotIndex : The breaking line index.
breakingPivotPrice : The breaking line price.
isTrendUp : The actual status of the trend.
Returns: The lines bounds and breaking line.
Weekly Returns with BenchmarkSome time ago I published Monthly returns table. Now It's time for weekly one.
To get it work you need a pretty big screen, but I hope it will be useful for some of you.
Features of this table includes:
Display weekly returns of your strategy, benchmark, and alpha over this benchmark.
Select benchmark to be another instrument
Select the date from which you want to compute monthly returns
Show/hide benchmark and alpha
Choose colors for gradient for gain/loss values
Use it with any type of strategy
Use it with replay
Thanks to @MUQWISHI to help me coding it.
It's not about the strategy itself but the way you display returns on your chart. So pls don't critique my choice of the strategy and its performance 🙂
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Pivots High-Low Screener & AlertsHi fellow traders ,
Pleased to share a Pivot High - Low Screener.
The script uses the TV inbuilt Pivot function.
It Screens 25 tickers default set, these can be modified in the input dialog box.
All you need to do is attach to any chart and set the periodicity or the resolution of the chart to your desired alert() frequency requirement.
Now go to the input settings icon of the script and set your Pivot right and left parameters!
Set the alert from the menu as usual click - Any alert() function call and bingo you are done!!
Similarily change the chart periodicity to the next timeframe and set the next alert.
No more opening multiple charts and setting individual time consuming alerts().
You will get concatenated alerts or summary alerts for your tickers.
Track 25tickers with a single alert for each timeframe(Supports 40 tickers).
Happy trading with TV..
Monthly Returns with BenchmarkI keep working on trying to make TradingView strategies look fancier.
A few months ago I published the first version of the Monthly Returns for Strategies in Pine Script. I received quite a lot of good feedback and quite a lot of requests to update it.
This is a more advanced version of the Monthly Returns, in it, you can:
Display monthly returns of your strategy, benchmark, and alpha over this benchmark.
Select benchmark to be another instrument
Select the date from which you want to compute monthly returns
Show/hide benchmark and alpha
Choose colors for gradient for gain/loss values
Use it with any type of strategy
Use it with replay
I hope it will be useful for you.
It's not about the strategy itself but the way you display returns on your chart. So pls don't critique my choice of the strategy and its performance 🙂
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Pivot Support & ResistanceHere signals are based on the pivot high and pivot lows. Factors taken into account in understanding the breakout or breakdown are:
volume
candle bar is not opening candle
must be near pivot high or low
Recommendation:
Use once candle closes else you might get trapped in certain cases so be careful