Lorentzian Volatility Filtered SignalsThis indicator uses Lorentzian classification and volume to print accurate buy and sell signals with a stop loss and take profit.
Statistics
Binance Pseudo Funding FeeThe indicator calculates the Funding Fee for Binance based on the Premium Index provided by TradingView. The calculation formula can be found here: Binance Funding Rate Introduction . This is NOT the official rate visible on binance.com and used for settlements, but rather an estimated rate, which is inherently INACCURATE . The accuracy of the calculation heavily depends on the timeframe, with almost perfect results on minute-based timeframes.
For the most accurate calculations, you need to visit Binance Funding History and fill in the corresponding Interval , Interest Rate , and Funding Cap/Floor settings for the specific symbol in the indicator's settings. I understand this is not convenient, but for now, this is how it works.
The blue bars indicate the settlement time. Funding can be smoothed using moving averages. Both the funding rate and the moving averages are displayed using plot and are labeled, so you can set alerts on them.
Multi-indicator Signal Builder [Skyrexio]Overview
Multi-Indicator Signal Builder is a versatile, all-in-one script designed to streamline your trading workflow by combining multiple popular technical indicators under a single roof. It features a single-entry, single-exit logic, intrabar stop-loss/take-profit handling, an optional time filter, a visually accessible condition table, and a built-in statistics label. Traders can choose any combination of 12+ indicators (RSI, Ultimate Oscillator, Bollinger %B, Moving Averages, ADX, Stochastic, MACD, PSAR, MFI, CCI, Heikin Ashi, and a “TV Screener” placeholder) to form entry or exit conditions. This script aims to simplify strategy creation and analysis, making it a powerful toolkit for technical traders.
Indicators Overview
1. RSI (Relative Strength Index)
Measures recent price changes to evaluate overbought or oversold conditions on a 0–100 scale.
2. Ultimate Oscillator (UO)
Uses weighted averages of three different timeframes, aiming to confirm price momentum while avoiding false divergences.
3. Bollinger %B
Expresses price relative to Bollinger Bands, indicating whether price is near the upper band (overbought) or lower band (oversold).
4. Moving Average (MA)
Smooths price data over a specified period. The script supports both SMA and EMA to help identify trend direction and potential crossovers.
5. ADX (Average Directional Index)
Gauges the strength of a trend (0–100). Higher ADX signals stronger momentum, while lower ADX indicates a weaker trend.
6. Stochastic
Compares a closing price to a price range over a given period to identify momentum shifts and potential reversals.
7. MACD (Moving Average Convergence/Divergence)
Tracks the difference between two EMAs plus a signal line, commonly used to spot momentum flips through crossovers.
8. PSAR (Parabolic SAR)
Plots a trailing stop-and-reverse dot that moves with the trend. Often used to signal potential reversals when price crosses PSAR.
9. MFI (Money Flow Index)
Similar to RSI but incorporates volume data. A reading above 80 can suggest overbought conditions, while below 20 may indicate oversold.
10. CCI (Commodity Channel Index)
Identifies cyclical trends or overbought/oversold levels by comparing current price to an average price over a set timeframe.
11. Heikin Ashi
A type of candlestick charting that filters out market noise. The script uses a streak-based approach (multiple consecutive bullish or bearish bars) to gauge mini-trends.
12. TV Screener
A placeholder condition designed to integrate external buy/sell logic (like a TradingView “Buy” or “Sell” rating). Users can override or reference external signals if desired.
Unique Features
1. Multi-Indicator Entry and Exit
You can selectively enable any subset of 12+ classic indicators, each with customizable parameters and conditions. A position opens only if all enabled entry conditions are met, and it closes only when all enabled exit conditions are satisfied, helping reduce false triggers.
2. Single-Entry / Single-Exit with Intrabar SL/TP
The script supports a single position at a time. Once a position is open, it monitors intrabar to see if the price hits your stop-loss or take-profit levels before the bar closes, making results more realistic for fast-moving markets.
3. Time Window Filter
Users may specify a start/end date range during which trades are allowed, making it convenient to focus on specific market cycles for backtesting or live trading.
4. Condition Table and Statistics
A table at the bottom of the chart lists all active entry/exit indicators. Upon each closed trade, an integrated statistics label displays net profit, total trades, win/loss count, average and median PnL, etc.
5. Seamless Alerts and Automation
Configure alerts in TradingView using “Any alert() function call.”
The script sends JSON alert messages you can route to your own webhook.
The indicator can be integrated with Skyrexio alert bots to automate execution on major cryptocurrency exchanges
6. Optional MA/PSAR Plots
For added visual clarity, optionally plot the chosen moving averages or PSAR on the chart to confirm signals without stacking multiple indicators.
Methodology
1. Multi-Indicator Entry Logic
When multiple entry indicators are enabled (e.g., RSI + Stochastic + MACD), the script requires all signals to align before generating an entry. Each indicator can be set for crossovers, crossunders, thresholds (above/below), etc. This “AND” logic aims to filter out low-confidence triggers.
2. Single-Entry Intrabar SL/TP
One Position At a Time: Once an entry signal triggers, a trade opens at the bar’s close.
Intrabar Checks: Stop-loss and take-profit levels (if enabled) are monitored on every tick. If either is reached, the position closes immediately, without waiting for the bar to end.
3. Exit Logic
All Conditions Must Agree: If the trade is still open (SL/TP not triggered), then all enabled exit indicators must confirm a closure before the script exits on the bar’s close.
4. Time Filter
Optional Trading Window: You can activate a date/time range to constrain entries and exits strictly to that interval.
Justification of Methodology
Indicator Confluence: Combining multiple tools (RSI, MACD, etc.) can reduce noise and false signals.
Intrabar SL/TP: Capturing real-time spikes or dips provides a more precise reflection of typical live trading scenarios.
Single-Entry Model: Straightforward for both manual and automated tracking (especially important in bridging to bots).
Custom Date Range: Helps refine backtesting for specific market conditions or to avoid known irregular data periods.
How to Use
1. Add the Script to Your Chart
In TradingView, open Indicators , search for “Multi-indicator Signal Builder”.
Click to add it to your chart.
2. Configure Inputs
Time Filter: Set a start and end date for trades.
Alerts Messages: Input any JSON or text payload needed by your external service or bot.
Entry Conditions: Enable and configure any indicators (e.g., RSI, MACD) for a confluence-based entry.
Close Conditions: Enable exit indicators, along with optional SL (negative %) and TP (positive %) levels.
3. Set Up Alerts
In TradingView, select “Create Alert” → Condition = “Any alert() function call” → choose this script.
Entry Alert: Triggers on the script’s entry signal.
Close Alert: Triggers on the script’s close signal (or if SL/TP is hit).
Skyrexio Alert Bots: You can route these alerts via webhook to Skyrexio alert bots to automate order execution on major crypto exchanges (or any other supported broker).
4. Visual Reference
A condition table at the bottom summarizes active signals.
Statistics Label updates automatically as trades are closed, showing PnL stats and distribution metrics.
Backtesting Guidelines
Symbol/Timeframe: Works on multiple assets and timeframes; always do thorough testing.
Realistic Costs: Adjust commissions and potential slippage to match typical exchange conditions.
Risk Management: If using the built-in stop-loss/take-profit, set percentages that reflect your personal risk tolerance.
Longer Test Horizons: Verify performance across diverse market cycles to gauge reliability.
Example of statistic calculation
Test Period: 2023-01-01 to 2025-12-31
Initial Capital: $1,000
Commission: 0.1%, Slippage ~5 ticks
Trade Count: 468 (varies by strategy conditions)
Win rate: 76% (varies by strategy conditions)
Net Profit: +96.17% (varies by strategy conditions)
Disclaimer
This indicator is provided strictly for informational and educational purposes .
It does not constitute financial or trading advice.
Past performance never guarantees future results.
Always test thoroughly in demo environments before using real capital.
Enjoy exploring the Multi-Indicator Signal Builder! Experiment with different indicator combinations and adjust parameters to align with your trading preferences, whether you trade manually or link your alerts to external automation services. Happy trading and stay safe!
Volatilidad Realizada AnualizadaEste script en Pine Script v5 calcula y grafica la volatilidad realizada anualizada basada en los retornos logarítmicos. Permite personalizar los colores y elegir los períodos de cálculo, brindando flexibilidad para analizar diferentes marcos temporales.
🔹 Características:
✅ Cálculo de volatilidad realizada anualizada a partir de la desviación estándar de los retornos logarítmicos.
✅ Tres ventanas configurables para la volatilidad: 10, 20 y 40 sesiones (modificables en inputs).
✅ Personalización de colores para cada línea de volatilidad.
✅ Anualización automática multiplicando por la raíz de 252.
✅ Opción de fondo personalizado para resaltar zonas de alta volatilidad.
European/US Opening RangeCaractéristiques principales :
Détection précise des plages horaires en UTC
Calcul dynamique des plus hauts/bas pendant les 15 minutes d'ouverture
Trace des lignes horizontales persistantes
Gestion mémoire optimisée avec suppression des anciennes lignes
Adapté à tous les instruments et timeframes
Les lignes bleues représentent le range européen (09:00-09:15 UTC) et les rouges le range américain (14:30-14:45 UTC). Les niveaux se mettent à jour chaque jour et restent visibles jusqu'à la session suivante.
Statistical Arbitrage Pairs Trading - Long-Side OnlyThis strategy implements a simplified statistical arbitrage (" stat arb ") approach focused on mean reversion between two correlated instruments. It identifies opportunities where the spread between their normalized price series (Z-scores) deviates significantly from historical norms, then executes long-only trades anticipating reversion to the mean.
Key Mechanics:
1. Spread Calculation: The strategy computes Z-scores for both instruments to normalize price movements, then tracks the spread between these Z-scores.
2. Modified Z-Score: Uses a robust measure combining the median and Median Absolute Deviation (MAD) to reduce outlier sensitivity.
3. Entry Signal: A long position is triggered when the spread’s modified Z-score falls below a user-defined threshold (e.g., -1.0), indicating extreme undervaluation of the main instrument relative to its pair.
4. Exit Signal: The position closes automatically when the spread reverts to its historical mean (Z-score ≥ 0).
Risk management:
Trades are sized as a percentage of equity (default: 10%).
Includes commissions and slippage for realistic backtesting.
BRAINZ STRATEGYbest strategy ever best strategy ever best strategy ever best strategy ever best strategy ever best strategy ever best strategy ever best strategy ever best strategy ever
KalmanfilterLibrary "Kalmanfilter"
A sophisticated Kalman Filter implementation for financial time series analysis
@author Rocky-Studio
@version 1.0
initialize(initial_value, process_noise, measurement_noise)
Initializes Kalman Filter parameters
Parameters:
initial_value (float) : (float) The initial state estimate
process_noise (float) : (float) The process noise coefficient (Q)
measurement_noise (float) : (float) The measurement noise coefficient (R)
Returns: A tuple containing
update(prev_state, prev_covariance, measurement, process_noise, measurement_noise)
Update Kalman Filter state
Parameters:
prev_state (float)
prev_covariance (float)
measurement (float)
process_noise (float)
measurement_noise (float)
calculate_measurement_noise(price_series, length)
Adaptive measurement noise calculation
Parameters:
price_series (array)
length (int)
calculate_measurement_noise_simple(price_series)
Parameters:
price_series (array)
update_trading(prev_state, prev_velocity, prev_covariance, measurement, volatility_window)
Enhanced trading update with velocity
Parameters:
prev_state (float)
prev_velocity (float)
prev_covariance (float)
measurement (float)
volatility_window (int)
model4_update(prev_mean, prev_speed, prev_covariance, price, process_noise, measurement_noise)
Kalman Filter Model 4 implementation (Benhamou 2018)
Parameters:
prev_mean (float)
prev_speed (float)
prev_covariance (array)
price (float)
process_noise (array)
measurement_noise (float)
model4_initialize(initial_price)
Initialize Model 4 parameters
Parameters:
initial_price (float)
model4_default_process_noise()
Create default process noise matrix for Model 4
model4_calculate_measurement_noise(price_series, length)
Adaptive measurement noise calculation for Model 4
Parameters:
price_series (array)
length (int)
MA Win RateMoving Average Cross Win Rate
This simple yet useful script calculates the percentage of times a moving average crossover successfully predicts price movement.
Win Conditions:
1] A Golden Cross (fast MA crossing above slow MA) where the price moves up afterward.
2] A Death Cross (fast MA crossing below slow MA) where the price moves down afterward.
In this script, I have used a Simple Moving Average (SMA) for illustration.
You can modify the code to apply any type of moving average and test its accuracy.
Autocorrelation Price Forecasting Backtesting [ScrimpleAI]This script presents an innovative trading backtesting strategy designed to leverage autocorrelation models and linear regression on historical price returns . The goal is to forecast future price movements, identify recurring market cycles, and optimize trading decisions.
Main Functionality
This backtesting script is built to simulate trades by integrating historical autocorrelation with dynamic price forecasting . It incorporates risk management, stop-loss features, and an advanced backtesting date range, providing traders with maximum flexibility for evaluating strategies.
Key Features
1. Customizable Date Range for Backtesting
Allows users to define the exact date period for backtesting their strategies, ensuring they can fine-tune results for specific historical scenarios.
- Inputs: Start and End dates (day, month, year).
2. Autocorrelation Price Forecasting
- Detects cycles in market movements using the `ta.correlation` function.
- Highlights significant cycles when the autocorrelation exceeds a threshold value (default: 0.50).
- Stores projected values based on autocorrelation and linear regression of percentage returns for enhanced forecasting accuracy.
3. Forecast Threshold and Profit Assessment
- Evaluates hypothetical gains by comparing forecasted future prices to the current price.
- Customizable threshold gains to determine minimum profitability requirements for opening trades.
4. Strategy Side
- Long or Short Mode: Users can choose to test either long or short strategies to align with their trading approach.
5. Risk and Trade Management
- Order Sizing: Adjust position size as a percentage of the portfolio.
- Stop-Loss Integration: Dynamically calculates stop-loss based on user-defined percentages.
- Take Profit Target: Automatically sets take-profit levels based on forecasted gains.
6. Visual Alerts
- Provides clear visual signals of long and short entries on the chart, including labels and dynamic coloring.
- Forecasted prices are displayed directly on the chart as a continuous line, enhancing decision-making clarity.
Practical Applications
1. Cycle Detection: Utilize autocorrelation to identify repetitive market behaviors and cycles.
2. Forecasting for Backtesting: Simulate trades and assess the profitability of various strategies based on future price predictions.
3. Risk Management: Test different stop-loss and take-profit configurations.
4. Custom Period Analysis: Evaluate strategy performance in specific historical market conditions using the date range filter.
Core Logic Walkthrough
1. Autocorrelation for Cycle Detection:
- Historical prices are analyzed for recurring patterns using the `ta.correlation` function.
- If a significant cycle is detected (above the `signal_threshold`), the `linreg_values` (linear regression of returns) are stored for price projection.
2. Future Price Estimation: Forecasted price is calculated based on linear regression values and current price movements.
3. Trade Entry Logic
Long Trades
- Triggered if the hypothetical gain exceeds the threshold gain.
- Sets a take-profit level based on the projected future price.
- Includes an optional stop-loss based on user-defined percentages.
Short Trades
- Triggered if the hypothetical gain is less than the negative of the threshold gain.
- Configures take-profit and stop-loss levels for bearish trades.
4. Risk Management
- Position Sizing: Automatically calculates the order size as a percentage of the portfolio.
- Stop-Loss: Dynamically adjusts stop-loss levels to minimize risk.
5. Date Range Filtering: Ensures trades are executed only within the defined backtesting period.
Example Use Case: Backtesting with Autocorrelation
- A trader analyzes a 6-month period using 50 historical bars for autocorrelation.
- Sets a threshold gain of 10% and enables a stop-loss at 5%.
- Evaluates the effectiveness of a long-only strategy in this period to assess its profitability and risk-adjusted performance.
If you find this strategy useful or have ideas for improvements, leave a comment! What new features would you like to see in this strategy?
Percent Change HistogramThis indicator shows you percent changes in a super visual way using a color-coded histogram.
Here's how the colors work:
🟩 Dark green = percent change is growing stronger
🟢 Light green = still positive but losing steam
🟥 Dark red = getting more negative
🔴 Light red = negative but improving
The cool part? You can set any lookback period you want. For example:
24 periods on 1H chart = last 24 hours
30 periods on daily = last month
7 periods on daily = last week
Pro tip: You're not locked to your chart's timeframe! Want to see monthly changes while trading on 5min?
No problem.
You can even stack multiple indicators to watch different intervals simultaneously (daily, weekly, monthly) - super helpful for multi-timeframe analysis.
Perfect for spotting momentum shifts across different timeframes without switching between charts.
Entradas Scalping IEGCalcula las entradas y coloca las linea de entrada, profit y stop, calculando tambien las monedas a comprar configurando los parametros requeridos
Bank Nifty Buy/Sell Strategyits a low risk strategy where it shows when to buy for scalping a quick 50 to 100 points
Custom MAFACustom indicator of fang stocks to track other similar ETF's and see fi there are any arbitrage opportunities.
Enhanced Candle Statistics This custom Pine Script indicator calculates and displays key percentiles and averages for both the body and combined wick size of candles, helping traders judge market dynamics in real time.
Optimized Trading Day Probability - Start of DayDaily chart
chance of red/green close based on historical data
Auto-Adjusting Kalman Filter by TenozenNew year, new indicator! Auto-Adjusting Kalman Filter is an indicator designed to provide an adaptive approach to trend analysis. Using the Kalman Filter (a recursive algorithm used in signal processing), this algo dynamically adjusts to market conditions, offering traders a reliable way to identify trends and manage risk! In other words, it's a remaster of my previous indicator, Kalman Filter by Tenozen.
What's the difference with the previous indicator (Kalman Filter by Tenozen)?
The indicator adjusts its parameters (Q and R) in real-time using the Average True Range (ATR) as a measure of market volatility. This ensures the filter remains responsive during high-volatility periods and smooth during low-volatility conditions, optimizing its performance across different market environments.
The filter resets on a user-defined timeframe, aligning its calculations with dominant trends and reducing sensitivity to short-term noise. This helps maintain consistency with the broader market structure.
A confidence metric, derived from the deviation of price from the Kalman filter line (measured in ATR multiples), is visualized as a heatmap:
Green : Bullish confidence (higher values indicate stronger trends).
Red : Bearish confidence (higher values indicate stronger trends).
Gray : Neutral zone (low confidence, suggesting caution).
This provides a clear, objective measure of trend strength.
How it works?
The Kalman Filter estimates the "true" price by filtering out market noise. It operates in two steps, that is, prediction and update. Prediction is about projection the current state (price) forward. Update is about adjusting the prediction based on the latest price data. The filter's parameters (Q and R) are scaled using normalized ATR, ensuring adaptibility to changing market conditions. So it means that, Q (Process Noise) increases during high volatility, making the filter more responsive to price changes and R (Measurement Noise) increases during low volatility, smoothing out the filter to avoid overreacting to minor fluctuations. Also, the trend confidence is calculated based on the deviation of price from the Kalman filter line, measured in ATR multiples, this provides a quantifiable measure of trend strength, helping traders assess market conditions objectively.
How to use?
Use the Kalman Filter line to identify the prevailing trend direction. Trade in alignment with the filter's slope for higher-probability setups.
Look for pullbacks toward the Kalman Filter line during strong trends (high confidence zones)
Utilize the dynamic stop-loss and take-profit levels to manage risk and lock in profits
Confidence Heatmap provides an objective measure of market sentiment, helping traders avoid low-confidence (neutral) zones and focus on high-probability opportunities
Guess that's it! I hope this indicator helps! Let me know if you guys got some feedback! Ciao!
Dynamic Price Change Percentage TrackerSet price in plugin's configuration and watch the percentage change between the configured price and the current ticker's price.
Moon Phases by Shailesh DesaiTrading Strategy Based on Lunar Phases
This custom trading indicator leverages the power of lunar cycles to provide unique market insights based on the four primary moon phases: New Moon, First Quarter, Full Moon, and Third Quarter. By aligning your trades with the natural rhythm of the moon, this strategy offers a different perspective to trading and can help enhance decision-making based on the cyclical nature of the market.
Key Features:
1. Moon Phase Identification:
o The indicator automatically identifies the current moon phase based on the user's selected timeframe and marks it on the chart.
o Each phase is visualized with a specific symbol and color to help traders easily recognize the current moon phase:
New Moon/Waxing Moon: Represented by a circle (colored as per user input).
First Quarter: Represented by a cross (colored as per user input).
Full Moon/Waning Moon: Represented by a circle (colored as per user input).
Third Quarter: Represented by a cross (colored as per user input).
2. Automatic Moon Phase Transition Detection:
o The indicator tracks and highlights when a phase change occurs. This feature ensures you are always aware of when the market moves from one phase to another.
o Moon phase changes are only visualized on the first bar of each new phase to avoid cluttering the chart.
3. Background Color Indicators:
o The background color dynamically changes according to the current moon phase, helping to reinforce the phase context for the trader. This feature makes it easy to see at a glance which phase the market is in.
4. Customizable Appearance:
o Customize the color of each moon phase to suit your preferences. Adjust the colors for the New Moon, First Quarter, Full Moon, and Third Quarter to align with your visual strategy.
5. Avoids Unsupported Timeframes:
o This indicator does not support monthly timeframes, ensuring that it operates smoothly only on timeframes that are compatible with the lunar cycle.
How to Use:
• The moon phases are thought to have an influence on human behavior and the market's psychology, making this indicator useful for traders who wish to integrate lunar cycles into their strategy.
• Traders can use the phase changes as an indicator of potential market momentum or reversal points. For example:
o New Moon may indicate the beginning of a new cycle, signaling a potential upward or downward move.
o Full Moon might suggest a peak or significant shift in market direction.
o First Quarter and Third Quarter phases may represent moments of consolidation or decision points.
Ideal for:
• Traders interested in cycle-based strategies or looking to experiment with new approaches.
• Those who believe in the influence of natural forces, including moon phases, on market movements.
• Technical analysts who want to add another layer of insights to their chart analysis.
Important Notes:
• The indicator uses precise astronomical calculations to identify the correct phase, ensuring accuracy.
• It’s important to understand that moon phase-based trading is not a standalone strategy but should ideally be combined with other technical analysis tools for maximum effectiveness.
Volatility & Big Market MovesThis indicator shows the volatility per candle, and highlights candles where volatility exceeds a defined threshold.
Data shown:
Furthest %-distance from the previous candle's closing price to the top (positive histogram).
Furthest %-distance from the previous candle's closing price to the bottom (negative histogram).
Autocorrelation Price Forecasting [ScrimpleAI]Discover how to predict future price movements using autocorrelation and linear regression models to identify potential trading opportunities.
An advanced model to predict future price movements using autocorrelation and linear regression. This script helps identify recurring market cycles and calculates potential gains, with clear visual signals for quick and informed decisions.
Main Function
This script leverages an autocorrelation model to estimate the future price of an asset based on historical price relationships. It also integrates linear regression on percentage returns to provide more accurate predictions of price movements.
Key Features
1. Customizable Inputs:
- Analysis Length: number of historical bars used for autocorrelation calculation. Adjustable between 1 and 200.
- Forecast Colors: customize colors for bullish and bearish signals.
2. Price Autocorrelation: uses the ta.correlation function to measure price autocorrelation, detecting significant cycles when the value exceeds a defined threshold ( signal_threshold = 0.50 ).
3. Linear Regression on Returns: calculates percentage returns and applies linear regression to identify the future projected price value.
4. Hypothetical Gain Assessment: evaluates potential profit by comparing the estimated future price with the current price.
5. Visual Alerts:
- Labels: hypothetical gains or losses are displayed as labels above or below the bars.
- Dynamic Coloring: bullish (green) and bearish (red) signals are highlighted directly on the chart.
- Forecast Line: A continuous line is plotted to represent the estimated future price values.
Practical Applications
Short-term Trading : identify repetitive market cycles to anticipate future movements.
Visual Decision-making : colored signals and labels make it easier to visualize potential profit or loss for each trade.
Advanced Customization : adjust the data length and colors to tailor the indicator to your strategies.
💡 What do you think about this model?
If you already use autocorrelation-based analysis or want to try predictive strategies, leave a comment with your feedback!
Asset Rotation System [InvestorUnknown]Overview
This system creates a comprehensive trend "matrix" by analyzing the performance of six assets against both the US Dollar and each other. The objective is to identify and hold the asset that is currently outperforming all others, thereby focusing on maintaining an investment in the most "optimal" asset at any given time.
- - - Key Features - - -
1. Trend Classification:
The system evaluates the trend for each of the six assets, both individually against USD and in pairs (assetX/assetY), to determine which asset is currently outperforming others.
Utilizes five distinct trend indicators: RSI (50 crossover), CCI, SuperTrend, DMI, and Parabolic SAR.
Users can customize the trend analysis by selecting all indicators or choosing a single one via the "Trend Classification Method" input setting.
2. Backtesting:
Calculates an equity curve for each asset and for the system itself, which assumes holding only the asset deemed optimal at any time.
Customizable start date for backtesting; by default, it begins either 5000 bars ago (the maximum in TradingView) or at the inception of the youngest asset included, whichever is shorter. If the youngest asset's history exceeds 5000 bars, the system uses 5000 bars to prevent errors.
The equity curve is dynamically colored based on the asset held at each point, with this coloring also reflected on the chart via barcolor().
Performance metrics like returns, standard deviation of returns, Sharpe, Sortino, and Omega ratios, along with maximum drawdown, are computed for each asset and the system's equity curve.
3 Alerts:
Supports alerts for when a new, confirmed optimal asset is identified. However, due to TradingView limitations, the specific asset cannot be included in the alert message.
- - - Usage - - -
1. Select Assets/Tickers:
Choose which assets or tickers you want to include in the rotation system. Ensure that all selected tickers are denominated in USD to maintain consistency in analysis.
2. Configure Trend Classification:
Decide on the trend classification method from the available options (RSI, CCI, SuperTrend, DMI, or Parabolic SAR, All) and adjust the settings to your preferences. This customization allows you to tailor the system to different market conditions or your specific trading strategy.
3. Utilize Backtesting for Calibration:
Use the backtesting results, including equity curves and performance metrics, to fine-tune your chosen trend indicators.
Be cautious not to overemphasize performance maximization, as this can lead to overfitting. The goal is to achieve a robust system that performs well across various market conditions, rather than just optimizing for past data.
- - - Parameters - - -
Tickers:
Asset 1: Select the symbol for the first asset.
Asset 2: Select the symbol for the second asset.
Asset 3: Select the symbol for the third asset.
Asset 4: Select the symbol for the fourth asset.
Asset 5: Select the symbol for the fifth asset.
Asset 6: Select the symbol for the sixth asset.
General Settings:
Trend Classification Method: Choose from RSI, CCI, SuperTrend, DMI, PSAR, or "All" to determine how trends are analyzed.
Use Custom Starting Date for Backtest: Toggle to use a custom date for beginning the backtest.
Custom Starting Date: Set the custom start date for backtesting.
Plot Perf. Metrics Table: Option to display performance metrics in a table on the chart.
RSI (Relative Strength Index):
RSI Source: Choose the price data source for RSI calculation.
RSI Length: Set the period for the RSI calculation.
CCI (Commodity Channel Index):
CCI Source: Select the price data source for CCI calculation.
CCI Length: Determine the period for the CCI.
SuperTrend:
SuperTrend Factor: Adjust the sensitivity of the SuperTrend indicator.
SuperTrend Length: Set the period for the SuperTrend calculation.
DMI (Directional Movement Index):
DMI Length: Define the period for DMI calculations.
Parabolic SAR:
PSAR Start: Initial acceleration factor for the Parabolic SAR.
PSAR Increment: Increment value for the acceleration factor.
PSAR Max Value: Maximum value the acceleration factor can reach.
Notes/Recommendations:
While this system is operational, it's important to recognize that it relies on "basic" indicators, which may not be ideal for generating trading signals on their own. I strongly suggest that users delve into the code to grasp the underlying logic of the system. Consider customizing it by integrating more sophisticated and higher-quality trend-following indicators to enhance its performance and reliability.
Disclaimer:
This system's backtest results are historical and do not predict future performance. Use for educational purposes only; not investment advice.
[COG] Advanced School Run StrategyAdvanced School Run Strategy (ASRS) – Explanation
Overview: The Advanced School Run Strategy (ASRS) is an intraday trading approach designed to identify breakout opportunities based on specific time and price patterns. This script applies the concepts of the Advanced School Run Strategy as outlined in Tom Hougaard's research, adapted to work seamlessly on TradingView charts. It leverages 5-minute candlestick data to set actionable breakout levels and provides traders with visual cues and alerts to make informed decisions.
Features:
Dynamic Breakout Levels: Automatically calculates high and low levels based on the market's behavior during the initial trading minutes.
Custom Visualization: Highlights breakout zones with customizable colors and transparency, providing clear visual feedback for bullish and bearish breakouts.
Configurable Alerts: Includes alert conditions for both bullish and bearish breakouts, ensuring traders never miss a trading opportunity.
Reset Logic: Resets breakout levels daily at the market open to ensure accurate signal generation for each session.
How It Works:
The script identifies key levels (high and low) after a configurable number of minutes from the market open (default: 25 minutes).
If the price breaks above the high level or below the low level, a corresponding breakout is detected.
The script draws breakout zones on the chart and triggers alerts based on the breakout direction.
All levels and signals reset at the start of each new trading session, maintaining relevance to current market conditions.
Customization Options:
Line and box colors for bullish and bearish breakouts.
Transparency levels for breakout visualizations.
Alert settings to receive notifications for detected breakouts.
Acknowledgment: This script is inspired by Tom Hougaard's Advanced School Run Strategy. The methodology has been translated into Pine Script for TradingView users, adhering to TradingView’s policies and community guidelines. This script does not redistribute proprietary content from the original research but implements the principles for educational and analytical purposes.