Forecasting
GOLD Volume-Based Entry StrategyShort Description:
This script identifies potential long entries by detecting two consecutive bars with above-average volume and bullish price action. When these conditions are met, a trade is entered, and an optional profit target is set based on user input. This strategy can help highlight momentum-driven breakouts or trend continuations triggered by a surge in buying volume.
How It Works
Volume Moving Average
A simple moving average of volume (vol_ma) is calculated over a user-defined period (default: 20 bars). This helps us distinguish when volume is above or below recent averages.
Consecutive Green Volume Bars
First bar: Must be bullish (close > open) and have volume above the volume MA.
Second bar: Must also be bullish, with volume above the volume MA and higher than the first bar’s volume.
When these two bars appear in sequence, we interpret it as strong buying pressure that could drive price higher.
Entry & Profit Target
Upon detecting these two consecutive bullish bars, the script places a long entry.
A profit target is set at current price plus a user-defined fixed amount (default: 5 USD).
You can adjust this target, or you can add a stop-loss in the script to manage risk further.
Visual Cues
Buy Signal Marker appears on the chart when the second bar confirms the signal.
Green Volume Columns highlight the bars that fulfill the criteria, providing a quick visual confirmation of high-volume bullish bars.
Works fine on 1M-2M-5M-15M-30M. Do not use it on higher TF. Due the lack of historical data on lower TF, the backtest result is limited.
RSI Buy/Sell SignalBuy sell base on RSI 4
Buy when RSI close above 68
Sell when RSI of candle close below 32
Apply for XAUUSD
Dynamic Trendline (NEW)This indicator marks the last high and lows, easier for verification of trend.
Live Forex Calendar by NachodogAdded alerts that fire before and after new events from Forex Factory.
Based on the original news alert code from toodegrees.
RSI XTR with selective candle color by Edwin KThis tradingView indicator named "RSI XTR with selective candle color", which modifies the candle colors on the chart based on RSI (Relative Strength Index) conditions. Here's how it works:
- rsiPeriod: Defines the RSI calculation period (default = 5).
- rsiOverbought: RSI level considered overbought (default = 70).
- rsiOversold: RSI level considered oversold (default = 30).
- These values can be modified by the user in the settings.
RSI Calculation
- Computes the RSI value using the ta.rsi() function on the closing price (close).
- The RSI is a momentum indicator that measures the magnitude of recent price changes.
Conditions for Candle Coloring
- when the RSI is above the overbought level.
- when the RSI is below the oversold level.
How It Works in Practice
- When the RSI is above 70 (overbought) → Candles turn red.
- When the RSI is below 30 (oversold) → Candles turn green.
- If the RSI is between 30 and 70, the candle keeps its default color.
This helps traders quickly spot potential reversal zones based on RSI momentum.
DCA KuCoin Strategy Backtesting [ScrimpleAI]This script is a backtester for a Dollar Cost Averaging (DCA) strategy on KuCoin, developed for TradingView. It allows users to simulate recurring investments in an asset, test different configurations, and find the best parameters to maximize performance. The script provides a detailed simulation of a DCA strategy, analyzing the impact of different configurations on investments over time. It is designed to be open-source on TradingView, offering a free tool to optimize the use of DCA bots on KuCoin.
Strategy Settings
The script uses an initial capital of 10,000 euros and sets a commission of 0.07 percent per trade. The invested amount is set as a percentage of equity, supporting up to 100 open trades simultaneously. Orders are processed at the close of each candle, and trading is conducted in euros.
Customizable Parameters
The script allows users to choose the investment interval, ranging from a minimum of one hour to a maximum of two weeks. Users can set the amount invested per trade, with a default value of 1,000 USDT and a minimum of 2 USDT. A maximum investment limit can also be defined, preventing further trades once this limit is reached. Additionally, a profit target is available, expressed as a percentage, indicating the profit level at which all positions will be closed.
Backtesting Period Selection
Users can select a specific time range to test the strategy. The bot will execute trades only within this period.
Strategy Logic
The bot makes the first purchase when no trades are open, using the current closing price to calculate the quantity of assets to buy. Subsequent purchases occur at the specified frequency, provided the invested capital does not exceed the set maximum limit. When total equity surpasses the initial value plus the profit target, the bot closes all positions to secure the profit. A check is implemented to prevent errors related to opening and closing trades simultaneously.
Error Management
The script ensures that the selected timeframe is compatible with the chosen investment interval. If the timeframe is too high compared to the investment frequency, an error is triggered. Additionally, if available capital becomes negative, the script stops execution and suggests modifying the test parameters.
EMA & Bollinger BandsThis indicator combines three main functionalities into a single script:
1. Exponential Moving Average (EMA):
- Purpose: Calculates and plots the EMA of a chosen price source.
- Inputs:
- EMA Length: The period for the EMA calculation.
- EMA Source: The price series (such as close) used for the EMA.
- EMA Offset: Allows shifting the EMA line left or right on the chart.
- Output: A blue-colored EMA line plotted on the chart.
2. Smoothing MA on EMA:
- Purpose: Applies a secondary moving average (MA) on the previously calculated EMA. There is also an option to overlay Bollinger Bands on this smoothed MA.
- Inputs:
- Smoothing MA Type: Options include "None", "SMA", "SMA + Bollinger Bands", "EMA", "SMMA (RMA)", "WMA", and "VWMA".
- Selecting "None" disables this feature.
- Choosing "SMA + Bollinger Bands" will additionally plot Bollinger Bands around the smoothed MA.
- Smoothing MA Length: The period used to calculate the smoothing MA.
- BB StdDev for Smoothing MA: The standard deviation multiplier for the Bollinger Bands (applies only when "SMA + Bollinger Bands" is selected).
- Calculation Details:
- The chosen MA type is applied to the EMA value.
- If Bollinger Bands are enabled, the script computes the standard deviation of the EMA over the smoothing period, multiplies it by the specified multiplier, and then plots an upper and lower band around the smoothing MA.
- Output:
- A yellow-colored smoothing MA line.
- Optionally, green-colored upper and lower Bollinger Bands with a filled background if the "SMA + Bollinger Bands" option is selected.
3. Bollinger Bands on Price:
- Purpose: Independently calculates and plots traditional Bollinger Bands based on a moving average of a selected price source.
- Inputs:
- BB Length: The period for calculating the moving average that serves as the basis of the Bollinger Bands.
- BB Basis MA Type: The type of moving average to use (options include SMA, EMA, SMMA (RMA), WMA, and VWMA).
- BB Source: The price series (such as close) used for the Bollinger Bands calculation.
- BB StdDev: The multiplier for the standard deviation used to calculate the upper and lower bands.
- BB Offset: Allows shifting the Bollinger Bands left or right on the chart.
- Calculation Details:
- The script computes a basis line using the selected MA type on the chosen price source.
- The standard deviation of the price over the specified period is then multiplied by the provided multiplier to determine the distance for the upper and lower bands.
- Output:
- A basis line (typically drawn in a blue tone), an upper band (red), and a lower band (teal).
- The area between the upper and lower bands is filled with a semi-transparent blue background for easier visualization.
---
How It Works Together
- Integration:
The script is divided into clearly labeled sections for each functionality. All parts are drawn on the same chart (overlay mode enabled), providing a comprehensive view of market trends.
- Customization:
Users can adjust parameters for the EMA, the smoothing MA (and its optional Bollinger Bands), as well as the traditional Bollinger Bands independently. This allows for flexible customization depending on the trader's strategy or visual preference.
- Utility:
Combining these three analyses into one indicator enables traders to view:
- The immediate trend via the EMA.
- A secondary smoothed trend that might help reduce noise.
- A volatility measure through Bollinger Bands on both the price and the smoothed EMA.
---
This combined indicator is useful for technical analysis by providing both trend-following (EMA and smoothing MA) and volatility indicators (Bollinger Bands) in one streamlined tool.
combine all indicator 5min chrisshow fast slow ema line ,have background color uptrend and downtrend
Dynamic 200 EMA with Trend-Based ColoringDescription:
This script plots the 200-period Exponential Moving Average (EMA) and dynamically changes its color based on the trend direction. The script helps traders quickly identify whether the price is above or below the 200 EMA, which is widely used as a long-term trend indicator.
How It Works:
The script calculates the 200 EMA based on the closing price.
If the price is above the EMA, it suggests a bullish trend, and the EMA line turns green.
If the price is below the EMA, it suggests a bearish trend, and the EMA line turns red.
An optional background color is added to enhance visual clarity, highlighting the current trend direction.
Use Cases:
Trend Confirmation: Helps traders determine if the overall trend is bullish or bearish.
Support and Resistance: The 200 EMA is often used as dynamic support/resistance.
Entry & Exit Signals: Traders can use crossovers with the 200 EMA as potential trade signals.
This script is designed for traders looking for a simple yet effective way to incorporate trend visualization into their charts. It is fully open-source and can be customized to fit individual trading strategies.
Relative Strength Comparison 1//@version=5
indicator("Relative Strength Comparison", overlay=false)
// User Inputs
numSymbol = input.symbol("NSE:TCS", "Numerator Symbol") // Numerator security
denSymbol = input.symbol("NSE:INFY", "Denominator Symbol") // Denominator security
// Fetch security prices
numPrice = request.security(numSymbol, timeframe.period, close)
denPrice = request.security(denSymbol, timeframe.period, close)
// Calculate Relative Strength (RS)
relativeStrength = numPrice / denPrice
// Plot Relative Strength Line
plot(relativeStrength, title="Relative Strength Line", color=color.blue, linewidth=2)
Seasonality Forecast: Predicting Market Trends with HistoricaThis Pine Script indicator analyzes **seasonal price patterns** based on historical data. It calculates **average price movements** over a user-defined lookback period (default: 5 years) and projects them into the future (default: 365 days). The script accounts for **election cycles**, allowing users to filter by election years, pre-election years, or post-election years. It tracks **trading days, weeks, and months**, smoothing the seasonal trend and adjusting for price scale.
MACD + ATR Dynamic Stop-Loss StrategyThis strategy combines momentum (MACD), trend confirmation (EMA), and volatility-based risk management (ATR) for a robust trading approach.
John Bob-Trading-BotDeveloped by Ayebale John Bob with the help of his bestie, this innovative strategy combines advanced Smart Money Concepts with practical risk management tools to help traders identify and capitalize on key market moves.
Key Features:
Smart Money Concepts & Fair Value Gaps (FVG):
The strategy monitors price action for fair value gaps, which are visualized as extremely faint horizontal lines on the chart. These FVGs signal potential areas where institutional traders might have entered or exited positions.
Dynamic Entry Signals:
Buy signals are triggered when the price crosses above the 50-bar lowest low or when a bullish FVG is detected. Conversely, sell signals are generated when the price falls below the 50-bar highest high or a bearish FVG is identified. Each signal is visually marked on the chart with clear buy (green) and sell (red) labels.
Multi-Level Order Execution:
Once an entry signal occurs, the strategy places five separate orders, each with its own take-profit (TP) level. The TP levels are calculated dynamically using the Average True Range (ATR) and a set of predefined multipliers. This allows traders to scale out of positions as the market moves favorably.
Dynamic Risk Management:
A stop-loss is automatically set at a distance determined by the ATR, ensuring that risk is managed in accordance with current market volatility.
Real-Time Trade Information Table:
In the bottom-right corner of the chart, a trade information table displays essential details about the current trade:
Side: Displays "BUY NOW" (with a dark green background) for long entries or "SELL NOW" (with a dark red background) for short entries.
Entry Price & Stop-Loss: Shows the entry price (highlighted in green) and the corresponding stop-loss level (highlighted in red).
Take-Profit Levels: Lists the five TP levels, each of which turns green once the market price reaches that target.
Timer: A live timer in minutes counts from the moment the current trade trigger started, helping traders track the duration of their active trades.
Visual Progress Bar:
A histogram-style progress bar is plotted on the chart, visually representing the percentage gain (or loss) relative to the entry price.
This strategy was meticulously designed to incorporate both technical analysis and smart risk management, offering a robust trading solution that adapts to changing market conditions. Whether you're a seasoned trader or just starting out, the AyebaleJohnBob Trading Bot equips you with the tools and visual cues needed to make well-informed trading decisions. Enjoy a seamless blend of strategy and style—crafted with passion by Ayebale John Bob and his bestie!
MACD Indicator with Buy and Sell AlertsIntroduction
The MACD Indicator with Alerts & Manual Thresholds is a powerful and customizable MACD-based trading tool designed for traders who want more control over their buy and sell signals. This script allows users to define their own buy and sell thresholds instead of relying solely on standard MACD crossovers. The built-in alerts help traders stay informed about potential trade opportunities without constantly monitoring charts.
How It Works
This script calculates the Moving Average Convergence Divergence (MACD) using customizable fast and slow moving averages. The MACD histogram is derived from the difference between the MACD line and the signal line:
MACD Line: The difference between a fast-moving average (default 12-period EMA) and a slow-moving average (default 26-period EMA).
Signal Line: A smoothed moving average (default 9-period EMA) of the MACD line.
Histogram: The difference between the MACD line and the signal line.
Instead of using default zero-line crossovers, this script allows traders to set custom buy and sell threshold levels:
A buy signal is generated when the MACD histogram crosses above the user-defined buy threshold.
A sell signal is generated when the MACD histogram crosses below the user-defined sell threshold.
Benefits of This Indicator
Custom Thresholds: Unlike traditional MACD indicators, traders can adjust buy and sell thresholds according to their strategy.
Automated Alerts: Get notified instantly when buy or sell conditions are met.
Flexibility in Calculation: Choose between SMA or EMA for both the MACD and signal line calculations.
Clear Visualization: Histogram bars color-coded for quick analysis.
Risks and Limitations
While the MACD indicator is a widely used tool, traders should be aware of its potential risks:
Lagging Indicator: MACD is a trend-following indicator, meaning it may generate signals with some delay.
False Signals in Ranging Markets: MACD works best in trending markets but can produce misleading signals in sideways conditions.
Threshold Optimization Required: Users need to experiment with different buy/sell thresholds to align with their trading strategy and market conditions.
Improving Accuracy with Additional Indicators
For better accuracy and confirmation, combining this MACD strategy with other indicators is recommended:
1. EMA 200 as a Trend Filter
Use the 200-period EMA to determine the overall trend direction.
Consider buying only when price is above EMA 200 (uptrend) and selling only when price is below EMA 200 (downtrend).
2. RSI (Relative Strength Index) for Overbought/Oversold Conditions
RSI (14) can help filter false MACD signals.
A MACD buy signal is stronger when RSI is below 30 (oversold condition).
A MACD sell signal is more reliable when RSI is above 70 (overbought condition).
3. Support & Resistance Levels
Consider placing trades near major support or resistance zones to avoid chasing breakouts.
MACD signals are more effective when they align with these key price levels.
Conclusion
The MACD Indicator with Alerts & Manual Thresholds offers a flexible and powerful approach to trading by allowing users to define their own thresholds. However, for best results, it should be combined with additional indicators such as EMA 200, RSI, and support/resistance levels. Traders should backtest and optimize settings to suit their market conditions and trading style.
By using this indicator alongside proper risk management techniques, traders can enhance their decision-making process and improve their overall trading performance.
Happy Trading!
First 9:15-9:20 Candle Levels (Daily)This indicator captures the closing price of the first 5-minute candle (9:15 - 9:20 AM) every trading day. It then calculates 0.09% above and below this closing price and plots horizontal lines. The indicator resets daily at 9:15 AM, ensuring it always tracks the latest market open. After 9:20 AM, the calculated levels remain visible throughout the day. The upper level is displayed in green, while the lower level is in red. This tool helps traders identify key price levels early in the session, useful for setting stop-losses, take-profit zones, or identifying potential breakout points.
Machine Learning SupertrendThe Machine Learning Supertrend is an advanced trend-following indicator that enhances the traditional Supertrend with Gaussian Process Regression (GPR) and kernel-based learning. Unlike conventional methods that rely purely on historical ATR values, this indicator integrates machine learning techniques to dynamically estimate volatility and forecast future price movements, resulting in a more adaptive and robust trend detection system.
At the core of this indicator lies Gaussian Process Regression (GPR), which utilizes a Radial Basis Function (RBF) kernel to model price distributions and anticipate future trends. Instead of simply looking at past price action, it constructs a kernel matrix, enabling a probabilistic approach to price forecasting. This allows the indicator to not only detect current trends but also project potential trend reversals with greater accuracy.
By applying machine learning to ATR estimation, the ML Supertrend dynamically adjusts its thresholds based on predicted values rather than a fixed multiplier. This makes the trend signals more responsive to market conditions, reducing false signals and minimizing whipsaws often seen with traditional Supertrend indicators. The upper and lower bands are no longer static but evolve based on the underlying price structure, improving the reliability of trend shifts.
When the price crosses these adaptive levels, the indicator detects a trend change and plots it accordingly. Green signifies a bullish trend, while red indicates a bearish one. Alerts can also be triggered when the trend shifts, allowing traders to react quickly to potential reversals.
What makes this approach powerful is its ability to adapt to different market conditions. Traditional ATR-based methods use fixed parameters that might not always be optimal, whereas this ML-driven Supertrend continuously refines its estimations based on real-time data. The result is a more intelligent, less lagging, and highly adaptive trend-following tool.
This indicator is particularly useful for traders looking to enhance trend-following strategies with AI-driven insights. It reduces noise, improves signal reliability, and even offers a degree of trend forecasting, making it ideal for those who want a more advanced and dynamic alternative to standard Supertrend indicators.
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, and past performance is not indicative of future results. Trading involves risk, and users should conduct their own research and use proper risk management before making investment decisions.
Ultimate Stochastics Strategy by NHBprod Use to Day Trade BTCHey All!
Here's a new script I worked on that's super simple but at the same time useful. Check out the backtest results. The backtest results include slippage and fees/commission, and is still quite profitable. Obviously the profitability magnitude depends on how much capital you begin with, and how much the user utilizes per order, but in any event it seems to be profitable according to backtests.
This is different because it allows you full functionality over the stochastics calculations which is designed for random datasets. This script allows you to:
Designate ANY period of time to analyze and study
Choose between Long trading, short trading, and Long & Short trading
It allows you to enter trades based on the stochastics calculations
It allows you to EXIT trades using the stochastics calculations or take profit, or stop loss, Or any combination of those, which is nice because then the user can see how one variable effects the overall performance.
As for the actual stochastics formula, you get control, and get to SEE the plot lines for slow K, slow D, and fast K, which is usually not considered.
You also get the chance to modify the smoothing method, which has not been done with regular stochastics indicators. You get to choose the standard simple moving average (SMA) method, but I also allow you to choose other MA's such as the HMA and WMA.
Lastly, the user gets the option of using a custom trade extender, which essentially allows a buy or sell signal to exist for X amount of candles after the initial signal. For example, you can use "max bars since signal" to 1, and this will allow the indicator to produce an extra sequential buy signal when a buy signal is generated. This can be useful because it is possible that you use a small take profit (TP) and quickly exit a profitable trade. With the max bars since signal variable, you're able to reenter on the next candle and allow for another opportunity.
Let me know if you have any questions! Please take a look at the performance report and let me know your thoughts! :)
Gold Pro StrategyHere’s the strategy description in a chat format:
---
**Gold (XAU/USD) Trend-Following Strategy**
This **trend-following strategy** is designed for trading gold (XAU/USD) by combining moving averages, MACD momentum indicators, and RSI filters to capture sustained trends while managing volatility risks. The strategy uses volatility-adjusted stops to protect gains and prevent overexposure during erratic price movements. The aim is to take advantage of trending markets by confirming momentum and ensuring entries are not made at extreme levels.
---
**Key Components**
1. **Trend Identification**
- **50 vs 200 EMA Crossover**
- **Bullish Trend:** 50 EMA crosses above 200 EMA, and the price closes above the 200 EMA
- **Bearish Trend:** 50 EMA crosses below 200 EMA, and the price closes below the 200 EMA
2. **Momentum Confirmation**
- **MACD (12,26,9)**
- **Buy Signal:** MACD line crosses above the signal line
- **Sell Signal:** MACD line crosses below the signal line
- **RSI (14 Period)**
- **Bullish Zone:** RSI between 50-70 to avoid overbought conditions
- **Bearish Zone:** RSI between 30-50 to avoid oversold conditions
3. **Entry Criteria**
- **Long Entry:** Bullish trend, MACD bullish crossover, and RSI between 50-70
- **Short Entry:** Bearish trend, MACD bearish crossover, and RSI between 30-50
4. **Exit & Risk Management**
- **ATR Trailing Stops (14 Period):**
- Initial Stop: 3x ATR from entry price
- Trailing Stop: Adjusts to lock in profits as price moves favorably
- **Position Sizing:** 100% of equity per trade (high-risk strategy)
---
**Key Logic Flow**
1. **Trend Filter:** Use the 50/200 EMA relationship to define the market's direction
2. **Momentum Confirmation:** Confirm trend momentum with MACD crossovers
3. **RSI Validation:** Ensure RSI is within non-extreme ranges before entering trades
4. **Volatility-Based Risk Management:** Use ATR stops to manage market volatility
---
**Visual Cues**
- **Blue Line:** 50 EMA
- **Red Line:** 200 EMA
- **Green Triangles:** Long entry signals
- **Red Triangles:** Short entry signals
---
**Strengths**
- **Clear Trend Focus:** Avoids counter-trend trades
- **RSI Filter:** Prevents entering overbought or oversold conditions
- **ATR Stops:** Adapts to gold’s inherent volatility
- **Simple Rules:** Easy to follow with minimal inputs
---
**Weaknesses & Risks**
- **Infrequent Signals:** 50/200 EMA crossovers are rare
- **Potential Missed Opportunities:** Strict RSI criteria may miss some valid trends
- **Aggressive Position Sizing:** 100% equity allocation can lead to large drawdowns
- **No Profit Targets:** Relies on trailing stops rather than defined exit targets
---
**Performance Profile**
| Metric | Expected Range |
|----------------------|---------------------|
| Annual Trades | 4-8 |
| Win Rate | 55-65% |
| Max Drawdown | 25-35% |
| Profit Factor | 1.8-2.5 |
---
**Optimization Recommendations**
1. **Increase Trade Frequency**
Adjust the EMAs to shorter periods:
- `emaFastLen = input.int(30, "Fast EMA")`
- `emaSlowLen = input.int(150, "Slow EMA")`
2. **Relax RSI Filters**
Adjust the RSI range to:
- `rsiBullish = rsi > 45 and rsi < 75`
- `rsiBearish = rsi < 55 and rsi > 25`
3. **Add Profit Targets**
Introduce a profit target at 1.5% above entry:
```pine
strategy.exit("Long Exit", "Long",
stop=longStopPrice,
profit=close*1.015, // 1.5% target
trail_offset=trailOffset)
```
4. **Reduce Position Sizing**
Risk a smaller percentage per trade:
- `default_qty_value=25`
---
**Best Use Case**
This strategy excels in **strong trending markets** such as gold rallies during economic or geopolitical crises. However, during sideways or choppy market conditions, the strategy might require manual intervention to avoid false signals. Additionally, integrating fundamental analysis—like monitoring USD weakness or geopolitical risks—can enhance its effectiveness.
---
This strategy offers a balanced approach for trading gold, combining trend-following principles with risk management tailored to the volatility of the market.
THE EDGE FXThis indicator is designed to enhance chart organization for traders by providing essential tools for analysis and time management. Key features include:
1. Notes and Watermarks:
- Allows traders to add customizable notes and watermarks directly on the chart for better information tracking and organization.
2. Unique Day and Week Separation:
- Dynamically separates days and weeks based on the selected UTC timezone. This feature is ideal for global traders managing different time zones and ensures accurate time segmentation on the chart.
3. Fractal Marking:
- Automatically highlights fractal points on the chart, helping traders identify potential reversal or continuation zones based on classic fractal analysis principles.
How It Works:
- The indicator overlays additional visual elements on the chart without altering the underlying data.
- Time segmentation is achieved using an algorithm that adapts to the selected UTC timezone for clear and accurate visualization.
- Fractal detection follows standard technical analysis rules to identify key price levels.
Usage Instructions:
- Add the indicator to your chart and configure the settings for your preferred timezone.
- Use the notes feature to save and display critical information directly on the chart.
- Utilize fractal markings to analyze potential turning points and market trends.
This indicator provides a streamlined way to manage your chart annotations and fractal analysis, making it an essential tool for both intraday and swing traders.
Lorentzian Volatility Filtered SignalsThis indicator uses Lorentzian classification and volume to print accurate buy and sell signals with a stop loss and take profit.
SASDv2rSensitive Altcoin Season Detector V2
This Pine Script™ code, titled "SASDv2r" (Sensitive Altcoin Season Detector version 2 revised), is designed for cryptocurrency trading analysis on the TradingView platform and tailored for those interested in tracking when altcoins might be outperforming Bitcoin, potentially indicating a market shift towards altcoins.
Feel free to use and modify. If you made it better, please let me know. Intention was to help the community with a tool for retail traders have no access to advanced, MV indicators. Solution uses classic TA only.
Use it witl TOTAL3/BTC indicator.
Please check: it gave signal just before last alt season % rose more than 250%.
Market Cap Data Fetching: The script fetches market capitalization data for Bitcoin, Ethereum, and all other altcoins (excluding Bitcoin and Ethereum) using request.security function.
Altcoin to Bitcoin Ratio: It calculates the ratio of total market cap of altcoins to Bitcoin's market cap (altToBtcRatio), which is central to identifying an "altcoin season."
Moving Averages: Several moving averages are computed for different time frames (50-day SMA, 200-day SMA, 20-day SMA, and 10-day EMA) to analyze trends in the altcoin to Bitcoin ratio.
Momentum Indicators: The script uses RSI (Relative Strength Index) and MACD (Moving Average Convergence Divergence) to gauge momentum and potential reversal points in the market.
Custom Indicators: It includes Volume Weighted Moving Average (VWMA) and a custom momentum indicator (altMomentum and altMomentumAvg) to provide additional insights into market movements.
Volatility Measurement: Bollinger Bands are calculated to assess volatility in the altcoin to Bitcoin ratio, which helps identify periods of high or low market activity.
Visual Analysis: Various plots are added to the chart for visual interpretation, including the altcoin to Bitcoin ratio, different moving averages, and Bollinger Bands.
Alt Season Detection: The script defines conditions for detecting when an "altcoin season" might be starting, based on crossovers of moving averages, RSI levels, MACD signals, and other custom criteria.
Performance Tracking: After signaling an alt season, the script evaluates the performance over the next 30 days by checking if there's been an increase in the altcoin to Bitcoin ratio, adding labels for positive or negative trends.(this one is in progress). Logic still gives false signals and aim is to identify failed signals.
Visual Signals: Labels are placed on the chart to visually indicate the beginning of a potential alt season or the performance outcome after a signal, aiding traders in making informed decisions.