Rolling VWAP with Optional Kalman FilterThis script provides an advanced and customizable Rolling VWAP (Volume-Weighted Average Price) indicator, designed for traders who want to refine their trend analysis and improve decision-making. With a unique option to apply a Kalman Filter, you can smooth out VWAP values to reduce noise in volatile markets, making it easier to identify actionable trends.
Key Features:
Dynamic Rolling VWAP:
Choose the rolling window size (number of bars) to match your trading style, whether you’re an intraday scalper or a swing trader.
Kalman Filter Toggle:
Enable the Kalman filter to smooth VWAP values and eliminate market noise.
Adjustable Kalman Gain to control the level of smoothing, making it suitable for both fast and slow markets.
Price Source Flexibility:
Use the Typical Price ((H+L+C)/3) or the Close Price as the basis for VWAP calculation.
Visual Enhancements:
Background shading highlights whether the price is above (bullish) or below (bearish) the VWAP, helping traders make quick visual assessments.
A legend dynamically updates the current VWAP value.
Dual View Option:
Compare the raw Rolling VWAP and the Kalman-filtered VWAP when the filter is enabled, giving you deeper insight into market trends.
Use Cases:
Intraday Traders: Identify key price levels for re-entry or exits using a short rolling window and responsive filtering.
Swing Traders: Analyze broader trends with a longer rolling window and smoother VWAP output.
Volatile Markets: Use the Kalman filter to reduce noise and avoid false signals during high market volatility.
How to Use:
Adjust the Rolling Window to set the number of bars for VWAP calculation.
Toggle Kalman Filter on/off depending on your preference for raw or smoothed VWAP values.
Fine-tune the Kalman Gain for the desired level of smoothing.
Use the shading to quickly assess whether the price is trading above or below the VWAP for potential entry/exit signals.
Indicadores e estratégias
Holding VolumeThe Holding Volume indicator calculates and visualizes the volume that corresponds specifically to the body of each candle, excluding the wicks (the upper and lower shadows of the candle).
This indicator can help traders better understand the strength of price movement during the trading session, as it isolates the volume that occurs when the price is moving within the body of the candle (between the open and close prices).
Key Features:
Volume Calculation: The indicator calculates the holding volume by taking the ratio of the candle's body range to its total range (including the wicks), and then multiplies that by the total volume of the candle.
Main Chart Display: The indicator is designed to be overlaid on the main chart, displaying the holding volume in a style similar to the default volume indicator.
Customizable Label Color: Customize the text color of the volume labels displayed on each candle.
Volume as Columns: The holding volume is shown as columns at the bottom of the chart, similar to the default volume display, for easy comparison and analysis.
How It Helps:
By focusing on the volume within the candle body, this indicator helps you see where the actual price movement and market participation occurred.
It can be useful for identifying candles with strong momentum or distinguishing between significant price movements and those driven by minor fluctuations or wicks.
Ideal Use Case:
Day traders, swing traders, and volume-focused traders can use this indicator to identify trends and analyze the strength of price moves.
This indicator is particularly useful when combined with other technical analysis tools to validate breakouts or reversals, based on the volume within the body of the candles.
Instructions:
No additional setup required: Simply add the indicator to your chart, and it will automatically display the holding volume on the main chart.
Adjust the label text color via the settings to match your chart's theme.
Alerts and symbolswhat is "Alerts and symbols"?
It is an indicator that allows you to watch more trading pairs and add alarms to them.
what it does?
It allows you to set a total of 20 different intersection alarms, 2 in each pair, for 10 different trading pairs at the same time.
It draws the candlestick chart of a pair you choose among 10 trading pairs and the alarm lines you created for this trading pair on the chart.
It also allows you to see the prices of 10 different trading pairs at the same time, thanks to the table it creates.
how to use it?
First, select the alarm pairs you want to use, for example, BTCUSDT pair is the default value for "pair 1". You can choose 10 different trading pairs as you wish. Just below each trading pair, there are two different sections titled "line 1" and "line 2" so that you can set an alarm. Type here the price levels at which you want to be alerted in case of a price crossover.
You can use the "candle source" section to examine the candlestick charts of trading pairs. The indicator draws the candle chart of the trading pair selected in the "candle source" section.
Check the "show alert lines on chart" box to see the levels you have set an alarm for.
When everything is ready, first click on the three dots next to the indicator's name and then on the clock icon. then create an alarm and that's it.
Coinbase Premium DivergenceCoinbase Spot premium indicator
Includes divergence where the premium is decreasing and price is increasing (and vice-versa); orange bear div, blue bull div.
Confluence = Green bull / Red bear
Use to identify warnings
Probably best to use on 15 /30 min
Applies only to current conditions in the bitcoin market.
For use on BTCUSD only.
Dynamic Fibonacci Retracement 3d / TradingArt3dDynamic Fibonacci Retracement - TradingArt3d.
The Dynamic Fibonacci Retracement is an advanced indicator based on the classic Fibonacci concept, adapted to the dynamic movements of the market. Unlike traditional retracements that remain static, this indicator adjusts Fibonacci levels based on the most relevant moving averages for each market condition, providing more accurate support and resistance levels.
Key Features:
• Fibonacci Moving Averages: Choose Fibonacci moving averages ranging from 1 to 4181.
• Dynamic Recursiveness: Automatically adjusts moving averages through a dynamic algorithm to identify the most representative support and resistance levels on the chart.
• Full Customization: Modify the colors, thickness, and resolution of moving average lines to suit your preferences.
• Mamut Wave Viewer: Intuitive RSI-based visualization to support decision-making in your analysis.
• Visualization Optimization: Options to enhance visualization, including enabling or disabling even or odd recursive moving averages.
Usage Tips:
• Use multiple instances of the indicator to overlay different moving average configurations, obtaining a more precise representation of Fibonacci levels.
• Experiment with different combinations of colors and resolutions to tailor the visualization to your analytical needs.
Archiving Your Analysis:
To preserve your technical analysis and keep a record of your configurations, follow these steps to archive them in TradingView:
1. Adjust the chart and indicator settings as desired.
2. Set your browser zoom to 25% to achieve the best possible resolution and maximize CPU efficiency.
3. Click the "capture image" icon at the top of the screen, or use the keyboard shortcut Alt + Ctrl + S (on PC) or Option + Command + S (on Mac).
4. Save the analysis image in your TradingArt Library for future reference or to share with others.
This functionality allows you to maintain a visual record of your analyses and track your strategies more effectively over time.
Support and Questions:
If you have any questions about using the indicator, feel free to leave a comment in the Comments section of this post or contact me through my TradingView profile. I’ll be happy to help resolve any issues and provide further details about its functionality
Square Numbers Horizontal LinesTrading with square numbers is a unique approach to technical analysis, where square numbers (1, 4, 9, 16, 25, etc.) are used to guide the identification of potential levels of support, resistance, and price targets. These numbers are often considered in a more mathematical or geometric context, and they can be applied in trading strategies, chart patterns, and psychological market analysis.
DCA Strategy with Mean Reversion and Bollinger BandDCA Strategy with Mean Reversion and Bollinger Band
The Dollar-Cost Averaging (DCA) Strategy with Mean Reversion and Bollinger Bands is a sophisticated trading strategy that combines the principles of DCA, mean reversion, and technical analysis using Bollinger Bands. This strategy aims to capitalize on market corrections by systematically entering positions during periods of price pullbacks and reversion to the mean.
Key Concepts and Principles
1. Dollar-Cost Averaging (DCA)
DCA is an investment strategy that involves regularly purchasing a fixed dollar amount of an asset, regardless of its price. The idea behind DCA is that by spreading out investments over time, the impact of market volatility is reduced, and investors can avoid making large investments at inopportune times. The strategy reduces the risk of buying all at once during a market high and can smooth out the cost of purchasing assets over time.
In the context of this strategy, the Investment Amount (USD) is set by the user and represents the amount of capital to be invested in each buy order. The strategy executes buy orders whenever the price crosses below the lower Bollinger Band, which suggests a potential market correction or pullback. This is an effective way to average the entry price and avoid the emotional pitfalls of trying to time the market perfectly.
2. Mean Reversion
Mean reversion is a concept that suggests prices will tend to return to their historical average or mean over time. In this strategy, mean reversion is implemented using the Bollinger Bands, which are based on a moving average and standard deviation. The lower band is considered a potential buy signal when the price crosses below it, indicating that the asset has become oversold or underpriced relative to its historical average. This triggers the DCA buy order.
Mean reversion strategies are popular because they exploit the natural tendency of prices to revert to their mean after experiencing extreme deviations, such as during market corrections or panic selling.
3. Bollinger Bands
Bollinger Bands are a technical analysis tool that consists of three lines:
Middle Band: The moving average, usually a 200-period Exponential Moving Average (EMA) in this strategy. This serves as the "mean" or baseline.
Upper Band: The middle band plus a certain number of standard deviations (multiplier). The upper band is used to identify overbought conditions.
Lower Band: The middle band minus a certain number of standard deviations (multiplier). The lower band is used to identify oversold conditions.
In this strategy, the Bollinger Bands are used to identify potential entry points for DCA trades. When the price crosses below the lower band, this is seen as a potential opportunity for mean reversion, suggesting that the asset may be oversold and could reverse back toward the middle band (the EMA). Conversely, when the price crosses above the upper band, it indicates overbought conditions and signals potential market exhaustion.
4. Time-Based Entry and Exit
The strategy has specific entry and exit points defined by time parameters:
Open Date: The date when the strategy begins opening positions.
Close Date: The date when all positions are closed.
This time-bound approach ensures that the strategy is active only during a specified window, which can be useful for testing specific market conditions or focusing on a particular time frame.
5. Position Sizing
Position sizing is determined by the Investment Amount (USD), which is the fixed amount to be invested in each buy order. The quantity of the asset to be purchased is calculated by dividing the investment amount by the current price of the asset (investment_amount / close). This ensures that the amount invested remains constant despite fluctuations in the asset's price.
6. Closing All Positions
The strategy includes an exit rule that closes all positions once the specified close date is reached. This allows for controlled exits and limits the exposure to market fluctuations beyond the strategy's timeframe.
7. Background Color Based on Price Relative to Bollinger Bands
The script uses the background color of the chart to provide visual feedback about the price's relationship with the Bollinger Bands:
Red background indicates the price is above the upper band, signaling overbought conditions.
Green background indicates the price is below the lower band, signaling oversold conditions.
This provides an easy-to-interpret visual cue for traders to assess the current market environment.
Postscript: Configuring Initial Capital for Backtesting
To ensure the backtest results align with the actual investment scenario, users must adjust the Initial Capital in the TradingView strategy properties. This is done by calculating the Initial Capital as the product of the Total Closed Trades and the Investment Amount (USD). For instance:
If the user is investing 100 USD per trade and has 10 closed trades, the Initial Capital should be set to 1,000 USD.
Similarly, if the user is investing 200 USD per trade and has 24 closed trades, the Initial Capital should be set to 4,800 USD.
This adjustment ensures that the backtesting results reflect the actual capital deployed in the strategy and provides an accurate representation of potential gains and losses.
Conclusion
The DCA strategy with Mean Reversion and Bollinger Bands is a systematic approach to investing that leverages the power of regular investments and technical analysis to reduce market timing risks. By combining DCA with the insights offered by Bollinger Bands and mean reversion, this strategy offers a structured way to navigate volatile markets while targeting favorable entry points. The clear entry and exit rules, coupled with time-based constraints, make it a robust and disciplined approach to long-term investing.
Universal Forex Strength Index - UFSIUniversal Forex Strength Index: A Comprehensive Guide for Traders
The Universal Forex Strength Index (UFSI) is a powerful technical analysis tool designed to help traders assess the strength of various currency pairs in the Forex market. This guide will walk you through the functionality of the UFSI, how to interpret its signals, and how to utilize it effectively in your trading strategy.
Understanding the Components of UFSI
1. Relative Strength Index (RSI)
The UFSI utilizes the Relative Strength Index (RSI), a momentum oscillator that measures the speed and change of price movements. The RSI ranges from 0 to 100 and is typically used to identify overbought or oversold conditions:
Above 70: Overbought condition
Below 30: Oversold condition
2. Exponential Moving Averages (EMA)
The indicator also incorporates two Exponential Moving Averages:
EMA 21: A short-term trend indicator.
EMA 50: A longer-term trend indicator.
The difference between these two EMAs is normalized to create a value that reflects market momentum.
3. Strength Index Calculation
The UFSI combines the RSI and the normalized EMA difference to produce a composite strength index. This index ranges from 0 to 100 and provides insights into the overall strength of a currency pair.
4. EMA of the Strength Index
A 50-period EMA of the strength index is calculated to smooth out fluctuations and provide a clearer trend direction.
Color Coding System
The UFSI employs a dynamic color-coding scheme that helps traders quickly assess market conditions:
Strength Index Colors
Green Shades: Indicates a strong bullish trend.
Dark Green (#006400) to Light Green (#008000): Strong bullish momentum.
Orange Shades: Indicates a potential reversal or uncertainty.
Orange (#FFA500) to Gold (#FFD700): Bullish but losing momentum.
Red Shades: Indicates a strong bearish trend.
Dark Red (#FF4500) to Bright Red (#FF0000): Strong bearish momentum.
Blue Shades: Indicates neutral or indecisive market conditions.
Light Blue (#1E90FF) to Dark Blue (#0000FF): No clear trend.
EMA Gradient Color
The color of the 50 EMA of the Strength Index changes based on its value:
Above 50: Indicates bullish sentiment, transitioning from light green to dark green as strength increases.
Below 50: Indicates bearish sentiment, transitioning from red to orange as strength decreases.
How to Use the Universal Forex Strength Index in Trading
Step-by-Step Trading Strategy
Identify Market Conditions
Look at the color of the strength index line:
If it’s predominantly green, consider looking for buying opportunities.
If it’s predominantly red, consider looking for selling opportunities.
If it’s blue, be cautious as there may be no clear trend.
Confirm with EMA
Check the position of the strength index relative to its EMA:
If the strength index is above its EMA and both are above 50, this confirms a strong bullish trend.
If the strength index is below its EMA and both are below 50, this confirms a strong bearish trend.
Set Entry and Exit Points
Use traditional support and resistance levels or other indicators (like moving averages or Fibonacci retracement levels) for setting entry and exit points.
Consider entering trades when there’s a crossover between the strength index and its EMA, especially when confirmed by color changes.
Risk Management
Always use stop-loss orders to protect against unexpected market movements.
Adjust your position size based on your risk tolerance and account size.
Conclusion
The Universal Forex Strength Index is an invaluable tool for traders seeking to gauge market sentiment and make informed trading decisions. By understanding its components, interpreting its color-coded signals, and integrating it into your trading strategy, you can enhance your ability to navigate the complexities of the Forex market successfully.
Feel free to share this guide on TradingView or use it as part of your trading toolkit! Happy trading!
Forecast Daily BIAS**Indicator Name:** Forecast Daily BIAS
**Description:**
The Forecast Daily BIAS indicator is designed to predict the expected price direction (BIAS) for the current trading day. It analyzes key price levels from the previous day (high, low, and close) and compares them to the opening price of the current day. The indicator provides a simple forecast for the day's price movement: **Bullish**, **Bearish**, or **Neutral**.
Key Features:
- Bullish Prediction: When the opening price is higher than the previous day's close and above the average of the previous day's high and low.
- Bearish Prediction: When the opening price is lower than the previous day's close and below the average of the previous day's high and low.
- Neutral Prediction: If the price does not meet the conditions for bullish or bearish bias.
- Visual Indicators:
- Displays the BIAS forecast directly on the chart with labels.
- Highlights the chart background with colors (green for bullish, red for bearish) for easy interpretation.
Use Case:
This indicator is ideal for traders looking to identify the probable direction of the market for the day and plan their intraday trading strategies accordingly. It is particularly useful for day traders who rely on prior price levels to make informed decisions.
How to Use:
1. Add the indicator to your chart.
2. Observe the daily BIAS prediction:
- Green Background: Likely bullish trend.
- Red Background: Likely bearish trend.
- No Highlight: Neutral trend.
3. Use the forecast in conjunction with other indicators or strategies to confirm your trades.
Note: The indicator provides a basic directional bias and should not be used as a standalone trading signal. Always consider additional market factors and risk management.
Candled LWMA (Loacally Weighted MA)The Locally Weighted Moving Average (LWMA) is a type of moving average that emphasizes recent data points by assigning them higher weights compared to older values. Unlike the Simple Moving Average (SMA), which treats all data points equally, or the Exponential Moving Average (EMA), which uses a fixed weighting factor, the LWMA applies a linear weighting scheme. This means that the most recent prices contribute more significantly to the average, making the LWMA more responsive to price changes while retaining a smooth curve.
In trading, the LWMA is particularly useful for identifying trends and detecting price reversals with reduced lag. By giving more importance to the latest prices, it provides a clearer picture of the current market dynamics. Traders often use the LWMA in combination with other indicators to confirm trends or spot potential entry and exit points. The adjustable length parameter allows for fine-tuning the indicator to match different market conditions and trading styles. Its ability to adapt to recent price behavior makes it a valuable tool for both short-term and long-term traders.
linreg-gridbotLinreg-GridBot
>release note version 1<
Introduction
This script is a powerful trading strategy tool designed to help users identify market reversal points and make smarter trading decisions using grid thinking.
Background
Traditional grid/martingale strategies have several drawbacks: inefficient use of capital, premature grid boundaries, and trading at fixed intervals, all of which significantly reduce profitability. Since, there is not a gridbot can trail-stop at each level, stay close with the trend, and do better capital usage, tradalive has created this advanced gridbot to address these issues, and enhance the profitability.
How does it work?
Imagine plotting closes on a graph, where the x-axis represents the time-intervals and the y-axis represents the price. Linear regression would fit a straight line through these points that best represents the trend of the data.
In this script utilize the built-in to find consecutive slopes at each moment, and combine them to a smooth trend line. When turning point censored, an entry is placed right after the next bar. Then the gridbot starts working, the upper limit and lower limit is calculated by built-in , for example 3 ATRs above and under the entry price.
There is a 0.2 trailing stop for each step level. Also, when built-in VWMA is rising, this script uses built-in ROC to find the average change of lookback length, then move the grid upwards accordingly.
Size trading is crucial, in gridbot all-in when beginning the trade is risky, because turning point does not guarantee a reversal market upcoming. As a grid trader, we believe the price is relatively cheap near the lower limit, and the price is relatively expensive near the upper limit. Properly sized orders help prevent overexposure and reduce the potential for significant losses.
Features
Trend Detection: Utilizes linear regression to differentiate between upward and downward trends, displaying them as (orange) trend lines on the chart.
Signal Generation: Provides buy or sell signals at reversal points, helping users trade at optimal times.
Adjustable Parameters: Allows users to customize different indicator parameters to fit various trading strategies.
Backtested Device Parameters (see appendix)
Grid Parameters
🔃: Cyclic Trading
💰: Capital Turnover Ratio (Grid capital difference per level: 0.5 to 2)
⬆️ / ⬇️ Expected Number of Upward and Downward Grids.
The minimum number of grids is three: one level above and below the current price.
The maximum number of grids is seven: three levels above and below the current price.
🧭: Trade Signal: Controls the trading direction, long or short;
📏: Linear regression length value.
⏳⌛Backtest Period: Set the time range for users to analyze the performance of the strategy over different periods.
Analytic Toolbox (upper right corner) :
Usage Instructions
Add this script to your TradingView account.
Apply the script to your chart.
Adjust the parameters to fit your trading needs.
Make trading decisions based on the buy and sell signals.
Manually place orders on your trading platform using the parameters provided.
Enter grid parameters according to the highest and lowest prices.
Fill in the number of grid levels (the number of grids equals the number of upward grids plus the number of downward grids plus one).
Set stop-loss and take-profit values.
Alternatively, use a webhook to connect to your trading platform for automated trading.
Important Notes
This script currently only supports 4-hour and daily charts!
This script relies on historical data for calculations and may not be suitable for all market conditions.
Trading carries risks, so please use this script cautiously for trading decisions.
User has to update the backtest period, or else the strategy might not be seen.
Demostration
Phase one, the orange line is about to turn up.
Phase two, the reversal point is located, and right after the next bar start an entry of gridbot.
Phase Three, the gridbot operates, once level touches, then a 0.2ATR trailing stop is applied on each step.
Phase four, when vwma rises, the grid window follows it by the rate of change of lookback price. If vwma does not move up, then the grid boundaries remain.
Phase five, either side when the current price breaks through the white limits, the gridbot stops. And the trading strategy is done for this round.
Adjustable Color Changing WMA by Slope Degree30 weighted moving average that changes colors based upon degree of slope. Consider it a green light for buying/selling pullbacks to the wma. You can adjust the colors and the threshold for the degree of slope.
Vietnamese Lunar New Year DatesVisualize Vietnamese Lunar New Year dates on your chart with this indicator!
This script plots vertical red lines for Lunar New Year from 2000 to 2030, along with blue and green lines marking the start of December (previous year) and January (current year) for context. Perfect for analyzing market patterns around this significant holiday.
Customize further to suit your trading style!"
crypto automated scannerThis Pine Script indicator, titled "scanner," allows users to monitor up to 40 specified securities, displaying their latest prices, net price changes, and the number of new highs and lows achieved during the current chart's timeframe. The information is presented in a customizable on-chart table, facilitating real-time comparison across multiple assets.
Key Features:
Security Selection: Users can input up to 40 ticker symbols to track. If fewer than 40 are needed, leaving the extra fields blank will exclude them from the display.
Data Displayed:
Last Price: The most recent closing price of each security.
Net Change: The difference between the current and previous closing prices, with positive changes in green and negative in red.
New Highs/Lows Count: The number of times each security has reached new highs or lows within the current chart's timeframe.
Sorting Options: Users can sort the securities in ascending or descending order based on their preferences.
Auto-Refresh Functionality: An optional feature allows the table to reset at specified intervals, ensuring the data remains current.
Customizable Appearance: The table's position, text size, frame and border colors, and background color can be adjusted to suit user preferences.
Usage Instructions:
Input Securities: Enter the ticker symbols of the securities you wish to monitor in the provided input fields.
Configure Settings:
Sorting Order: Choose between ascending or descending order for the display.
Auto-Refresh: Enable or disable the auto-refresh feature and set the desired interval.
Table Style: Adjust the table's position on the chart, text size, and colors to your liking.
Interpret the Table:
Each row corresponds to a security, displaying its ticker symbol, last price, net change, and counts of new highs and lows.
Colors indicate performance: green for positive net changes and red for negative.
Important Considerations:
Data Accuracy: The indicator relies on the availability and accuracy of data for the specified securities. Ensure that the entered ticker symbols are correct and that data is available for them.
Performance Impact: Monitoring a large number of securities simultaneously may impact the performance of the TradingView platform, depending on your device's capabilities.
Compliance with TradingView Policies: This script adheres to TradingView's House Rules and Script Publishing Rules. It is designed to provide original and useful functionality without duplicating existing built-in indicators.
By utilizing this indicator, traders can efficiently monitor multiple securities in real-time, aiding in comprehensive market analysis and informed decision-making.
3 Timeframe MACD3 Timeframe MACD Indicator
This indicator provides a multi-timeframe visualization of the MACD (Moving Average Convergence Divergence), enabling traders to analyze momentum and trend signals effectively across different timeframes.
Key Features:
Multi-Timeframe Capability:
Timeframe 1: Automatically uses the chart's current timeframe and displays the MACD Histogram along with the MACD line and Signal line.
Timeframe 2: A user-defined timeframe (default: 4 hours) displays both the MACD line and Signal line for trend and crossover analysis.
Timeframe 3: Another user-defined timeframe (default: 1 day) also displays the MACD line and Signal line, with increased line thickness for emphasis.
Dynamic Histogram Plot:
Timeframe 1's histogram is color-coded:
Green shades for positive values (brighter for increasing momentum).
Red shades for negative values (darker for increasing negative momentum).
Customizable MACD Parameters:
Adjustable Fast Length, Slow Length, and Signal Length to tailor the MACD calculation to specific trading styles or assets.
Clear and Distinct Visualizations:
Timeframe 1 includes the MACD Histogram with MACD and Signal lines for a detailed momentum view.
Timeframes 2 and 3 highlight the MACD and Signal lines in distinct colors for easy differentiation.
Use Case:
Ideal for traders seeking to monitor momentum changes (via Histogram) and trend/crossover signals (via MACD and Signal lines) across the current and two higher/lower timeframes.
Enhances decision-making by providing multi-timeframe confluence for trend-following or countertrend strategies.
This indicator is particularly useful for traders looking for a streamlined way to incorporate multi-timeframe analysis into their trading workflow.
[blackcat] L1 Main life line oscillator█ OVERVIEW
The Pine Script provided is an indicator named " L1 Main life line oscillator." Its primary function is to calculate and plot two oscillators: the Main Force and the Life Line. These oscillators are derived from smoothed price data, and the script also detects and labels crossovers and crossunders between the two lines, which can be used to generate buy and sell signals.
█ FEATURES
Key Features:
• Input Parameters: Users can define the period (n) and the weight for the oscillators.
• Custom Function: A function calculate_life_line_oscillator is defined to compute the Main Force and Life Line oscillators.
• Advanced Calculations: The script uses an adaptive moving average (ALMA) and exponential moving average (EMA) to smooth the price data and calculate the oscillators.
• Crossover and Crossunder Detection: Built-in functions ta.crossover and ta.crossunder are used to identify signal points.
• Label Drawing: Custom labels are drawn on the chart to indicate buy ("B") and sell ("S") signals.
█ HOW TO USE
1 — Configure Input Parameters: Adjust the period (n) and weight to suit your trading strategy.
2 — Interpret the Oscillators: Observe the Main Force and Life Line on the chart.
3 — Act on Signals: Look for crossovers and crossunders to generate buy and sell signals. Buy signals are indicated by the label "B" and sell signals by "S".
█ LIMITATIONS
• Lag in Signals: While the use of ALMA and EMA reduces lag, some delay may still occur, especially in volatile markets.
• False Signals: Crossovers and crossunders can sometimes produce false signals, so it is advisable to use this indicator in conjunction with other tools for confirmation.
█ NOTES
Advanced Pine Script Features:
• Adaptive Moving Average (ALMA): Provides a more responsive and adaptive oscillator.
• Exponential Moving Average (EMA): Smooths the price range and Main Force values.
• Crossover and Crossunder Detection: Utilizes built-in functions for signal identification.
• Label Drawing: Enhances visual signaling with custom labels.
Optimization Techniques:
• The use of ALMA and EMA helps in reducing lag and improving the responsiveness of the oscillators.
• The custom function encapsulates complex calculations, making the main script cleaner and more maintainable.
Unique Approaches:
• The combination of ALMA and EMA to create the Main Force oscillator provides a unique smoothing method.
• The Life Line is calculated using a weighted average of the previous and current Main Force values, adding an additional layer of smoothing and responsiveness.
█ THANKS
Thank you for using the " L1 Main life line oscillator." If you have any questions or suggestions, please feel free to reach out in the comments or on the TradingView or my Discord channel.
█ EXTENDED KNOWLEDGE AND APPLICATIONS
Potential Modifications:
• Additional Indicators: Extend the script to include other technical indicators (e.g., RSI, MACD) for a more comprehensive trading signal system.
• Customizable Colors and Styles: Allow users to customize the colors and styles of the plotted lines and labels.
• Alerts: Implement alerts for crossovers and crossunders to notify users in real-time.
Application Scenarios:
• Intraday Trading: The responsiveness of the oscillators makes this script suitable for intraday trading, where quick buy and sell signals are crucial.
• Long-Term Analysis: By adjusting the period n, the script can be used for long-term trend analysis and strategic trades.
• Backtesting: The script can be modified into a strategy to backtest the performance of the oscillator-based signals against historical data.
Related Pine Script Concepts:
• Strategy Development: Understanding how to convert indicators into strategies for backtesting and live trading.
• Advanced Plotting: Exploring more advanced plotting techniques, such as using different styles and customizing plot appearances.
• Signal Validation: Techniques for validating and filtering signals to reduce false positives and improve trade accuracy.
ATR SL Band (No-Repaint, Multi-Timeframe) + Risk per ContractThis indicator draws a non-repainting band for ATR-based Stoploss placement.
If used on Futures, it shows the distance + risk from the previous candle close, as well as from the current price.
The risk value is automatically calculated for the following symbols:
(Micro) ES (S&P 500)
(Micro) NQ (NASDAQ 100)
(Micro) YM (Dow Jones Industrial Average / US30)
The timeframe can be set individually. It is not recommended to use a lower timeframe than the chart timeframe as values differ from the actual timeframe's ATR SL in this case.
Visual ATR StopThis indicator uses the Average True Range (ATR) to display a visual range for stop placement. Two multiplier values (example, 1 and 3) can be set to create a filled area below the price. This area represents the range between the two ATR levels, adjusted by subtracting the current price, providing a simple way to visualize stop-loss placement based on volatility.
The indicator is customizable; for example, negative values can place the area above the price for short positions. The filled color can also be removed, which allows precise levels to be marked above and below.
Precision Trading Strategy: Golden EdgeThe PTS: Golden Edge strategy is designed for scalping Gold (XAU/USD) on lower timeframes, such as the 1-minute chart. It captures high-probability trade setups by aligning with strong trends and momentum, while filtering out low-quality trades during consolidation or low-volatility periods.
The strategy uses a combination of technical indicators to identify optimal entry points:
1. Exponential Moving Averages (EMAs): A fast EMA (3-period) and a slow EMA (33-period) are used to detect short-term trend reversals via crossover signals.
2. Hull Moving Average (HMA): A 66-period HMA acts as a higher-timeframe trend filter to ensure trades align with the overall market direction.
3. Relative Strength Index (RSI): A 12-period RSI identifies momentum. The strategy requires RSI > 55 for long trades and RSI < 45 for short trades, ensuring entries are backed by strong buying or selling pressure.
4. Average True Range (ATR): A 14-period ATR ensures trades occur only during volatile conditions, avoiding choppy or low-movement markets.
By combining these tools, the PTS: Golden Edge strategy creates a precise framework for scalping and offers a systematic approach to capitalize on Gold’s price movements efficiently.
Smoothed Source Weighted EMAThe Smoothed Source EMA is a tool designed to help traders identify potential buying and selling opportunities in the market. It combines two key elements: price smoothing (using standard deviation) and an Exponential Moving Average (EMA). The purpose is to filter out the day-to-day price fluctuations and create clearer buy and sell signals.
Key Concepts Behind the Indicator:
Price Smoothing (Standard Deviation):
To make the price action easier to follow, the indicator first "smooths" the price. This is done by looking at how much the price tends to move up and down (known as standard deviation).
It then creates two "bands" around the current price—one above and one below. These bands represent a smoothed version of the price and help filter out the noise caused by small, random price movements.
Exponential Moving Average (EMA):
The indicator also uses an Exponential Moving Average (EMA), which is a line that represents the average price over a certain period of time (but gives more weight to recent prices). The EMA helps capture the general trend of the price.
The indicator uses this EMA to compare the current price with the overall trend.
How Does the Indicator Work?
Once the indicator calculates the smoothed price bands and the EMA, it looks for specific conditions to trigger a buy or sell signal:
Long (Buy) Signal:
A buy signal happens when the smoothed price (the lower band) is above the EMA. In simple terms, the price is moving up, and the indicator is telling you it's a good time to buy.
The more "weight" or influence you give to the EMA, the slower this buy signal will appear, meaning it’ll only trigger when there’s a strong enough upward movement.
Short (Sell) Signal:
A sell signal occurs when the smoothed price (the upper band) is below the EMA. This suggests the price is moving down, and the indicator signals that it might be time to sell.
Again, the more "weight" you put on the EMA, the slower the sell signal will appear, as the indicator waits for a clearer downtrend.
Why is this Useful for Traders?
Smoothing the Price: Many traders struggle with the noise of price fluctuations, where the price moves up and down quickly without a clear trend. By smoothing the price, this indicator helps traders focus on the bigger picture and avoid reacting to every small movement.
Clear Buy and Sell Signals: The indicator generates easy-to-understand buy and sell signals based on the relationship between the smoothed price and the EMA. If the price is above the smoothed level and EMA, it’s a signal to buy. If it’s below, it’s a signal to sell.
Customizable Sensitivity: The indicator lets traders adjust how sensitive the buy and sell signals are. By changing certain settings, such as the smoothing length and the weight of the EMA, traders can make the indicator react faster or slower depending on how quickly they want to catch changes in the market.
How the Indicator Appears on the Chart:
EMA Line: A line that represents the trend of the price.
Upper and Lower Smoothed Bands: Two bands above and below the price that help identify when the price is moving up or down relative to the trend.
Buy and Sell Arrows: Small arrows on the chart show where the indicator suggests buying or selling.
Colored Bars: The bars on the chart may change color to visually indicate whether the indicator suggests a buy (green) or a sell (red).
In Summary:
The Smoothed Source EMA helps you identify trends by smoothing out price movements using standard deviation, then comparing these smoothed prices with the Exponential Moving Average (EMA).
When the smoothed price moves above or below the EMA, it gives you a signal: a buy when the smoothed price is above the EMA, and a sell when it’s below.
You can adjust how quickly or slowly these signals appear by modifying the settings, giving you control over how sensitive the indicator is to changes in the market.
This indicator is useful for traders who want to reduce noise and focus on the overall trend, using clear, visually simple signals to guide their trading decisions.
MultiLayer Acceleration/Deceleration Strategy [Skyrexio]Overview
MultiLayer Acceleration/Deceleration Strategy leverages the combination of Acceleration/Deceleration Indicator(AC), Williams Alligator, Williams Fractals and Exponential Moving Average (EMA) to obtain the high probability long setups. Moreover, strategy uses multi trades system, adding funds to long position if it considered that current trend has likely became stronger. Acceleration/Deceleration Indicator is used for creating signals, while Alligator and Fractal are used in conjunction as an approximation of short-term trend to filter them. At the same time EMA (default EMA's period = 100) is used as high probability long-term trend filter to open long trades only if it considers current price action as an uptrend. More information in "Methodology" and "Justification of Methodology" paragraphs. The strategy opens only long trades.
Unique Features
No fixed stop-loss and take profit: Instead of fixed stop-loss level strategy utilizes technical condition obtained by Fractals and Alligator to identify when current uptrend is likely to be over (more information in "Methodology" and "Justification of Methodology" paragraphs)
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Multilayer trades opening system: strategy uses only 10% of capital in every trade and open up to 5 trades at the same time if script consider current trend as strong one.
Short and long term trend trade filters: strategy uses EMA as high probability long-term trend filter and Alligator and Fractal combination as a short-term one.
Methodology
The strategy opens long trade when the following price met the conditions:
1. Price closed above EMA (by default, period = 100). Crossover is not obligatory.
2. Combination of Alligator and Williams Fractals shall consider current trend as an upward (all details in "Justification of Methodology" paragraph)
3. Acceleration/Deceleration shall create one of two types of long signals (all details in "Justification of Methodology" paragraph). Buy stop order is placed one tick above the candle's high of last created long signal.
4. If price reaches the order price, long position is opened with 10% of capital.
5. If currently we have opened position and price creates and hit the order price of another one long signal, another one long position will be added to the previous with another one 10% of capital. Strategy allows to open up to 5 long trades simultaneously.
6. If combination of Alligator and Williams Fractals shall consider current trend has been changed from up to downtrend, all long trades will be closed, no matter how many trades has been opened.
Script also has additional visuals. If second long trade has been opened simultaneously the Alligator's teeth line is plotted with the green color. Also for every trade in a row from 2 to 5 the label "Buy More" is also plotted just below the teeth line. With every next simultaneously opened trade the green color of the space between teeth and price became less transparent.
Strategy settings
In the inputs window user can setup strategy setting: EMA Length (by default = 100, period of EMA, used for long-term trend filtering EMA calculation). User can choose the optimal parameters during backtesting on certain price chart.
Justification of Methodology
Let's explore the key concepts of this strategy and understand how they work together. We'll begin with the simplest: the EMA.
The Exponential Moving Average (EMA) is a type of moving average that assigns greater weight to recent price data, making it more responsive to current market changes compared to the Simple Moving Average (SMA). This tool is widely used in technical analysis to identify trends and generate buy or sell signals. The EMA is calculated as follows:
1.Calculate the Smoothing Multiplier:
Multiplier = 2 / (n + 1), Where n is the number of periods.
2. EMA Calculation
EMA = (Current Price) × Multiplier + (Previous EMA) × (1 − Multiplier)
In this strategy, the EMA acts as a long-term trend filter. For instance, long trades are considered only when the price closes above the EMA (default: 100-period). This increases the likelihood of entering trades aligned with the prevailing trend.
Next, let’s discuss the short-term trend filter, which combines the Williams Alligator and Williams Fractals. Williams Alligator
Developed by Bill Williams, the Alligator is a technical indicator that identifies trends and potential market reversals. It consists of three smoothed moving averages:
Jaw (Blue Line): The slowest of the three, based on a 13-period smoothed moving average shifted 8 bars ahead.
Teeth (Red Line): The medium-speed line, derived from an 8-period smoothed moving average shifted 5 bars forward.
Lips (Green Line): The fastest line, calculated using a 5-period smoothed moving average shifted 3 bars forward.
When the lines diverge and align in order, the "Alligator" is "awake," signaling a strong trend. When the lines overlap or intertwine, the "Alligator" is "asleep," indicating a range-bound or sideways market. This indicator helps traders determine when to enter or avoid trades.
Fractals, another tool by Bill Williams, help identify potential reversal points on a price chart. A fractal forms over at least five consecutive bars, with the middle bar showing either:
Up Fractal: Occurs when the middle bar has a higher high than the two preceding and two following bars, suggesting a potential downward reversal.
Down Fractal: Happens when the middle bar shows a lower low than the surrounding two bars, hinting at a possible upward reversal.
Traders often use fractals alongside other indicators to confirm trends or reversals, enhancing decision-making accuracy.
How do these tools work together in this strategy? Let’s consider an example of an uptrend.
When the price breaks above an up fractal, it signals a potential bullish trend. This occurs because the up fractal represents a shift in market behavior, where a temporary high was formed due to selling pressure. If the price revisits this level and breaks through, it suggests the market sentiment has turned bullish.
The breakout must occur above the Alligator’s teeth line to confirm the trend. A breakout below the teeth is considered invalid, and the downtrend might still persist. Conversely, in a downtrend, the same logic applies with down fractals.
In this strategy if the most recent up fractal breakout occurs above the Alligator's teeth and follows the last down fractal breakout below the teeth, the algorithm identifies an uptrend. Long trades can be opened during this phase if a signal aligns. If the price breaks a down fractal below the teeth line during an uptrend, the strategy assumes the uptrend has ended and closes all open long trades.
By combining the EMA as a long-term trend filter with the Alligator and fractals as short-term filters, this approach increases the likelihood of opening profitable trades while staying aligned with market dynamics.
Now let's talk about Acceleration/Deceleration signals. AC indicator is calculated using the Awesome Oscillator, so let's first of all briefly explain what is Awesome Oscillator and how it can be calculated. The Awesome Oscillator (AO), developed by Bill Williams, is a momentum indicator designed to measure market momentum by contrasting recent price movements with a longer-term historical perspective. It helps traders detect potential trend reversals and assess the strength of ongoing trends.
The formula for AO is as follows:
AO = SMA5(Median Price) − SMA34(Median Price)
where:
Median Price = (High + Low) / 2
SMA5 = 5-period Simple Moving Average of the Median Price
SMA 34 = 34-period Simple Moving Average of the Median Price
The Acceleration/Deceleration (AC) Indicator, introduced by Bill Williams, measures the rate of change in market momentum. It highlights shifts in the driving force of price movements and helps traders spot early signs of trend changes. The AC Indicator is particularly useful for identifying whether the current momentum is accelerating or decelerating, which can indicate potential reversals or continuations. For AC calculation we shall use the AO calculated above is the following formula:
AC = AO − SMA5(AO), where SMA5(AO)is the 5-period Simple Moving Average of the Awesome Oscillator
When the AC is above the zero line and rising, it suggests accelerating upward momentum.
When the AC is below the zero line and falling, it indicates accelerating downward momentum.
When the AC is below zero line and rising it suggests the decelerating the downtrend momentum. When AC is above the zero line and falling, it suggests the decelerating the uptrend momentum.
Now we can explain which AC signal types are used in this strategy. The first type of long signal is when AC value is below zero line. In this cases we need to see three rising bars on the histogram in a row after the falling one. The second type of signals occurs above the zero line. There we need only two rising AC bars in a row after the falling one to create the signal. The signal bar is the last green bar in this sequence. The strategy places the buy stop order one tick above the candle's high, which corresponds to the signal bar on AC indicator.
After that we can have the following scenarios:
Price hit the order on the next candle in this case strategy opened long with this price.
Price doesn't hit the order price, the next candle set lower high. If current AC bar is increasing buy stop order changes by the script to the high of this new bar plus one tick. This procedure repeats until price finally hit buy order or current AC bar become decreasing. In the second case buy order cancelled and strategy wait for the next AC signal.
If long trades are initiated, the strategy continues utilizing subsequent signals until the total number of trades reaches a maximum of 5. All open trades are closed when the trend shifts to a downtrend, as determined by the combination of the Alligator and Fractals described earlier.
Why we use AC signals? If currently strategy algorithm considers the high probability of the short-term uptrend with the Alligator and Fractals combination pointed out above and the long-term trend is also suggested by the EMA filter as bullish. Rising AC bars after period of falling AC bars indicates the high probability of local pull back end and there is a high chance to open long trade in the direction of the most likely main uptrend. The numbers of rising bars are different for the different AC values (below or above zero line). This is needed because if AC below zero line the local downtrend is likely to be stronger and needs more rising bars to confirm that it has been changed than if AC is above zero.
Why strategy use only 10% per signal? Sometimes we can see the false signals which appears on sideways. Not risking that much script use only 10% per signal. If the first long trade has been open and price continue going up and our trend approximation by Alligator and Fractals is uptrend, strategy add another one 10% of capital to every next AC signal while number of active trades no more than 5. This capital allocation allows to take part in long trades when current uptrend is likely to be strong and use only 10% of capital when there is a high probability of sideways.
Backtest Results
Operating window: Date range of backtests is 2023.01.01 - 2024.11.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 10%
Maximum Single Position Loss: -5.15%
Maximum Single Profit: +24.57%
Net Profit: +2108.85 USDT (+21.09%)
Total Trades: 111 (36.94% win rate)
Profit Factor: 2.391
Maximum Accumulated Loss: 367.61 USDT (-2.97%)
Average Profit per Trade: 19.00 USDT (+1.78%)
Average Trade Duration: 75 hours
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 3h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
Intraday Trend CandlesThe Intraday Trend Candles (ITC) indicator is a Pine Script-based tool designed for traders seeking to visualize market trends effectively. Using a combination of the Look Back Period, a multiplier for true range, and linearly weighted moving averages (LWMA), this indicator calculates dynamic trend limits that adapt to price movements. It identifies key trend shifts by comparing the current price to these dynamic thresholds, resulting in a visually intuitive display of market bias directly on the chart. The indicator is particularly well-suited for intraday trading, as it provides responsive insights tailored to short-term price action.
The ITC plots color-coded candles, highlighting bullish trends in blue and bearish trends in yellow, with gray indicating indecision or trend continuation. This color-coded approach makes it easy to identify reversals and trend dynamics at a glance. Additionally, a trend line is plotted to enhance clarity, signaling whether the price is favoring the upper or lower threshold of the calculated range. With built-in alerts for trend reversals, traders can stay informed about critical market shifts without constantly monitoring the chart. This combination of visual cues and alerts makes the ITC a versatile and powerful tool for traders focusing on momentum and trend-following strategies.
Risk Reward CalculatorThis indicator provides a powerful and flexible tool to calculate and visualize key risk and reward metrics for your trading strategies. By inputting essential parameters like account size, risk tolerance, entry price, and stop loss, you can gain valuable insights into potential profit and loss scenarios.
Key Features:
Risk and Reward Analysis: Accurately calculates risk and reward ratios, helping you assess the potential payoff of each trade.
Position Sizing: Determines optimal position sizes based on your risk tolerance and account size.
Stop-Loss and Take-Profit Levels: Calculates dynamic stop-loss and take-profit levels based on risk-reward ratios.
Selling into Strength: Provides guidance on selling portions of your position at favorable price levels to secure profits and reduce risk.
Customizable Table: A highly customizable table displays all relevant information in a clear and concise format.
Inputs:
Trade Settings: Allows choosing between long, short, or both positions.
Account Size: Sets the total capital available for trading.
Risk Percentage: Defines the percentage of the account risked per trade.
Risk Amount: Calculates the actual risk amount based on account size and risk percentage.
Entry Price: Sets the entry price for the trade.
Actual Units: Defines the actual number of units purchased or sold.
Stop Loss at Actual Price (Exit): Calculates stop loss based on entry price and risk amount.
Parts: Sets the number of parts to split the position for selling into strength.
Selling into Strength: Calculates the quantity per part for selling.
Table Position: Defines the location of the table displaying calculations.
Size: Sets the size of the text in the table.
R Multiple Value: Defines the risk-reward multiple used for calculations.
No. of R Multiples: Sets the number of R multiples to show in the table.
How to Use:
Input Parameters: Enter your account size, risk tolerance, entry price, and other relevant information.
Analyze Metrics: Review the calculated risk, reward, position size, and stop-loss levels.
Make Informed Decisions: Use the insights gained to make informed decisions about your trades.
Benefits:
Improved Risk Management: By understanding your risk exposure, you can make more prudent trading decisions.
Enhanced Profit Potential: By identifying optimal entry and exit points, you can maximize your potential profits.
Increased Trading Confidence: The clear and concise presentation of information empowers you to trade with greater confidence.
Elevate your trading strategy with the Risk Reward Calculator.