Super Smart Trend SystemHow the System Works
The Super Smart Trend System combines 6 technical indicators (SuperTrend, Hull MA, ADX, VWAP, RSI, and WaveTrend) into an intelligent voting mechanism. The system calculates a voting percentage from these indicators to determine the prevailing trend direction. It uses ATR (Average True Range) to dynamically set stop-loss and profit targets, while providing early signals for trend reversals through RSI divergence and WaveTrend pattern analysis.
Using the Market Status Dashboard
Market Status: Displayed at the top of the dashboard with star rating (⭐⭐⭐) and percentage showing signal strength. Look for STRONG BUY or STRONG SELL signals with multiple stars.
Recommendation: Follow the displayed recommendation (Full Position Entry, 75% Position Entry, Wait) to determine your action. This tells you exactly what position size to use based on signal strength.
Risk/Reward Ratio: Ensure the ratio is greater than 1:2 for good trades, and greater than 1:3 for excellent trades. This shows the potential profit compared to your risk.
Suggested Stop & Target Levels: Use these pre-calculated values to set your stop-loss and take-profit orders. These are based on recent price action and ATR volatility.
Primary Trend: Ensure your trades align with the primary market trend for best results. Trading with the trend increases probability of success.
For optimal results, only enter trades when you see a strong signal (⭐⭐⭐) with a good risk/reward ratio, and follow the provided recommendations regarding position size, stop-loss, and profit target levels. The dashboard removes guesswork and emotions by providing clear, objective trading decisions.
Indicatori e strategie
2:45 AM Candle High/Low Crossing Bars2:45 AM Candle High/Low Crossing Bars is an indicator that focuses on the trading view 2:45am NY TIME high and low indicating green for buy and red bars for sell, with the 2:45am new york time highlight/ If the next candle sweeps the low we buy while if it sweeps the high we sell, all time zoon must be the new York UTC time.
Supertrend + MACD CrossoverKey Elements of the Template:
Supertrend Settings:
supertrendFactor: Adjustable to control the sensitivity of the Supertrend.
supertrendATRLength: ATR length used for Supertrend calculation.
MACD Settings:
macdFastLength, macdSlowLength, macdSignalSmoothing: These settings allow you to fine-tune the MACD for better results.
Risk Management:
Stop-Loss: The stop-loss is based on the ATR (Average True Range), a volatility-based indicator.
Take-Profit: The take-profit is based on the risk-reward ratio (set to 3x by default).
Both stop-loss and take-profit are dynamic, based on ATR, which adjusts according to market volatility.
Buy and Sell Signals:
Buy Signal: Supertrend is bullish, and MACD line crosses above the Signal line.
Sell Signal: Supertrend is bearish, and MACD line crosses below the Signal line.
Visual Elements:
The Supertrend line is plotted in green (bullish) and red (bearish).
Buy and Sell signals are shown with green and red triangles on the chart.
Next Steps for Optimization:
Backtesting:
Run backtests on BTC in the 5-minute timeframe and adjust parameters (Supertrend factor, MACD settings, risk-reward ratio) to find the optimal configuration for the 60% win ratio.
Fine-Tuning Parameters:
Adjust supertrendFactor and macdFastLength to find more optimal values based on BTC's market behavior.
Tweak the risk-reward ratio to maximize profitability while maintaining a good win ratio.
Evaluate Market Conditions:
The performance of the strategy can vary based on market volatility. It may be helpful to evaluate performance in different market conditions or pair it with a filter like RSI or volume.
Let me know if you'd like further tweaks or explanations!
Box Chart Overlay StrategyExploring the Box Chart Overlay Strategy with RSI & Bollinger Confirmation
The “Box Chart Overlay Strategy by BD” is a sophisticated TradingView strategy script written in Pine Script (version 5). It combines a box charting method with two widely used technical indicators—Relative Strength Index (RSI) and Bollinger Bands—to generate trade entries. In this article, we break down the strategy’s components, its logic, and how it visually represents trading signals on the chart.
1. Strategy Setup and User Inputs
Strategy Declaration
At the top of the script, the strategy is declared with key parameters:
Overlay: The indicator is plotted directly on the price chart.
Initial Capital & Position Sizing: It uses a simulated trading account with an initial capital of 10,000 and positions sized as a percentage of equity (10% by default).
Commission: A commission of 0.1% is factored into trades.
Input Parameters
The strategy is highly customizable. Users can adjust various inputs such as:
Box Settings:
Box Size (RSboxSize): Defines the size of each price “box.”
Box Options: Choose from three modes:
Standard: Boxes are calculated continuously from the start of the chart.
Anchored: The first box is fixed at a specified time and price.
Daily Reset: The boxes reset each day based on a defined session time.
Color Customizations:
Options to customize the appearance of boxes, borders, labels, and even repainting the candles based on the current price’s relation to box levels.
RSI Settings:
Length, overbought, and oversold levels are set to filter trades.
Bollinger Bands Settings:
Users can set the length of the moving average and the multiplier for standard deviation, which will be used to compute the upper and lower bands.
2. The Box Chart Mechanism
Box Construction
The core idea of a box chart is to group price movement into discrete blocks—or boxes—of a fixed size. In this strategy:
Standard Mode:
The script calculates boxes starting at a rounded price level. When the price moves sufficiently above or below the current box’s boundaries, a new box is drawn.
Anchored and Daily Reset Modes:
These modes allow traders to control where the box calculations begin or to reset them during a specific intraday session.
Visual Elements
Several custom functions handle the visual components:
drawBoxUp() and drawBoxDn():
These functions create boxes in bullish or bearish directions respectively, based on whether the price has exceeded the current box’s high or low.
drawLines() and drawLabels():
Lines are drawn to extend the current box levels, and labels are updated to display key levels or the “remainder” (the difference needed to trigger a new box).
Projected Boxes:
A “projected” box is drawn to indicate potential upcoming box levels, providing an additional visual cue about the price action.
3. Integrating RSI and Bollinger Bands for Trade Confirmation
RSI Integration
The strategy computes the RSI using a user-defined length. It then uses the following conditions to validate entries:
Long Trades (Box Up):
The strategy waits for the RSI to be at or below the oversold level before considering a long entry.
Short Trades (Box Down):
It requires the RSI to be at or above the overbought level before triggering a short entry.
Bollinger Bands Confirmation
In addition to the RSI filter:
For Long Entries:
The price must be at or below the lower Bollinger Band.
For Short Entries:
The price must be at or above the upper Bollinger Band.
By combining these filters with the box breakout logic, the strategy aims to enhance the quality of its trade signals.
4. Dynamic Trade Entries and Alerts
Box Logic and Entry Functions
Two key functions—BoxUpFunc() and BoxDownFunc()—handle the creation of new boxes and also check if trade conditions are met:
When a new box is drawn, the script evaluates if the RSI and Bollinger conditions align.
If conditions are satisfied, the script places an entry order:
Long Entry: Initiated when the price moves upward, RSI indicates oversold, and the price touches or falls below the lower Bollinger Band.
Short Entry: Triggered when the price falls downward, RSI signals overbought, and the price touches or exceeds the upper Bollinger Band.
Alerts
Built-in alert functions notify traders when a new box level is reached. Users can set custom alert messages to ensure they are aware of potential trade opportunities as soon as the conditions are met.
5. Visual Enhancements and Candle Repainting
The script also includes options for repainting candles based on their relation to the current box’s boundaries:
Above, Below, or Within the Box:
Candles are color-coded using user-defined colors, making it easier to visually assess where the price is in relation to the box levels.
Labels and Lines:
These continuously update to reflect current levels and provide an immediate visual reference for potential breakout points.
Conclusion
The Box Chart Overlay Strategy by BD is a multi-faceted approach that marries the traditional box chart technique with modern technical indicators—RSI and Bollinger Bands—to refine entry signals. By offering various customization options for box creation, visual styling, and confirmation criteria, the strategy allows traders to adapt it to different market conditions and personal trading styles. Whether you prefer a continuously running “Standard” mode or a more controlled “Anchored” or “Daily Reset” approach, this strategy provides a robust framework for integrating price action with momentum and volatility measures.
Triangular Hull Moving Average [BigBeluga X PineIndicators]This strategy is based on the original Triangular Hull Moving Average (THMA) + Volatility indicator by BigBeluga. Full credit for the concept and design goes to BigBeluga.
The strategy blends smoothed trend-following logic using a Triangular Hull Moving Average with dynamic volatility overlays, providing actionable trade signals with responsive visual feedback. It's designed for traders who want a non-lagging trend filter while also monitoring market volatility in real time.
How the Strategy Works
1. Triangular Hull Moving Average (THMA) Core
At its core, the strategy uses a Triangular Hull Moving Average (THMA) — a variation of the traditional Hull Moving Average with triple-smoothing logic:
It combines multiple weighted moving averages (WMAs) to create a faster and smoother trend line.
This reduces lag without compromising trend accuracy.
The THMA reacts more responsively to price movements than classic MAs.
THMA Formula:
thma(_src, _length) =>
ta.wma(ta.wma(_src,_length / 3) * 3 - ta.wma(_src, _length / 2) - ta.wma(_src, _length), _length)
This logic filters out short-term noise while still being sensitive to genuine trend shifts.
2. Volatility-Enhanced Candle Plotting
An optional volatility mode overlays the chart with custom candles that incorporate volatility bands:
Wicks expand and contract dynamically based on market volatility.
The volatility value is computed using a HMA of high-low range over a user-defined length.
The candle bodies reflect THMA values, while the wicks reflect the current volatility spread.
This feature allows traders to visually gauge the strength of price moves and anticipate possible breakouts or slowdowns.
3. Trend Reversal Signal Detection
The strategy identifies trend reversals when the THMA line crosses over/under its own past value:
A bullish signal is triggered when THMA crosses above its value from two bars ago.
A bearish signal is triggered when THMA crosses below its value from two bars ago.
These shifts are marked on the chart with triangle-shaped signals for clear visibility.
This logic helps detect momentum shifts early and enables reactive trade entries.
Trade Entry & Exit Logic
Trade Modes Supported
Users can choose between:
Only Long – Enters long trades only.
Only Short – Enters short trades only.
Long & Short – Enables both directions.
Entry Conditions
Long Entry:
Triggered when a bullish crossover is detected.
Active only if the strategy mode allows long trades.
Short Entry:
Triggered when a bearish crossover is detected.
Active only if the strategy mode allows short trades.
Exit Conditions
In Only Long mode, the strategy closes long positions when a bearish signal appears.
In Only Short mode, the strategy closes short positions when a bullish signal appears.
In Long & Short mode, the strategy does not auto-close positions — instead, it opens new positions on each confirmed signal.
Dashboard Visualization
In the bottom-right corner of the chart, a live dashboard displays:
The current trend direction (🢁 for bullish, 🢃 for bearish).
The current volatility level as a percentage.
This helps traders quickly assess market status and adjust their decisions accordingly.
Customization Options
THMA Length: Adjust how smooth or reactive the trend detection should be.
Volatility Toggle & Length: Enable or disable volatility visualization and set sensitivity.
Color Settings: Choose colors for up/down trend visualization.
Trade Direction Mode: Limit the strategy to long, short, or both types of trades.
Use Cases & Strategy Strengths
1. Trend Following
Use the THMA-based candles and triangle signals to enter with momentum. The indicator adapts quickly, reducing lag and improving trade timing.
2. Volatility Monitoring
Visualize the strength of the trend with volatility wicks. Use expanding bands to confirm breakouts and contracting ones to detect weakening moves.
3. Signal Confirmation
Combine this tool with other indicators or use the trend shift triangles as confirmations for manual entries.
Conclusion
The THMA + Volatility Strategy is a non-repainting trend-following system that integrates:
Triangular Hull MA for advanced trend detection.
Real-time volatility visualization.
Clear entry signals based on trend reversals.
Configurable trade direction settings.
It is ideal for traders who:
Prefer smoothed price analysis.
Want to follow trends with precision.
Value visual volatility feedback for breakout detection.
Full credit for the original concept and indicator goes to BigBeluga.
Buy on 5% dip strategy with time adjustment
This script is a strategy called "Buy on 5% Dip Strategy with Time Adjustment 📉💡," which detects a 5% drop in price and triggers a buy signal 🔔. It also automatically closes the position once the set profit target is reached 💰, and it has additional logic to close the position if the loss exceeds 14% after holding for 230 days ⏳.
Strategy Explanation
Buy Condition: A buy signal is triggered when the price drops 5% from the highest price reached 🔻.
Take Profit: The position is closed when the price hits a 1.22x target from the average entry price 📈.
Forced Sell Condition: If the position is held for more than 230 days and the loss exceeds 14%, the position is automatically closed 🚫.
Leverage & Capital Allocation: Leverage is adjustable ⚖️, and you can set the percentage of capital allocated to each trade 💸.
Time Limits: The strategy allows you to set a start and end time ⏰ for trading, making the strategy active only within that specific period.
Code Credits and References
Credits: This script utilizes ideas and code from @QuantNomad and jangdokang for the profit table and algorithm concepts 🔧.
Sources:
Monthly Performance Table Script by QuantNomad:
ZenAndTheArtOfTrading's Script:
Strategy Performance
This strategy provides risk management through take profit and forced sell conditions and includes a performance table 📊 to track monthly and yearly results. You can compare backtest results with real-time performance to evaluate the strategy's effectiveness.
The performance numbers shown in the backtest reflect what would have happened if you had used this strategy since the launch date of the SOXL (the Direxion Daily Semiconductor Bull 3x Shares ETF) 📅. These results are not hypothetical but based on actual performance from the day of the ETF’s launch 📈.
Caution ⚠️
No Guarantee of Future Results: The results are based on historical performance from the launch of the SOXL ETF, but past performance does not guarantee future results. It’s important to approach with caution when applying it to live trading 🔍.
Risk Management: Leverage and capital allocation settings are crucial for managing risk ⚠️. Make sure to adjust these according to your risk tolerance ⚖️.
Litecoin Trailing-Stop StrategyAltcoins Trailing-Stop Strategy
This strategy is based on a momentum breakout approach using PKAMA (Powered Kaufman Adaptive Moving Average) as a trend filter, and a delayed trailing stop mechanism to manage risk effectively.
It has been designed and fine-tuned Altcoins, which historically shows consistent volatility patterns and clean trend structures, especially on intraday timeframes like 15m and 30m.
Strategy Logic:
Entry Conditions:
Long when PKAMA indicates an upward move
Short when PKAMA detects a downward trend
Minimum spacing of 30 bars between trades to avoid overtrading
Trailing Stop:
Activated only after a customizable delay (delayBars)
User can set trailing stop % and delay independently
Helps avoid premature exits due to short-term volatility
Customizable Parameters:
This strategy uses a custom implementation of PKAMA (Powered Kaufman Adaptive Moving Average), inspired by the work of alexgrover
PKAMA is a volatility-aware moving average that adjusts dynamically to market conditions, making it ideal for altcoins where trend strength and direction change frequently.
This script is for educational and experimental purposes only. It is not financial advice. Please test thoroughly before using it in live conditions, and always adapt parameters to your specific asset and time frame.
Feedback is welcome! Feel free to clone and adapt it for your own trading style.
Cycle Biologique Strategy // (\_/)
// ( •.•)
// (")_(")
//@fr33domz
Experimental Research: Cycle Biologique Strategy
Overview
The "Cycle Biologique Strategy" is an experimental trading algorithm designed to leverage periodic cycles in price movements by utilizing a sinusoidal function. This strategy aims to identify potential buy and sell signals based on the behavior of a custom-defined biological cycle.
Key Parameters
Cycle Length: This parameter defines the duration of the cycle, set by default to 30 periods. The user can adjust this value to optimize the strategy for different asset classes or market conditions.
Amplitude: The amplitude of the cycle influences the scale of the sinusoidal wave, allowing for customization in the sensitivity of buy and sell signals.
Offset: The offset parameter introduces phase shifts to the cycle, adjustable within a range of -360 to 360 degrees. This flexibility allows the strategy to align with various market rhythms.
Methodology
The core of the strategy lies in the calculation of a periodic cycle using a sinusoidal function.
Trading Signals
Buy Signal: A buy signal is generated when the cycle value crosses above zero, indicating a potential upward momentum.
Sell Signal: Conversely, a sell signal is triggered when the cycle value crosses below zero, suggesting a potential downtrend.
Execution
The strategy executes trades based on these signals:
Upon receiving a buy signal, the algorithm enters a long position.
When a sell signal occurs, the strategy closes the long position.
Visualization
To enhance user experience, the periodic cycle is plotted visually on the chart in blue, allowing traders to observe the cyclical nature of the strategy and its alignment with market movements.
Multi-EMA Crossover StrategyMulti-EMA Crossover Strategy
This strategy uses multiple exponential moving average (EMA) crossovers to identify bullish trends and execute long trades. The approach involves progressively stronger signals as different EMA pairs cross, indicating increasing bullish momentum. Each crossover triggers a long entry, and the intensity of bullish sentiment is reflected in the color of the bars on the chart. Conversely, bearish trends are represented by red bars.
Strategy Logic:
First Long Entry: When the 1-day EMA crosses above the 5-day EMA, it signals initial bullish momentum.
Second Long Entry: When the 3-day EMA crosses above the 10-day EMA, it confirms stronger bullish sentiment.
Third Long Entry: When the 5-day EMA crosses above the 20-day EMA, it indicates further trend strength.
Fourth Long Entry: When the 10-day EMA crosses above the 40-day EMA, it suggests robust long-term bullish momentum.
The bar colors reflect these conditions:
More blue bars indicate stronger bullish sentiment as more short-term EMAs are above their longer-term counterparts.
Red bars represent bearish conditions when short-term EMAs are below longer-term ones.
Example: Bitcoin Trading on a Daily Timeframe
Bullish Scenario:
Imagine Bitcoin is trading at $30,000 on March 31, 2025:
First Signal: The 1-day EMA crosses above the 5-day EMA at $30,000. This suggests initial upward momentum, prompting a small long entry.
Second Signal: A few days later, the 3-day EMA crosses above the 10-day EMA at $31,000. This confirms strengthening bullish sentiment; another long position is added.
Third Signal: The 5-day EMA crosses above the 20-day EMA at $32,500, indicating further upward trend development; a third long entry is executed.
Fourth Signal: Finally, the 10-day EMA crosses above the 40-day EMA at $34,000. This signals robust long-term bullish momentum; a fourth long position is entered.
Bearish Scenario:
Suppose Bitcoin reverses from $34,000 to $28,000:
The 1-day EMA crosses below the 5-day EMA at $33,500.
The 3-day EMA dips below the 10-day EMA at $32,000.
The 5-day EMA falls below the 20-day EMA at $30,000.
The final bearish signal occurs when the 10-day EMA drops below the 40-day EMA at $28,000.
The bars turn increasingly red as bearish conditions strengthen.
Advantages of This Strategy:
Progressive Confirmation: Multiple crossovers provide layered confirmation of trend strength.
Visual Feedback: Bar colors help traders quickly assess market sentiment and adjust positions accordingly.
Flexibility: Suitable for trending markets like Bitcoin during strong rallies or downturns.
Limitations:
Lagging Signals: EMAs are lagging indicators and may react slowly to sudden price changes.
False Breakouts: Crossovers in choppy markets can lead to whipsaws or false signals.
This strategy works best in trending markets and should be combined with additional risk management techniques, e.g., stop loss or optimal position sizes (Kelly Criterion).
Qullamaggie [Modified] | FractalystWhat's the purpose of this strategy?
The strategy aims to identify high-probability breakout setups in trending markets, inspired by Kristjan "Qullamaggie" Kullamägi’s approach.
It focuses on capturing explosive price moves after periods of consolidation, using technical criteria like moving averages, breakouts, trailing stop-loss and momentum confirmation.
Ideal for swing traders seeking to ride strong trends while managing risk.
----
How does the strategy work?
The strategy follows a systematic process to capture high-momentum breakouts:
Pre-Breakout Criteria:
Prior Price Surge: Identifies stocks that have rallied 30-100%+ in recent month(s), signaling strong underlying momentum (per Qullamaggie’s volatility expansion principles).
Consolidation Phase: Looks for a tightening price range (e.g., flag, pennant, or tight base), indicating a potential "coiling" before continuation.
Trend Confirmation: Uses moving averages (e.g., 20/50/200 EMA) to ensure the stock is trading above key averages on the daily chart, confirming an uptrend.
Price Break: Enters when price clears the consolidation high with conviction.
Risk Management:
Initial Stop Loss: Placed below the consolidation low or a recent swing point to limit downside.
Break-Even Adjustment: Moves stop loss to breakeven once the trade reaches 1.5x risk-to-reward (RR), securing a "free trade" while letting winners run.
Trailing Stop (Unique Edge):
Market Structure Trailing: Instead of trailing via moving averages, the stop is dynamically adjusted using structural invalidation level. This adapts to price action, allowing the trade to stay open during volatile retracements while locking in gains as new structure forms.
Why This Matters: Most strategies use rigid trailing stops (e.g., below the 10EMA), which often exit prematurely in choppy markets. By trailing based on structure, this strategy avoids "noise" and captures larger trends, directly boosting overall returns.
----
What markets or timeframes is this suited for?
This is a long-only strategy designed for trending markets, and it performs best in:
Markets: Stocks (especially high-growth, liquid equities), cryptocurrencies (major pairs with strong volatility), commodities (e.g., oil, gold), and futures (index/commodity futures).
Timeframes: Primarily daily charts for swing trades (1-30 day holds), though weekly charts can help confirm broader trends.
Key Advantage: The TradingView script allows instant backtesting with adjustable parameters
You can:
- Test historical performance across multiple markets to identify which assets align best with the strategy.
- Optimize settings (e.g., trailing stop sensitivity, moving averages etc.) to match a market’s volatility profile.
Build a diversified portfolio by filtering for markets that show consistent profitability in backtests.
For example, you might discover cryptos require tighter trailing stops due to volatility, while stocks thrive with wider structural stops. The script automates this analysis, letting you to trade confidently.
----
What indicators or tools does the strategy use?
The strategy combines customizable technical tools with strict anti-lookahead safeguards:
Core Indicators:
Moving Averages: Adjustable periods (e.g., 20/50/200 EMA or SMA) and timeframes (daily/weekly) to confirm trend alignment. Users can test combinations (e.g., 10EMA vs. 20EMA) to optimize for specific markets.
Breakout Parameters:
Consolidation Length: Adjustable window to define the "tightness" of the pre-breakout pattern.
Entry Models: Flexible entry logics (Breakouts and fractals)
Anti-Lookahead Design:
All calculations (e.g., moving averages, consolidation ranges, volume averages) use only closed/confirmed data available at the time of the signal.
----
How do I manage risk with this strategy?
The strategy prioritizes customizable risk controls to align with your trading style and account size:
User-Defined Risk Inputs:
Risk Per Trade: Set a % of Equity (e.g., 1-2%) to determine position size. The strategy auto-calculates shares/contracts to match your selected risk per trade.
Flexibility: Choose between fixed risk or equity-based scaling.
The script adjusts position sizing dynamically based on your selection.
Pyramiding Feature:
Customizable Entries: Adjust the number of pyramiding trades allowed (e.g., 1-3 additional positions) in the strategy settings. Each new entry is triggered only if the prior trade hits its 1.5x RR target and the trend remains intact.
Risk-Scaled Additions: New positions use profits from prior trades, compounding gains without increasing initial risk.
Risk-Free Trade Mechanic:
Once a trade reaches 1.5x RR, the stop loss is moved to breakeven, eliminating downside risk.
The strategy then opens a new position (if pyramiding is enabled) using a portion of the locked-in profit. This "snowballs" winners while keeping total capital exposure stable.
Impact on Net Profit & Drawdown:
Net Profit Boost: Pyramiding lets you ride multi-leg trends aggressively. For example, a 100% runner could generate 2-3x more profit vs. a single-entry approach.
Controlled Drawdowns: Since new positions are funded by profits (not initial capital), max drawdown stays anchored to your original risk per trade (e.g., 1-2% of account). Even if later entries fail, the breakeven stop on prior trades protects overall equity.
Why This Works: Most strategies either over-leverage (increasing drawdowns) or exit too early. By recycling profits into new positions only after securing risk-free capital, this approach mimics hedge fund "scaling in" tactics while staying retail-trader friendly.
----
How does the strategy identify market structure for its trailing stoploss?
The strategy identifies market structure by utilizing an efficient logic with for loops to pinpoint the first swing candle that features a pivot of 2. This marks the beginning of the break of structure, where the market's previous trend or pattern is considered invalidated or changed.
----
What are the underlying calculations?
The underlying calculations involve:
Identifying Swing Points: The strategy looks for swing highs (marked with blue Xs) and swing lows (marked with red Xs). A swing high is identified when a candle's high is higher than the highs of the candles before and after it. Conversely, a swing low is when a candle's low is lower than the lows of the candles before and after it.
Break of Structure (BOS):
Bullish BOS: This occurs when the price breaks above the swing high level of the previous structure, indicating a potential shift to a bullish trend.
Bearish BOS: This happens when the price breaks below the swing low level of the previous structure, signaling a potential shift to a bearish trend.
Structural Liquidity and Invalidation:
Structural Liquidity: After a break of structure, liquidity levels are updated to the first swing high in a bullish BOS or the first swing low in a bearish BOS.
Structural Invalidation: If the price moves back to the level of the first swing low before the bullish BOS or the first swing high before the bearish BOS, it invalidates the break of structure, suggesting a potential reversal or continuation of the previous trend.
This method provides users with a technical approach to filter market regimes, offering an advantage by minimizing the risk of overfitting to historical data, which is often a concern with traditional indicators like moving averages.
By focusing on identifying pivotal swing points and the subsequent breaks of structure, the strategy maintains a balance between sensitivity to market changes and robustness against historical data anomalies, ensuring a more adaptable and potentially more reliable market analysis tool.
----
What entry criteria are used in this script?
The script uses two entry models for trading decisions: BreakOut and Fractal.
Underlying Calculations:
Breakout: The script records the most recent swing high by storing it in a variable. When the price closes above this recorded level, and all other predefined conditions are satisfied, the script triggers a breakout entry. This approach is considered conservative because it waits for the price to confirm a breakout above the previous high before entering a trade. As shown in the image, as soon as the price closes above the new candle (first tick), the long entry gets taken. The stop-loss is initially set and then moved to break-even once the price moves in favor of the trade.
Fractal: This method involves identifying a swing low with a period of 2, which means it looks for a low point where the price is lower than the two candles before and after it. Once this pattern is detected, the script executes the trade. This is an aggressive approach since it doesn't wait for further price confirmation. In the image, this is represented by the 'Fractal 2' label where the script identifies and acts on the swing low pattern.
----
What type of stop-loss identification method are used in this strategy?
This strategy employs two types of stop-loss methods: Initial Stop-loss and Trailing Stop-Loss.
Underlying Calculations:
Initial Stop-loss:
ATR Based: The strategy uses the Average True Range (ATR) to set an initial stop-loss, which helps in accounting for market volatility without predicting price direction.
Calculation:
- First, the True Range (TR) is calculated for each period, which is the greatest of:
- Current Period High - Current Period Low
- Absolute Value of Current Period High - Previous Period Close
- Absolute Value of Current Period Low - Previous Period Close
- The ATR is then the moving average of these TR values over a specified period, typically 14 periods by default. This ATR value can be used to set the stop-loss at a distance from the entry price that reflects the current market volatility.
Swing Low Based:
For this method, the stop-loss is set based on the most recent swing low identified in the market structure analysis. This approach uses the lowest point of the recent price action as a reference for setting the stop-loss.
Trailing Stop-Loss:
The strategy uses structural liquidity and structural invalidation levels across multiple timeframes to adjust the stop-loss once the trade is profitable. This method involves:
Detecting Structural Liquidity: After a break of structure, the liquidity levels are updated to the first swing high in a bullish scenario or the first swing low in a bearish scenario. These levels serve as potential areas where the price might find support or resistance, allowing the stop-loss to trail the price movement.
Detecting Structural Invalidation: If the price returns to the level of the first swing low before a bullish break of structure or the first swing high before a bearish break of structure, it suggests the trend might be reversing or invalidating, prompting the adjustment of the stop-loss to lock in profits or minimize losses.
By using these methods, the strategy dynamically adjusts the initial stop-loss based on market volatility, helping to protect against adverse price movements while allowing for enough room for trades to develop. The ATR-based stop-loss adapts to the current market conditions by considering the volatility, ensuring that the stop-loss is not too tight during volatile periods, which could lead to premature exits, nor too loose during calm markets, which might result in larger losses. Similarly, the swing low based stop-loss provides a logical exit point if the market structure changes unfavorably.
Each market behaves differently across various timeframes, and it is essential to test different parameters and optimizations to find out which trailing stop-loss method gives you the desired results and performance. This involves backtesting the strategy with different settings for the ATR period, the distance from the swing low, and how the trailing stop-loss reacts to structural liquidity and invalidation levels.
Through this process, you can tailor the strategy to perform optimally in different market environments, ensuring that the stop-loss mechanism supports the trade's longevity while safeguarding against significant drawdowns.
----
What type of break-even method is used in this strategy? What are the underlying calculations?
Moves the initial stop-loss to the entry price when the price reaches a certain RR ratio.
Calculation:
Break-even level = Entry Price + (Initial Risk * RR Ratio)
----
What tables are available in this script?
- Summary: Provides a general overview, displaying key performance parameters such as Net Profit, Profit Factor, Max Drawdown, Average Trade, Closed Trades and more.
Total Commission: Displays the cumulative commissions incurred from all trades executed within the selected backtesting window. This value is derived by summing the commission fees for each trade on your chart.
Average Commission: Represents the average commission per trade, calculated by dividing the Total Commission by the total number of closed trades. This metric is crucial for assessing the impact of trading costs on overall profitability.
Avg Trade: The sum of money gained or lost by the average trade generated by a strategy. Calculated by dividing the Net Profit by the overall number of closed trades. An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.
MaxDD: Displays the largest drawdown of losses, i.e., the maximum possible loss that the strategy could have incurred among all of the trades it has made. This value is calculated separately for every bar that the strategy spends with an open position.
Profit Factor: The amount of money a trading strategy made for every unit of money it lost (in the selected currency). This value is calculated by dividing gross profits by gross losses.
Avg RR: This is calculated by dividing the average winning trade by the average losing trade. This field is not a very meaningful value by itself because it does not take into account the ratio of the number of winning vs losing trades, and strategies can have different approaches to profitability. A strategy may trade at every possibility in order to capture many small profits, yet have an average losing trade greater than the average winning trade. The higher this value is, the better, but it should be considered together with the percentage of winning trades and the net profit.
Winrate: The percentage of winning trades generated by a strategy. Calculated by dividing the number of winning trades by the total number of closed trades generated by a strategy. Percent profitable is not a very reliable measure by itself. A strategy could have many small winning trades, making the percent profitable high with a small average winning trade, or a few big winning trades accounting for a low percent profitable and a big average winning trade. Most mean-reversion successful strategies have a percent profitability of 40-80% but are profitable due to risk management control.
BE Trades: Number of break-even trades, excluding commission/slippage.
Losing Trades: The total number of losing trades generated by the strategy.
Winning Trades: The total number of winning trades generated by the strategy.
Total Trades: Total number of taken traders visible your charts.
Net Profit: The overall profit or loss (in the selected currency) achieved by the trading strategy in the test period. The value is the sum of all values from the Profit column (on the List of Trades tab), taking into account the sign.
- Monthly: Displays performance data on a month-by-month basis, allowing users to analyze performance trends over each month and year.
- Weekly: Displays performance data on a week-by-week basis, helping users to understand weekly performance variations.
- UI Table: A user-friendly table that allows users to view and save the selected strategy parameters from user inputs. This table enables easy access to key settings and configurations, providing a straightforward solution for saving strategy parameters by simply taking a screenshot with Alt + S or ⌥ + S.
User-input styles and customizations:
Please note that all background colors in the style are disabled by default to enhance visualization.
How to Use This Strategy to Create a Profitable Edge and Systems?
Choose Your Strategy mode:
- Decide whether you are creating an investing strategy or a trading strategy.
Select a Market:
- Choose a one-sided market such as stocks, indices, or cryptocurrencies.
Historical Data:
- Ensure the historical data covers at least 10 years of price action for robust backtesting.
Timeframe Selection:
- Choose the timeframe you are comfortable trading with. It is strongly recommended to use a timeframe above 15 minutes to minimize the impact of commissions/slippage on your profits.
Set Commission and Slippage:
- Properly set the commission and slippage in the strategy properties according to your broker/prop firm specifications.
Parameter Optimization:
- Use trial and error to test different parameters until you find the performance results you are looking for in the summary table or, preferably, through deep backtesting using the strategy tester.
Trade Count:
- Ensure the number of trades is 200 or more; the higher, the better for statistical significance.
Positive Average Trade:
- Make sure the average trade is above zero.
(An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.)
Performance Metrics:
- Look for a high profit factor, and net profit with minimum drawdown.
- Ideally, aim for a drawdown under 20-30%, depending on your risk tolerance.
Refinement and Optimization:
- Try out different markets and timeframes.
- Continue working on refining your edge using the available filters and components to further optimize your strategy.
What Makes This Strategy Unique?
This strategy combines flexibility, smart risk management, and momentum focus in a way that’s rare and practical:
1. Adapts to Any Market Rhythm
Works on daily, weekly, or intraday charts without code changes.
Uses two entry types: classic breakouts (like trending stocks) or fractal patterns (to avoid false starts).
2. Smarter Stop-Loss System
No rigid rules: Stops adjust based on price structure (e.g., new “higher lows”), not fixed percentages.
Avoids whipsaws: Tightens stops only when the trend strengthens, not in choppy markets.
3. Safe Profit-Boosting Pyramiding
Adds new positions only after prior trades are risk-free (stops moved above breakeven).
Scales up using locked-in profits, not new capital, to grow gains safely.
4. Built-In Momentum Check
Tracks 1/3/6-month price growth to spotlight stocks with strong, lasting momentum.
Terms and Conditions | Disclaimer
Our charting tools are provided for informational and educational purposes only and should not be construed as financial, investment, or trading advice. They are not intended to forecast market movements or offer specific recommendations. Users should understand that past performance does not guarantee future results and should not base financial decisions solely on historical data.
Built-in components, features, and functionalities of our charting tools are the intellectual property of @Fractalyst Unauthorized use, reproduction, or distribution of these proprietary elements is prohibited.
- By continuing to use our charting tools, the user acknowledges and accepts the Terms and Conditions outlined in this legal disclaimer and agrees to respect our intellectual property rights and comply with all applicable laws and regulations.
02 SMC + BB Breakout (Improved)This strategy combines Smart Money Concepts (SMC) with Bollinger Band breakouts to identify potential trading opportunities. SMC focuses on identifying key price levels and market structure shifts, while Bollinger Bands help pinpoint overbought/oversold conditions and potential breakout points. The strategy also incorporates higher timeframe trend confirmation to filter out trades that go against the prevailing trend.
Key Components:
Bollinger Bands:
Calculated using a Simple Moving Average (SMA) of the closing price and a standard deviation multiplier.
The strategy uses the upper and lower bands to identify potential breakout points.
The SMA (basis) acts as a centerline and potential support/resistance level.
The fill between the upper and lower bands can be toggled by the user.
Higher Timeframe Trend Confirmation:
The strategy allows for optional confirmation of the current trend using a higher timeframe (e.g., daily).
It calculates the SMA of the higher timeframe's closing prices.
A bullish trend is confirmed if the higher timeframe's closing price is above its SMA.
This helps filter out trades that go against the prevailing long-term trend.
Smart Money Concepts (SMC):
Order Blocks:
Simplified as recent price clusters, identified by the highest high and lowest low over a specified lookback period.
These levels are considered potential areas of support or resistance.
Liquidity Zones (Swing Highs/Lows):
Identified by recent swing highs and lows, indicating areas where liquidity may be present.
The Swing highs and lows are calculated based on user defined lookback periods.
Market Structure Shift (MSS):
Identifies potential changes in market structure.
A bullish MSS occurs when the closing price breaks above a previous swing high.
A bearish MSS occurs when the closing price breaks below a previous swing low.
The swing high and low values used for the MSS are calculated based on the user defined swing length.
Entry Conditions:
Long Entry:
The closing price crosses above the upper Bollinger Band.
If higher timeframe confirmation is enabled, the higher timeframe trend must be bullish.
A bullish MSS must have occurred.
Short Entry:
The closing price crosses below the lower Bollinger Band.
If higher timeframe confirmation is enabled, the higher timeframe trend must be bearish.
A bearish MSS must have occurred.
Exit Conditions:
Long Exit:
The closing price crosses below the Bollinger Band basis.
Or the Closing price falls below 99% of the order block low.
Short Exit:
The closing price crosses above the Bollinger Band basis.
Or the closing price rises above 101% of the order block high.
Position Sizing:
The strategy calculates the position size based on a fixed percentage (5%) of the strategy's equity.
This helps manage risk by limiting the potential loss per trade.
Visualizations:
Bollinger Bands (upper, lower, and basis) are plotted on the chart.
SMC elements (order blocks, swing highs/lows) are plotted as lines, with user-adjustable visibility.
Entry and exit signals are plotted as shapes on the chart.
The Bollinger band fill opacity is adjustable by the user.
Trading Logic:
The strategy aims to capitalize on Bollinger Band breakouts that are confirmed by SMC signals and higher timeframe trend. It looks for breakouts that align with potential market structure shifts and key price levels (order blocks, swing highs/lows). The higher timeframe filter helps avoid trades that go against the overall trend.
In essence, the strategy attempts to identify high-probability breakout trades by combining momentum (Bollinger Bands) with structural analysis (SMC) and trend confirmation.
Key User-Adjustable Parameters:
Bollinger Bands Length
Standard Deviation Multiplier
Higher Timeframe
Higher Timeframe Confirmation (on/off)
SMC Elements Visibility (on/off)
Order block lookback length.
Swing lookback length.
Bollinger band fill opacity.
This detailed description should provide a comprehensive understanding of the strategy's logic and components.
***DISCLAIMER: This strategy is for educational purposes only. It is not financial advice. Past performance is not indicative of future results. Use at your own risk. Always perform thorough backtesting and forward testing before using any strategy in live trading.***
Strategy Stats [presentTrading]Hello! it's another weekend. This tool is a strategy performance analysis tool. Looking at the TradingView community, it seems few creators focus on this aspect. I've intentionally created a shared version. Welcome to share your idea or question on this.
█ Introduction and How it is Different
Strategy Stats is a comprehensive performance analytics framework designed specifically for trading strategies. Unlike standard strategy backtesting tools that simply show cumulative profits, this analytics suite provides real-time, multi-timeframe statistical analysis of your trading performance.
Multi-timeframe analysis: Automatically tracks performance metrics across the most recent time periods (last 7 days, 30 days, 90 days, 1 year, and 4 years)
Advanced statistical measures: Goes beyond basic metrics to include Information Coefficient (IC) and Sortino Ratio
Real-time feedback: Updates performance statistics with each new trade
Visual analytics: Color-coded performance table provides instant visual feedback on strategy health
Integrated risk management: Implements sophisticated take profit mechanisms with 3-step ATR and percentage-based exits
BTCUSD Performance
The table in the upper right corner is a comprehensive performance dashboard showing trading strategy statistics.
Note: While this presentation uses Vegas SuperTrend as the underlying strategy, this is merely an example. The Stats framework can be applied to any trading strategy. The Vegas SuperTrend implementation is included solely to demonstrate how the analytics module integrates with a trading strategy.
⚠️ Timeframe Limitations
Important: TradingView's backtesting engine has a maximum storage limit of 10,000 bars. When using this strategy stats framework on smaller timeframes such as 1-hour or 2-hour charts, you may encounter errors if your backtesting period is too long.
Recommended Timeframe Usage:
Ideal for: 4H, 6H, 8H, Daily charts and above
May cause errors on: 1H, 2H charts spanning multiple years
Not recommended for: Timeframes below 1H with long history
█ Strategy, How it Works: Detailed Explanation
The Strategy Stats framework consists of three primary components: statistical data collection, performance analysis, and visualization.
🔶 Statistical Data Collection
The system maintains several critical data arrays:
equityHistory: Tracks equity curve over time
tradeHistory: Records profit/loss of each trade
predictionSignals: Stores trade direction signals (1 for long, -1 for short)
actualReturns: Records corresponding actual returns from each trade
For each closed trade, the system captures:
float tradePnL = strategy.closedtrades.profit(tradeIndex)
float tradeReturn = strategy.closedtrades.profit_percent(tradeIndex)
int tradeType = entryPrice < exitPrice ? 1 : -1 // Direction
🔶 Performance Metrics Calculation
The framework calculates several key performance metrics:
Information Coefficient (IC):
The correlation between prediction signals and actual returns, measuring forecast skill.
IC = Correlation(predictionSignals, actualReturns)
Where Correlation is the Pearson correlation coefficient:
Correlation(X,Y) = (nΣXY - ΣXY) / √
Sortino Ratio:
Measures risk-adjusted return focusing only on downside risk:
Sortino = (Avg_Return - Risk_Free_Rate) / Downside_Deviation
Where Downside Deviation is:
Downside_Deviation = √
R_i represents individual returns, T is the target return (typically the risk-free rate), and n is the number of observations.
Maximum Drawdown:
Tracks the largest percentage drop from peak to trough:
DD = (Peak_Equity - Trough_Equity) / Peak_Equity * 100
🔶 Time Period Calculation
The system automatically determines the appropriate number of bars to analyze for each timeframe based on the current chart timeframe:
bars_7d = math.max(1, math.round(7 * barsPerDay))
bars_30d = math.max(1, math.round(30 * barsPerDay))
bars_90d = math.max(1, math.round(90 * barsPerDay))
bars_365d = math.max(1, math.round(365 * barsPerDay))
bars_4y = math.max(1, math.round(365 * 4 * barsPerDay))
Where barsPerDay is calculated based on the chart timeframe:
barsPerDay = timeframe.isintraday ?
24 * 60 / math.max(1, (timeframe.in_seconds() / 60)) :
timeframe.isdaily ? 1 :
timeframe.isweekly ? 1/7 :
timeframe.ismonthly ? 1/30 : 0.01
🔶 Visual Representation
The system presents performance data in a color-coded table with intuitive visual indicators:
Green: Excellent performance
Lime: Good performance
Gray: Neutral performance
Orange: Mediocre performance
Red: Poor performance
█ Trade Direction
The Strategy Stats framework supports three trading directions:
Long Only: Only takes long positions when entry conditions are met
Short Only: Only takes short positions when entry conditions are met
Both: Takes both long and short positions depending on market conditions
█ Usage
To effectively use the Strategy Stats framework:
Apply to existing strategies: Add the performance tracking code to any strategy to gain advanced analytics
Monitor multiple timeframes: Use the multi-timeframe analysis to identify performance trends
Evaluate strategy health: Review IC and Sortino ratios to assess predictive power and risk-adjusted returns
Optimize parameters: Use performance data to refine strategy parameters
Compare strategies: Apply the framework to multiple strategies to identify the most effective approach
For best results, allow the strategy to generate sufficient trade history for meaningful statistical analysis (at least 20-30 trades).
█ Default Settings
The default settings have been carefully calibrated for cryptocurrency markets:
Performance Tracking:
Time periods: 7D, 30D, 90D, 1Y, 4Y
Statistical measures: Return, Win%, MaxDD, IC, Sortino Ratio
IC color thresholds: >0.3 (green), >0.1 (lime), <-0.1 (orange), <-0.3 (red)
Sortino color thresholds: >1.0 (green), >0.5 (lime), <0 (red)
Multi-Step Take Profit:
ATR multipliers: 2.618, 5.0, 10.0
Percentage levels: 3%, 8%, 17%
Short multiplier: 1.5x (makes short take profits more aggressive)
Stop loss: 20%
Scalping Strategy Signal v2 by [INFINITYTRADER]Overview
This Pine Script (v6) implements a scalping strategy that uses higher timeframe data (default: 4H) to generate entry and exit signals, originally designed for the 15-minute timeframe with an option for 30-minute charts. The "Scalping Strategy Signal v2 by " integrates moving averages, RSI, volume, ATR, and candlestick patterns to identify trading opportunities. It features adjustable risk management with ATR-based stop-loss, take-profit, and trailing stops, plus dynamic position sizing based on user-set capital. Trades trigger only on the higher timeframe candle close (e.g., 4H) to limit activity within the same period. This closed-source script offers a structured scalping approach, blending multiple entry methods and risk controls for adaptability across market conditions.
What Makes It Unique
Unlike typical scalping scripts relying on single-indicator triggers (e.g., RSI alone or basic MA crossovers), this strategy combines four distinct entry methods—standard MA crossovers, RSI-based momentum shifts, trend-following shorts, and candlestick pattern logic—evaluated on a 4H timeframe for confirmation. This multi-layered design, paired with re-entry logic after losses and a mix of manual, ATR-based, and trailing exits, aims to balance trade frequency and reliability. The higher timeframe filter adds precision not commonly found in simpler scalping tools, while the 30-minute option enhances consistency by reducing noise.
How It Works
Timeframe Logic
Runs on a base timeframe (designed for 15-minute charts, with a 30-minute option) while pulling data from a user-chosen higher timeframe (default: 4H) for signal accuracy.
Limits entries to the close of each 4H candle, ensuring one trade per period to avoid over-trading in volatile conditions.
Indicators and Data
Moving Averages : Employs 21-period and 50-period simple moving averages on the higher timeframe to detect trends and signal entries/exits.
Volume : Requires volume to exceed 70% of its 20-period average on the higher timeframe for momentum confirmation.
RSI : Uses a 14-period RSI for overbought/oversold filtering and a 6-period RSI for precise entry timing.
ATR : Applies a 14-period Average True Range on the higher timeframe to set adaptive stop-loss and take-profit levels.
Candlestick Patterns : Analyzes consecutive green or red 4H bars for trend continuation signals.
Why These Indicators
The blend of moving averages, RSI, volume, ATR, and candlestick patterns forms a robust scalping framework. Moving averages establish trend context, RSI filters momentum and avoids extremes, volume confirms market activity, ATR adjusts risk to volatility, and candlestick patterns enhance entry timing with price action insights. Together, they target small, frequent moves in flat or trending markets, with the 4H filter reducing false signals common in lower-timeframe scalping.
Entry Conditions
Four entry methods are evaluated at the 4H candle close:
Standard Long Entry: Price crosses above the 21-period moving average, volume exceeds 70% of its 20-period average, and the 1H 14-period RSI is below 70—confirms uptrend momentum.
Special Long Entry: The 6-period RSI crosses above 23, price is more than 1.5 times the ATR from the 21-period moving average, and price exceeds its prior close—targets oversold bounces with a stop-loss at the 4H candle’s low.
Short Entries:
- RSI-Based: The 6-period RSI crosses below 68 with volume support—catches overbought pullbacks.
- Trend-Based: Price crosses below the 21-period moving average, volume is above 70% of its average, and the 1H 14-period RSI is above 30—confirms downtrends.
Red/Green Bar Logic: Two consecutive green 4H bars for longs or red 4H bars for shorts—uses candlestick patterns for continuation, with a tight stop-loss from the base timeframe candle.
Re-Entry Logic
Long : After a losing special long, triggers when the 6-period RSI crosses 27 and price crosses the 21-period moving average.
Short : After a losing short, triggers when the 6-period RSI crosses 50 and price crosses below the 21-period moving average.
Purpose: Offers recovery opportunities with stricter conditions.
Exit Conditions
Manual Exits: Longs close if the 21-period MA crosses below the 50-period MA or the 1H 14-period RSI exceeds 68; shorts close if the 21-period MA crosses above the 50-period MA or RSI drops below 25.
ATR-Based TP/SL: Stop-loss is entry price ± ATR × 1.5 (default); take-profit is ± ATR × 4 (default), checked at 4H close.
Trailing Stop: Adjusts ±6x ATR from peak/trough, closing if price retraces within 1x ATR.
Special/Tight SL: Special longs exit if price opens below the 4H candle’s low; 4th method entries use the base timeframe candle’s low/high, checked every bar.
Position Sizing
Bases trade value on user-set capital (default: 100 USDT), dividing by the higher timeframe close price for dynamic sizing.
Visualization
Displays a table at the bottom-right with current/previous signals, TP/SL levels, equity, trading pair, and trade size—color-coded for clarity (green for buy, red for sell).
Inputs
Initial Capital (USDT): Sets trade value (default: 100, min: 1).
ATR Stop-Loss Multiplier: Adjusts SL distance (default: 1.5, min: 1).
ATR Take-Profit Multiplier: Adjusts TP distance (default: 4, min: 1).
Higher Timeframe: Selects analysis timeframe (options: 1m, 5m, 15m, 30m, 1H, 4H, D, W; default: 4H).
Usage Notes
Intended Timeframe: Designed for 15-minute charts with 4H confirmation for precision and frequency; 30-minute charts improve consistency by reducing noise.
Backtesting: Adjust ATR multipliers and capital to match your asset’s volatility and risk tolerance.
Risk Management: Combines manual, ATR, and trailing exits—monitor to avoid overexposure.
Limitations: 4H candle-close dependency may delay entries in fast markets; RSI/volume filters can reduce trades in low-momentum periods.
Backtest Observations
Tested on BTC/USDT (4H higher timeframe, default settings: Initial Capital: 100 USDT, ATR SL: 1.5x, ATR TP: 4x) across market conditions, comparing 15-minute and 30-minute charts:
Bull Market (Jul 2023 - Dec 2023):
15-Minute: 277 long, 219 short; Win Rate: 42.74%; P&L: 108%; Drawdown: 1.99%; Profit Factor: 3.074.
30-Minute: 257 long, 215 short; Win Rate: 49.58%; P&L: 116.85%; Drawdown: 2.34%; Profit Factor: 3.14.
Notes: Moving average crossovers and green bar patterns suited this bullish phase; 30-minute improved win rate and P&L by filtering weaker signals.
Bear Market (Jan 2022 - Jun 2022):
15-Minute: 262 long, 211 short; Win Rate: 44.4%; P&L: 239.80%; Drawdown: 3.74%; Profit Factor: 3.419.
30-Minute: 250 long, 200 short; Win Rate: 52.22%; P&L: 258.77%; Drawdown: 5.34%; Profit Factor: 3.461.
Notes: Red bar patterns and RSI shorts thrived in the downtrend; 30-minute cut choppy reversals for better consistency.
Flat Market (Jan 2021 - Jun 2021):
15-Minute: 280 long, 208 short; Win Rate: 51.84%; P&L: 340.33%; Drawdown: 9.59%; Profit Factor: 2.924.
30-Minute: 270 long, 209 short; Win Rate: 55.11%; P&L: 315.42%; Drawdown: 7.21%; Profit Factor: 2.598.
Notes: High trade frequency and P&L showed strength in ranges; 30-minute lowered drawdown for better risk control.
Results reflect historical performance on BTC/USDT with default settings—users should test on their assets and timeframes. Past performance does not guarantee future results and is shared only to illustrate the strategy’s behavior.
Why It Works Well in Flat Markets
A "flat market" lacks strong directional trends, with price oscillating around moving averages, as in Jan 2021 - Jun 2021 for BTC/USDT. This strategy excels here because its crossover-based entries trigger frequently in tight ranges. In trending markets, an exit might not be followed by a new entry without a pullback, but flat markets produce multiple crossovers, enabling more trades. ATR-based TP/SL and trailing stops capture these small swings, while RSI and volume filters ensure momentum, driving high P&L and win rates.
Technical Details
Built in Pine Script v6 for TradingView compatibility.
Prevents overlapping trades with long/short checks.
Handles edge cases like zero division and auto-detects the trading pair’s base currency (e.g., BTC from BTCUSDT).
This strategy suits scalpers seeking structured entries and risk management. Test on 15-minute or 30-minute charts to match your style and market conditions.
RSI Pro+ (Bear market, financial crisis and so on EditionIn markets defined by volatility, fear, and uncertainty – the battlegrounds of bear markets and financial crises – you need tools forged in resilience. Introducing RSI Pro+, a strategy built upon a legendary indicator born in 1978, yet engineered with modern visual clarity to remain devastatingly effective even in the chaotic financial landscapes of 3078.
This isn't about complex algorithms predicting the unpredictable. It's about harnessing the raw, time-tested power of the Relative Strength Index (RSI) to identify potential exhaustion points and capitalize on oversold conditions. RSI Pro+ cuts through the noise, providing clear, actionable signals when markets might be poised for a relief bounce or reversal.
Core Technology (The 1978 Engine):
RSI Crossover Entry: The strategy initiates a LONG position when the RSI (default period 11) crosses above a user-defined low threshold (default 30). This classic technique aims to enter when selling pressure may be waning, offering potential entry points during sharp downturns or periods of consolidation after a fall.
Modern Enhancements (The 3078 Cockpit):
RSI Pro+ isn't just about the signal; it's about providing a professional-grade visual experience directly on your chart:
Entry Bar Highlight: A subtle background flash on the chart signals the exact bar where the RSI crossover condition is met, alerting you to potential entry opportunities.
Trade Bar Coloring: Once a trade is active, the price bars are subtly colored, giving you immediate visual confirmation that the strategy is live in the market.
Entry Price Line: A clear, persistent line marks your exact average entry price for the duration of the trade, serving as a crucial visual anchor.
Take Profit Line: Your calculated Take Profit target is plotted as a distinct line, keeping your objective clearly in sight.
Custom Entry Marker: A precise shape (▲) appears below the bar where the trade entry was actually executed, pinpointing the start of the position.
On-Chart Info Table (HUD): A clean, customizable Heads-Up Display appears when a trade is active, showing vital information at a glance:
Entry Price: Your position's average cost basis.
TP Target: The calculated price level for your Take Profit exit.
Current PnL%: Real-time Profit/Loss percentage for the open trade.
Full Customization: Nearly every aspect is configurable via the settings menu:
RSI Period & Crossover Level
Take Profit Percentage
Toggle ALL visual enhancements on/off individually
Position the Info Table wherever you prefer on the chart.
How to Use RSI Pro+:
Add to Chart: Apply the "RSI Pro+ (Bear market...)" strategy to your TradingView chart. Ensure any previous versions are removed.
Access Settings: Click the cogwheel icon (⚙️) next to the strategy name on your chart.
Configure Inputs (Crucial Step):
RSI Crossover Level: This is key. The default (30) targets standard oversold conditions. In severe downturns, you might experiment with lower levels (e.g., 25, 20) or higher ones (e.g., 40) depending on the asset and timeframe. Observe where RSI(11) typically bottoms out on your chart.
Take Profit Percentage (%): Define your desired profit target per trade (e.g., enter 0.5 for 0.5%, 1.0 for 1%). The default is a very small 0.11%.
RSI Period: While default is 11, you can adjust this (e.g., the standard 14).
Visual Enhancements: Enable or disable the visual features (background highlights, bar coloring, lines, markers, table) according to your preference using the checkboxes. Adjust table position.
Observe & Backtest: Watch how the strategy behaves on your chosen asset and timeframe. Use TradingView's Strategy Tester to analyze historical performance based on your settings. No strategy works perfectly everywhere; testing is essential.
Important Considerations:
Risk Management: This specific script version focuses on a Take Profit exit. It does not include an explicit Stop Loss. You MUST manage risk through appropriate position sizing, potentially adding a Stop Loss manually, or by modifying the script.
Oversold ≠ Reversal: An RSI crossover is an indicator of potential exhaustion, not a guarantee of a price reversal.
Fixed TP: A fixed percentage TP ensures small wins but may exit before larger potential moves.
Backtesting Limitations: Past performance does not guarantee future results.
RSI Pro+ strips away complexity to focus on a robust, time-honored principle, enhanced with modern visuals for the discerning trader navigating today's (and tomorrow's) challenging markets
PowerZone Trading StrategyExplanation of the PowerZone Trading Strategy for Your Users
The PowerZone Trading Strategy is an automated trading strategy that detects strong price movements (called "PowerZones") and generates signals to enter a long (buy) or short (sell) position, complete with predefined take profit and stop loss levels. Here’s how it works, step by step:
1. What is a PowerZone?
A "PowerZone" (PZ) is a zone on the chart where the price has shown a significant and consistent movement over a specific number of candles (bars). There are two types:
Bullish PowerZone (Bullish PZ): Occurs when the price rises consistently over several candles after an initial bearish candle.
Bearish PowerZone (Bearish PZ): Occurs when the price falls consistently over several candles after an initial bullish candle.
The code analyzes:
A set number of candles (e.g., 5, adjustable via "Periods").
A minimum percentage move (adjustable via "Min % Move for PowerZone") to qualify as a strong zone.
Whether to use the full candle range (highs and lows) or just open/close prices (toggle with "Use Full Range ").
2. How Does It Detect PowerZones?
Bullish PowerZone:
Looks for an initial bearish candle (close below open).
Checks that the next candles (e.g., 5) are all bullish (close above open).
Ensures the total price movement exceeds the minimum percentage set.
Defines a range: from the high (or open) to the low of the initial candle.
Bearish PowerZone:
Looks for an initial bullish candle (close above open).
Checks that the next candles are all bearish (close below open).
Ensures the total price movement exceeds the minimum percentage.
Defines a range: from the high to the low (or close) of the initial candle.
These zones are drawn on the chart with lines: green or white for bullish, red or blue for bearish, depending on the color scheme ("DARK" or "BRIGHT").
3. When Does It Enter a Trade?
The strategy waits for a breakout from the PowerZone range to enter a trade:
Buy (Long): When the price breaks above the high of a Bullish PowerZone.
Sell (Short): When the price breaks below the low of a Bearish PowerZone.
The position size is set to 100% of available equity (adjustable in the code).
4. Take Profit and Stop Loss
Take Profit (TP): Calculated as a multiple (adjustable via "Take Profit Factor," default 1.5) of the PowerZone height. For example:
For a buy, TP = Entry price + (PZ height × 1.5).
For a sell, TP = Entry price - (PZ height × 1.5).
Stop Loss (SL): Calculated as a multiple (adjustable via "Stop Loss Factor," default 1.0) of the PZ height, placed below the range for buys or above for sells.
5. Visualization on the Chart
PowerZones are displayed with lines on the chart (you can hide them with "Show Bullish Channel" or "Show Bearish Channel").
An optional info panel ("Show Info Panel") displays key levels: PZ high and low, TP, and SL.
You can also enable brief documentation on the chart ("Show Documentation") explaining the basic rules.
6. Alerts
The code generates automatic alerts in TradingView:
For a bullish breakout: "Bullish PowerZone Breakout - LONG!"
For a bearish breakdown: "Bearish PowerZone Breakdown - SHORT!"
7. Customization
You can tweak:
The number of candles to detect a PZ ("Periods").
The minimum percentage move ("Min % Move").
Whether to use highs/lows or just open/close ("Use Full Range").
The TP and SL factors.
The color scheme and what elements to display on the chart.
Practical Example
Imagine you set "Periods = 5" and "Min % Move = 2%":
An initial bearish candle appears, followed by 5 consecutive bullish candles.
The total move exceeds 2%.
A Bullish PowerZone is drawn with a high and low.
If the price breaks above the high, you enter a long position with a TP 1.5 times the PZ height and an SL equal to the height below.
The system executes the trade and exits automatically at TP or SL.
Conclusion
This strategy is great for capturing strong price movements after consolidation or momentum zones. It’s automated, visual, and customizable, making it useful for both beginner and advanced traders. Try it out and adjust it to fit your trading style!
Apex Trend SniperApex Trend Sniper - Advanced Trend Trading Strategy (Pine Script v5)
🚀 Overview
The Apex Trend Sniper is an advanced, fully automated trend-following strategy designed for crypto, forex, and stock markets. It combines momentum analysis, trend confirmation, volume validation, and adaptive risk management to capture high-probability trades. Unlike many strategies, this system is 100% non-repainting, ensuring reliable backtesting and real-time execution.
🔹 How This Strategy Works (Indicator Mashup)
The Apex Trend Sniper leverages multiple indicators to create a robust multi-layered confirmation system:
1️⃣ Trend Identification with RMI & McGinley Dynamic
📌 What It Does: Identifies the dominant trend and prevents trading against market conditions.
✔ McGinley Dynamic Baseline:
A highly adaptive moving average that dynamically reacts to price changes.
Price above the baseline = bullish trend.
Price below the baseline = bearish trend.
✔ Relative Momentum Index (RMI):
A refined Relative Strength Index (RSI) that filters out weak trends.
Above 50 = bullish confirmation.
Below 50 = bearish confirmation.
2️⃣ Trend Strength Confirmation with Vortex Indicator
📌 What It Does: Confirms that a detected trend is strong and valid.
✔ Vortex Indicator (VI):
Measures directional movement and trend strength.
A bullish trend is confirmed when VI+ > VI-.
A bearish trend is confirmed when VI- > VI+.
3️⃣ Volume Spike Detection for Trade Validation
📌 What It Does: Ensures that trades are placed only during strong market participation.
✔ Volume Confirmation:
A trade signal is only valid if volume spikes above the moving average.
Helps avoid false breakouts and weak trends.
4️⃣ Entry & Exit Strategy with Multi-Level Take Profits
📌 What It Does: Enters trades only when all conditions align and manages risk effectively.
✔ Entry Conditions (All must be met):
Price is above/below McGinley Dynamic.
RMI confirms trend direction.
Vortex indicator confirms trend strength.
Volume spike is detected.
✔ Exit Conditions:
Take Profit 1 (TP1): Secures 50% of the position at the first price target.
Take Profit 2 (TP2): Closes the remaining position at the second price target.
Exit Before Reversal: If an opposite trend signal appears, the position is closed early.
Trend Weakness Exit: If momentum weakens, the trade is exited automatically.
📌 Strategy Customization
🔧 Fully customizable to fit any trading style:
✔ McGinley Dynamic Length – Adjust baseline sensitivity.
✔ RMI & Vortex Settings – Fine-tune momentum filters.
✔ Volume Thresholds – Modify spike detection for better accuracy.
✔ Take Profit Levels – Set TP1 & TP2 based on market volatility.
📢 How to Use Apex Trend Sniper
1️⃣ Apply the strategy to any TradingView chart.
2️⃣ Customize the settings to fit your trading approach.
3️⃣ Use the backtest report to evaluate performance.
4️⃣ Monitor the dashboard to track real-time trade execution.
📌 Recommended Timeframes & Markets
✔ Best Markets:
✅ Crypto (BTC, ETH, SOL, etc.)
✅ Forex (EUR/USD, GBP/USD, JPY/USD, etc.)
✅ Stocks & Indices (S&P500, NASDAQ, etc.)
✔ Optimal Timeframes:
✅ Swing Trading: 1H – 4H – 1D
✅ Intraday & Scalping: 5M – 15M – 30M
📌 Backtest Settings for Realistic Performance
✔ Initial Capital: $1000 (or more for scaling).
✔ Commission: 0.05% (to simulate exchange fees).
✔ Slippage: 1-2 (to account for execution delay).
✔ Date Range: Test across different market conditions.
📢 TradingView Disclaimer
📌 This script is for educational purposes only and does not constitute financial advice. Trading carries significant risk, and past performance does not guarantee future results. Always test strategies thoroughly before applying them in a live market. Users are responsible for their own trading decisions.
🚀 Why Choose Apex Trend Sniper?
✅ Non-Repainting – No misleading signals.
✅ Multi-Layer Confirmation – Reduces false trades.
✅ Volume & Trend Strength Validation – Ensures high-probability entries.
✅ Adaptive Risk Management – Secures profits while maximizing trends.
✅ Versatile Across Markets & Timeframes – Works for crypto, forex, and stocks.
📢 Start Trading Smarter with Apex Trend Sniper! 🚀
🔗 Try it now on TradingView and optimize your trend-following strategy. 🔥
External Signals Strategy TesterExternal Signals Strategy Tester
This strategy is designed to help you backtest external buy/sell signals coming from another indicator on your chart. It is a flexible and powerful tool that allows you to simulate real trading based on signals generated by any indicator, using input.source connections.
🔧 How It Works
Instead of generating signals internally, this strategy listens to two external input sources:
One for buy signals
One for sell signals
These sources can be connected to the plots from another indicator (for example, custom indicators, signal lines, or logic-based plots).
To use this:
Add your indicator to the chart (it must be visible on the same pane as this strategy).
Open the settings of the strategy.
In the fields Buy Signal and Sell Signal, select the appropriate plot (line, value, etc.) from the indicator that represents the buy/sell logic.
The strategy will open positions when the selected buy signal crosses above 0, and sell signal crosses above 0.
This logic can be easily adapted by modifying the crossover rule inside the script if your signal style is different.
⚙️ Features Included
✅ Configurable trade direction:
You can choose whether to allow long trades, short trades, or both.
✅ Optional close on opposite signal:
When enabled, the strategy will exit the current position if an opposite signal appears.
✅ Optional full position reversal:
When enabled, the strategy will close the current position and immediately open an opposite one on the reverse signal.
✅ Risk Management Tools:
You can define:
Take Profit (TP): Position will be closed once the specified profit (in %) is reached.
Stop Loss (SL): Position will be closed if the price drops to the specified loss level (in %).
BreakEven (BE): Once the specified profit threshold is reached, the strategy will move the stop-loss to the entry price.
📌 If any of these values (TP, SL, BE) are set to 0, the feature is disabled and will not be applied.
🧪 Best Use Cases
Backtesting signals from custom indicators, without rewriting the logic into a strategy.
Comparing the performance of different signal sources.
Testing external indicators with optional position management logic.
Validating strategies using external filters, oscillators, or trend signals.
📌 Final Notes
You can visualize where the strategy detected buy/sell signals using green/red markers on the chart.
All parameters are customizable through the strategy settings panel.
This strategy does not repaint, and it processes signals in real-time only (no lookahead bias).
Long Term Profitable Swing | AbbasA Story of a Profitable Swing Trading Strategy
Imagine you're sailing across the ocean, looking for the perfect wave to ride. Swing trading is quite similar—you're navigating the stock market, searching for the ideal moments to enter and exit trades. This strategy, created by Abbas, helps you find those waves and ride them effectively to profitable outcomes.
🌊 Finding the Perfect Wave (Entry)
Our journey begins with two simple signs that tell us a great trading opportunity is forming:
- Moving Averages: We use two lines that follow price trends—the faster one (EMA 16) reacts quickly to recent price moves, and the slower one (EMA 30) gives us a longer-term perspective. When the faster line crosses above the slower line, it's like a clear signal saying, "Hey! The wave is rising, and prices might move higher!"
- RSI Momentum: Next, we check a tool called the RSI, which measures momentum (how strongly prices are moving). If the RSI number is above 50, it means there's enough strength behind this rising wave to carry us forward.
When both signals appear together, that's our green light. It's time to jump on our surfboard and start riding this promising wave.
⚓ Safely Riding the Wave (Risk Management)
While we're riding this wave, we want to ensure we're safe from sudden surprises. To do this, we use something called the Average True Range (ATR), which measures how volatile (or bumpy) the price movements are:
- Stop-Loss: To avoid falling too hard, we set a safety line (stop-loss) 8 times the ATR below our entry price. This helps ensure we exit if the wave suddenly turns against us, protecting us from heavy losses.
- Take Profit: We also set a goal to exit the trade at 11 times the ATR above our entry. This way, we capture significant profits when the wave reaches a nice high point.
🌟 Multiple Rides, Bigger Adventures
This strategy allows us to take multiple positions simultaneously—like riding several waves at once, up to 5. Each trade we make uses only 10% of our trading capital, keeping risks manageable and giving us multiple opportunities to win big.
🗺️ Easy to Follow Settings
Here are the basic settings we use:
- Fast EMA**: 16
- Slow EMA**: 30
- RSI Length**: 9
- RSI Threshold**: 50
- ATR Length**: 21
- ATR Stop-Loss Multiplier**: 8
- ATR Take-Profit Multiplier**: 11
These settings are flexible—you can adjust them to better suit different markets or your personal trading style.
🎉 Riding the Waves of Success
This simple yet powerful swing trading approach helps you confidently enter trades, clearly know when to exit, and effectively manage your risk. It’s a reliable way to ride market waves, capture profits, and minimize losses.
Happy trading, and may you find many profitable waves to ride! 🌊✨
Please test, and take into account that it depends on taking multiple longs within the swing, and you only get to invest 25/30% of your equity.
Supply & Demand Zones + Order Block (Pro Fusion) - Auto Order Strategy Title:
Smart Supply & Demand Zones + Order Block Auto Strategy with ScalpPro (Buy-Focused)
📄 Strategy Description:
This strategy combines the power of Supply & Demand Zone analysis, Order Block detection, and an enhanced Scalp Pro momentum filter, specifically designed for automated decision-making based on high-volume breakouts.
✅ Key Features:
Auto Entry (Buy Only) Based on Breakouts
Automatically enters a Buy position when the price breaks out of a valid demand zone, confirmed by EMA 50 trend and volume spike.
Order Block Logic
Identifies bullish and bearish order blocks using consecutive candle structures and significant price movement.
Dynamic Stop Loss & Trailing Stop
Implements a trailing stop once price moves in profit, along with static initial stop loss for risk management.
Clear Visual Labels & Alerts
Displays BUY/SELL, Demand/Supply, and Order Block labels directly on the chart. Alerts trigger on valid breakout signals.
Scalp Pro Momentum Filter (Optimized)
Uses a modified MACD-style momentum indicator to confirm trend strength and filter out weak signals.
QuantJazz Turbine Trader BETA v1.17QuantJazz Turbine Trader BETA v1.17 - Strategy Introduction and User Guide
Strategy Introduction
Welcome to the QuantJazz Turbine Trader BETA v1.17, a comprehensive trading strategy designed for TradingView. This strategy is built upon oscillator principles, drawing inspiration from the Turbo Oscillator by RedRox, and incorporates multiple technical analysis concepts including RSI, MFI, Stochastic oscillators, divergence detection, and an optional FRAMA (Fractal Adaptive Moving Average) filter.
The Turbine Trader aims to provide traders with a flexible toolkit for identifying potential entry and exit points in the market. It presents information through a main signal line oscillator, a histogram, and various visual cues like dots, triangles, and divergence lines directly on the indicator panel. The strategy component allows users to define specific conditions based on these visual signals to trigger automated long or short trades within the TradingView environment.
This guide provides an overview of the strategy's components, settings, and usage. Please remember that this is a BETA version (v1.17). While developed with care, it may contain bugs or behave unexpectedly.
LEGAL DISCLAIMER: QuantJazz makes no claims about the fitness or profitability of this tool. Trading involves significant risk, and you may lose all of your invested capital. All trading decisions made using this strategy are solely at the user's discretion and responsibility. Past performance is not indicative of future results. Always conduct thorough backtesting and risk assessment before deploying any trading strategy with real capital.
This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.
Core Concepts and Visual Elements
The Turbine Trader indicator displays several components in its own panel below the main price chart:
1. Signal Line (Avg & Avg2): This is the primary oscillator. It's a composite indicator derived from RSI, MFI (Money Flow Index), and Stochastic calculations, smoothed using an EMA (Exponential Moving Average).
Avg: The faster smoothed signal line.
Avg2: The slower smoothed signal line.
Color Coding: The space between Avg and Avg2 is filled. The color (Neon Blue/gColor or Neon Purple/rColor) indicates the trend based on the relationship between Avg and Avg2. Blue suggests bullish momentum (Avg > Avg2), while Purple suggests bearish momentum (Avg2 > Avg).
Zero Line Crosses: Crossovers of the Avg line with the zero level can indicate shifts in momentum.
2. Histogram (resMfi): This histogram is based on smoothed and transformed MFI calculations (Fast MFI and Slow MFI).
Color Coding: Bars are colored Neon Blue (histColorUp) when above zero, suggesting bullish pressure, and Neon Purple (histColorDn) when below zero, suggesting bearish pressure. Transparency is applied.
Zero Line Crosses: Crossovers of the histogram with the zero level can signal potential shifts in money flow.
3. Reversal Points (Dots): Dots appear on the Signal Line (specifically on Avg2) when the color changes (i.e., Avg crosses Avg2).
Small Dots: Appear when a reversal occurs while the oscillator is in an "extreme" zone (below -60 for bullish reversals, above +60 for bearish reversals).
Large Dots: Appear when a reversal occurs outside of these extreme zones.
Colors: Blue (gRdColor) for bullish reversals (Avg crossing above Avg2), Purple (rRdColor) for bearish reversals (Avg crossing below Avg2).
4. Take Profit (TP) Signals (Triangles): Small triangles appear above (+120) or below (-120) the zero line.
Bearish Triangle (Down, Purple rTpColor): Suggests a potential exit point for long positions or an entry point for short positions, based on the oscillator losing upward momentum above the 50 level.
Bullish Triangle (Up, Blue gTpColor): Suggests a potential exit point for short positions or an entry point for long positions, based on the oscillator losing downward momentum below the -50 level.
5. Divergence Lines: The strategy automatically detects and draws potential regular and hidden divergences between the price action (highs/lows) and the Signal Line (Avg).
Regular Bullish Divergence (White bullDivColor line, ⊚︎ label): Price makes a lower low, but the oscillator makes a higher low. Suggests potential bottoming.
Regular Bearish Divergence (White bearDivColor line, ⊚︎ label): Price makes a higher high, but the oscillator makes a lower high. Suggests potential topping.
Hidden Bullish Divergence (bullHidDivColor line, ⊚︎ label): Price makes a higher low, but the oscillator makes a lower low. Suggests potential continuation of an uptrend.
Hidden Bearish Divergence (bearHidDivColor line, ⊚︎ label): Price makes a lower high, but the oscillator makes a higher high. Suggests potential continuation of a downtrend.
Delete Broken Divergence Lines: If enabled, newer divergence lines originating from a similar point will replace older ones.
6. Status Line: A visual bar at the top (95 to 105) and bottom (-95 to -105) of the indicator panel. Its color intensity reflects the confluence of signals:
Score Calculation: +1 if Avg > Avg2, +1 if Avg > 0, +1 if Histogram > 0.
Top Bar (Bullish): Bright Blue (gStatColor) if score is 3, Faded Blue if score is 2, Black otherwise.
Bottom Bar (Bearish): Bright Purple (rStatColor) if score is 0, Faded Purple if score is 1, Black otherwise.
Strategy Settings Explained
The strategy's behavior is controlled via the settings panel (gear icon).
1. Date Range:
Start Date, End Date: Define the period for backtesting. Trades will only occur within this range.
2. Optional Webhook Configuration: (For Automation)
3C Email Token, 3C Bot ID: Enter your 3Commas API credentials if you plan to automate trading using webhooks. The strategy generates JSON alert messages compatible with 3Commas. You can go ahead and just leave the text field as defaulted, "TOKEN HERE" / "BOT ID HERE" if not using any bot automations at this time. You can always come back later and automate it. More info can be made available from QuantJazz should you need automation assistance with custom indicators and trading strategies.
3. 🚀 Signal Line:
Turn On/Off: Show or hide the main signal lines (Avg, Avg2).
gColor, rColor: Set the colors for bullish and bearish signal line states.
Length (RSI): The lookback period for the internal RSI calculation. Default is 2.
Smooth (EMA): The smoothing period for the EMAs applied to the composite signal. Default is 9.
RSI Source: The price source used for RSI calculation (default: close).
4. 📊 Histogram:
Turn On/Off: Show or hide the histogram.
histColorUp, histColorDn: Set the colors for positive and negative histogram bars.
Length (MFI): The base lookback period for MFI calculations. Default is 5. Fast and Slow MFI lengths are derived from this.
Smooth: Smoothing period for the final histogram output. Default is 1 (minimal smoothing).
5.💡 Other:
Show Divergence Line: Toggle visibility of regular divergence lines.
bullDivColor, bearDivColor: Colors for regular divergence lines.
Show Hidden Divergence: Toggle visibility of hidden divergence lines.
bullHidDivColor, bearHidDivColor: Colors for hidden divergence lines.
Show Status Line: Toggle visibility of the top/bottom status bars.
gStatColor, rStatColor: Colors for the status line bars.
Show TP Signal: Toggle visibility of the TP triangles.
gTpColor, rTpColor: Colors for the TP triangles.
Show Reversal points: Toggle visibility of the small/large dots on the signal line.
gRdColor, rRdColor: Colors for the reversal dots.
Delete Broken Divergence Lines: Enable/disable automatic cleanup of older divergence lines.
6. ⚙️ Strategy Inputs: (CRITICAL for Trade Logic)
This section defines which visual signals trigger trades. Each signal (Small/Large Dots, TP Triangles, Bright Bars, Signal/Histogram Crosses, Signal/Histogram Max/Min, Divergences) has a dropdown menu:
Long: This signal can trigger a long entry.
Short: This signal can trigger a short entry.
Disabled: This signal will not trigger any entry.
Must Be True Checkbox: If checked for a specific signal, that signal's condition must be met for any trade (long or short, depending on the dropdown selection for that signal) to be considered. Multiple "Must Be True" conditions act as AND logic – all must be true simultaneously.
How it Works:
The strategy first checks if all conditions marked as "Must Be True" (for the relevant trade direction - long or short) are met.
If all "Must Be True" conditions are met, it then checks if at least one of the conditions not marked as "Must Be True" (and set to "Long" or "Short" respectively) is also met.
If both steps pass, and other filters (like Date Range, FRAMA) allow, an entry order is placed.
Example: If "Large Bullish Dot" is set to "Long" and "Must Be True" is checked, AND "Bullish Divergence" is set to "Long" but "Must Be True" is not checked: A long entry requires BOTH the Large Bullish Dot AND the Bullish Divergence to occur simultaneously. If "Large Bullish Dot" was "Long" but not "Must Be True", then EITHER a Large Bullish Dot OR a Bullish Divergence could trigger a long entry (assuming no other "Must Be True" conditions are active).
Note: By default, the strategy is configured for long-only trades (strategy.risk.allow_entry_in(strategy.direction.long)). To enable short trades, you would need to comment out or remove this line in the Pine Script code and configure the "Strategy Inputs" accordingly.
7. 💰 Take Profit Settings:
Take Profit 1/2/3 (%): The percentage above the entry price (for longs) or below (for shorts) where each TP level is set. (e.g., 1.0 means 1% profit).
TP1/2/3 Percentage: The percentage of the currently open position to close when the corresponding TP level is hit. The percentages should ideally sum to 100% if you intend to close the entire position across the TPs.
Trailing Stop (%): The percentage below the highest high (for longs) or above the lowest low (for shorts) reached after the activation threshold, where the stop loss will trail.
Trailing Stop Activation (%): The minimum profit percentage the trade must reach before the trailing stop becomes active.
Re-entry Delay (Bars): The minimum number of bars to wait after a TP is hit before considering a re-entry. Default is 1 (allows immediate re-entry on the next bar if conditions met).
Re-entry Price Offset (%): The percentage the price must move beyond the previous TP level before a re-entry is allowed. This prevents immediate re-entry if the price hovers around the TP level.
8. 📈 FRAMA Filter: (Optional Trend Filter)
Use FRAMA Filter: Enable or disable the filter.
FRAMA Source, FRAMA Period, FRAMA Fast MA, FRAMA Slow MA: Parameters for the FRAMA calculation. Defaults provided are common starting points.
FRAMA Filter Type:
FRAMA > previous bars: Allows trades only if FRAMA is significantly above its recent average (defined by FRAMA Percentage and FRAMA Lookback). Typically used to confirm strong upward trends for longs.
FRAMA < price: Allows trades only if FRAMA is below the current price (framaSource). Can act as a baseline trend filter.
FRAMA Percentage (X), FRAMA Lookback (Y): Used only for the FRAMA > previous bars filter type.
How it Affects Trades: If Use FRAMA Filter is enabled:
Long entries require the FRAMA filter condition to be true.
Short entries require the FRAMA filter condition to be false (as currently coded, this acts as an inverse filter for shorts if enabled).
How to Use the Strategy
1. Apply to Chart: Open your desired chart on TradingView. Click "Indicators", find "QuantJazz Turbine Trader BETA v1.17" (you might need to add it via Invite-only scripts or if published publicly), and add it to your chart. The oscillator appears below the price chart, and the strategy tester panel opens at the bottom.
2. Configure Strategy Properties: In the Pine Script code itself (or potentially via the UI if supported), adjust the strategy() function parameters like initial_capital, default_qty_value, commission_value, slippage, etc., to match your account, broker fees, and risk settings. The user preferences provided (e.g., 1000 initial capital, 0.1% commission) are examples. Remember use_bar_magnifier is false by default in v1.17.
3. Configure Inputs (Settings Panel):
Set the Date Range for backtesting.
Crucially, configure the ⚙️ Strategy Inputs. Decide which signals should trigger entries and whether they are mandatory ("Must Be True"). Start simply, perhaps enabling only one or two signals initially, and test thoroughly. Remember the default long-only setting unless you modify the code.
Set up your 💰 Take Profit Settings, including TP levels, position size percentages for each TP, and the trailing stop parameters. Decide if you want to use the re-entry feature.
Decide whether to use the 📈 FRAMA Filter and configure its parameters if enabled.
Adjust visual elements (🚀 Signal Line, 📊 Histogram, 💡 Other) as needed for clarity.
4. Backtest: Use the Strategy Tester panel in TradingView. Analyze the performance metrics (Net Profit, Max Drawdown, Profit Factor, Win Rate, Trade List) across different assets, timeframes, and setting configurations. Pay close attention to how different "Strategy Inputs" combinations perform.
5. Refine: Based on backtesting results, adjust the input settings, TP/SL strategy, and signal combinations to optimize performance for your chosen market and timeframe, while being mindful of overfitting.
6. Automation (Optional): If using 3Commas or a similar platform:
Enter your 3C Email Token and 3C Bot ID in the settings.
Create alerts in TradingView (right-click on the chart or use the Alert panel).
Set the Condition to "QuantJazz Turbine Trader BETA v1.17".
In the "Message" box, paste the corresponding placeholder, which will pass the message in JSON from our custom code to TradingView to pass through your webhook: {{strategy.order.alert_message}}.
In the next tab, configure the Webhook URL provided by your automation platform. Put a Whale sound, while you're at it! 🐳
When an alert triggers, TradingView will send the pre-formatted JSON message from the strategy code to your webhook URL.
Final Notes
The QuantJazz Turbine Trader BETA v1.17 offers a wide range of customizable signals and strategy logic. Its effectiveness heavily depends on proper configuration and thorough backtesting specific to the traded asset and timeframe. Start with the default settings, understand each component, and methodically test different combinations of signals and parameters. Remember the inherent risks of trading and never invest capital you cannot afford to lose.
EMA 10/55/200 - LONG ONLY MTF (4h with 1D & 1W confirmation)Title: EMA 10/55/200 - Long Only Multi-Timeframe Strategy (4h with 1D & 1W confirmation)
Description:
This strategy is designed for trend-following long entries using a combination of exponential moving averages (EMAs) on the 4-hour chart, confirmed by higher timeframe trends from the daily (1D) and weekly (1W) charts.
🔍 How It Works
🔹 Entry Conditions (4h chart):
EMA 10 crosses above EMA 55 and price is above EMA 55
OR
EMA 55 crosses above EMA 200
OR
EMA 10 crosses above EMA 500
These entries indicate short-term momentum aligning with medium/long-term trend strength.
🔹 Confirmation (multi-timeframe alignment):
Daily (1D): EMA 55 is above EMA 200
Weekly (1W): EMA 55 is above EMA 200
This ensures that we only enter long trades when the higher timeframes support an uptrend, reducing false signals during sideways or bearish markets.
🛑 Exit Conditions
Bearish crossover of EMA 10 below EMA 200 or EMA 500
Stop Loss: 5% below entry price
⚙️ Backtest Settings
Capital allocation per trade: 10% of equity
Commission: 0.1%
Slippage: 2 ticks
These are realistic conditions for crypto, forex, and stocks.
📈 Best Used On
Timeframe: 4h
Instruments: Trending markets like BTC/ETH, FX majors, or growth stocks
Works best in volatile or trending environments
⚠️ Disclaimer
This is a backtest tool and educational resource. Always validate on demo accounts before applying to real capital. Do your own due diligence.
Dow Theory Trend StrategyDow Theory Trend Strategy (Pine Script)
Overview
This Pine Script implements a trading strategy based on the core principles of Dow Theory. It visually identifies trends (uptrend, downtrend) by analyzing pivot highs and lows and executes trades when the trend direction changes. This script is an improved version that features refined trend determination logic and strategy implementation.
Core Concept: Dow Theory
The script uses a fundamental Dow Theory concept for trend identification:
Uptrend: Characterized by a series of Higher Highs (HH) and Higher Lows (HL).
Downtrend: Characterized by a series of Lower Highs (LH) and Lower Lows (LL).
How it Works
Pivot Point Detection:
It uses the built-in ta.pivothigh() and ta.pivotlow() functions to identify significant swing points (potential highs and lows) in the price action.
The pivotLookback input determines the number of bars to the left and right required to confirm a pivot. Note that this introduces a natural lag (equal to pivotLookback bars) before a pivot is confirmed.
Improved Trend Determination:
The script stores the last two confirmed pivot highs and the last two confirmed pivot lows.
An Uptrend (trendDirection = 1) is confirmed only when the latest pivot high is higher than the previous one (HH) AND the latest pivot low is higher than the previous one (HL).
A Downtrend (trendDirection = -1) is confirmed only when the latest pivot high is lower than the previous one (LH) AND the latest pivot low is lower than the previous one (LL).
Key Improvement: If neither a clear uptrend nor a clear downtrend is confirmed based on the latest pivots, the script maintains the previous trend state (trendDirection := trendDirection ). This differs from simpler implementations that might switch to a neutral/range state (e.g., trendDirection = 0) more frequently. This approach aims for smoother trend following, acknowledging that trends often persist through periods without immediate new HH/HL or LH/LL confirmations.
Trend Change Detection:
The script monitors changes in the trendDirection variable.
changedToUp becomes true when the trend shifts to an Uptrend (from Downtrend or initial state).
changedToDown becomes true when the trend shifts to a Downtrend (from Uptrend or initial state).
Visualizations
Background Color: The chart background is colored to reflect the currently identified trend:
Blue: Uptrend (trendDirection == 1)
Red: Downtrend (trendDirection == -1)
Gray: Initial state or undetermined (trendDirection == 0)
Pivot Points (Optional): Small triangles (shape.triangledown/shape.triangleup) can be displayed above pivot highs and below pivot lows if showPivotPoints is enabled.
Trend Change Signals (Optional): Labels ("▲ UP" / "▼ DOWN") can be displayed when a trend change is confirmed (changedToUp / changedToDown) if showTrendChange is enabled. These visually mark the potential entry points for the strategy.
Strategy Logic
Entry Conditions:
Enters a long position (strategy.long) using strategy.entry("L", ...) when changedToUp becomes true.
Enters a short position (strategy.short) using strategy.entry("S", ...) when changedToDown becomes true.
Position Management: The script uses strategy.entry(), which automatically handles position reversal. If the strategy is long and a short signal occurs, strategy.entry() will close the long position and open a new short one (and vice-versa).
Inputs
pivotLookback: The number of bars on each side to confirm a pivot high/low. Higher values mean pivots are confirmed later but may be more significant.
showPivotPoints: Toggle visibility of pivot point markers.
showTrendChange: Toggle visibility of the trend change labels ("▲ UP" / "▼ DOWN").
Key Improvements from Original
Smoother Trend Logic: The trend state persists unless a confirmed reversal pattern (opposite HH/HL or LH/LL) occurs, reducing potential whipsaws in choppy markets compared to logic that frequently resets to neutral.
Strategy Implementation: Converted from a pure indicator to a strategy capable of executing backtests and potentially live trades based on the Dow Theory trend changes.
Disclaimer
Dow Theory signals are inherently lagging due to the nature of pivot confirmation.
The effectiveness of the strategy depends heavily on the market conditions and the chosen pivotLookback setting.
This script serves as a basic template. Always perform thorough backtesting and implement proper risk management (e.g., stop-loss, take-profit, position sizing) before considering any live trading.
Arbitrage Spot-Futures Don++Strategy: Spot-Futures Arbitrage Don++
This strategy has been designed to detect and exploit arbitrage opportunities between the Spot and Futures markets of the same trading pair (e.g. BTC/USDT). The aim is to take advantage of price differences (spreads) between the two markets, while minimizing risk through dynamic position management.
[Operating principle
The strategy is based on calculating the spread between Spot and Futures prices. When this spread exceeds a certain threshold (positive or negative), reverse positions are opened simultaneously on both markets:
- i] Long Spot + Short Futures when the spread is positive.
- i] Short Spot + Long Futures when the spread is negative.
Positions are closed when the spread returns to a value close to zero or after a user-defined maximum duration.
[Strategy strengths
1. Adaptive thresholds :
- Entry/exit thresholds can be dynamic (based on moving averages and standard deviations) or fixed, offering greater flexibility to adapt to market conditions.
2. Robust data management :
- The script checks the validity of data before executing calculations, thus avoiding errors linked to missing or invalid data.
3. Risk limitation :
- A position size based on a percentage of available capital (default 10%) limits exposure.
- A time filter limits the maximum duration of positions to avoid losses due to persistent spreads.
4. Clear visualization :
- Charts include horizontal lines for entry/exit thresholds, as well as visual indicators for spread and Spot/Futures prices.
5. Alerts and logs :
- Alerts are triggered on entries and exits to inform the user in real time.
[Points for improvement or completion
Although this strategy is functional and robust, it still has a few limitations that could be addressed in future versions:
1. [Limited historical data :
- TradingView does not retrieve real-time data for multiple symbols simultaneously. This can limit the accuracy of calculations, especially under conditions of high volatility.
2. [Lack of liquidity management :
- The script does not take into account the volumes available on the order books. In conditions of low liquidity, it may be difficult to execute orders at the desired prices.
3. [Non-dynamic transaction costs :
- Transaction costs (exchange fees, slippage) are set manually. A dynamic integration of these costs via an external API would be more realistic.
4. User-dependency for symbols :
- Users must manually specify Spot and Futures symbols. Automatic symbol validation would be useful to avoid configuration errors.
5. Lack of advanced backtesting :
- Backtesting is based solely on historical data available on TradingView. An implementation with third-party data (via an API) would enable the strategy to be tested under more realistic conditions.
6. [Parameter optimization :
- Certain parameters (such as analysis period or spread thresholds) could be optimized for each specific trading pair.
[How can I contribute?
If you'd like to help improve this strategy, here are a few ideas:
1. Add additional filters:
- For example, a filter based on volume or volatility to avoid false signals.
2. Integrate dynamic costs:
- Use an external API to retrieve actual costs and adjust thresholds accordingly.
3. Improve position management:
- Implement hedging or scalping mechanisms to maximize profits.
4. Test on other pairs:
- Evaluate the strategy's performance on other assets (ETH, SOL, etc.) and adjust parameters accordingly.
5. Publish backtesting results :
- Share detailed analyses of the strategy's performance under different market conditions.
[Conclusion
This Spot-Futures arbitrage strategy is a powerful tool for exploiting price differentials between markets. Although it is already functional, it can still be improved to meet more complex trading scenarios. Feel free to test, modify and share your ideas to make this strategy even more effective!
[Thank you for contributing to this open-source community!
If you have any questions or suggestions, please feel free to comment or contact me directly.
Adaptive KDJ (MTF)Hey guys,
this is an adaptive MTF KDJ oscillator.
Pick up to 3 different timeframes, choose a weighting if you want and enjoy the beautiful signals it will show you.
The length of every timeframe is adaptive and based of the timeframe's ATR.
The plot shows the smoothed average of the 3 KDJ values.
Large triangles show KDJ crossings.
Small triangles show anticipations of possible crossings.
I found out it works best with 1m, 5m, 15m and weighting=1 for forex scalping in 1m.
Use other indicators for confluence.