expected range STUDYThis is an indicator that measures how much price movement (low to high) we've seen in a set of 1 bar back, 2 bars back, 3 bars back, 5 bars back, 8 bars back using the Fibonacci sequence up to 89 bars back, and then measures how low or high within each range we are, sort of like giving a rating of 0 for sitting on the lower Bollinger Band and a rating of 100 for sitting on the higher Bollinger band. It combines all the data and weights the data by the historical strength of signal from each length of bands. It's been tuned to a 2 hour XBTUSD chart, but it could be used on other things and other timeframes too. Some tweaking would be needed, though. The final result works more like a trend following indictor than and indicator that tries to pick an exact trend reversal point. However, you're free to use it how you want. Frequently you get a nice red or green spike up showing you when the bottom or top is in, but sometimes those spikes are just the start of an extended down move or up move.
On the chart, a buy (long) signal is generated when the green line crosses up above the orange line. To make it extra clear the background is green when you should be long. A sell (short) signal is generated with the red line crosses up above the yellow line. The background will be red when you should be short. If the background is black, it's indicating a profit of over 53% was taken and it's waiting for another trade to start. Up to you to take profit or keep riding your trade.
For XBTUSD trades, a full take profit on any trade exceeding 53% gains works nice (on 1x leverage) and a stoploss of -7% works quite nicely too. One could use this on up to 2x leverage but I wouldn't recommend going much higher. Have fun. Trade carefully. Don't get rekt.
I will release the "expected range STRATEGY" to go along with this so you can do your own backtesting.
Disclaimer: I haven't tested the alerts, but they should work. Use at your own risk.
Cerca negli script per "backtesting"
Heiken-Ashi CandlesSimple script to view Heiken-Ashi candles below a normal candles chart.
Could also be useful for using HA calcs in strategy scripts on normal candles chart for proper backtesting.
I adapted this to v4 from original v2 script by @samtsui. If you like please remember to give him a Thumbs Up for his original version! ->
Golden Cross by -Westy-Quick Guide
- Yellow cross and green MA on top = Potential uptrend
- Yellow cross and red MA on top = Potential downtrend
A simple golden cross indicator of the green 50 and red 200 SMA with a yellow cross for ease of visibility and backtesting.
Generally, longer time frames more powerful signals but are less frequent. I typically use it on the 4 hour, daily and weekly.
Complete turtles strategy based on the donchian channelsDear Traders and investor,
I want to demonstrate scrypt of the iconic "trend following strategy" coded by my
The main idea was borrowed from the book "Way of the Turtle: The Secret Methods that Turned Ordinary People into Legendary". The strategy is based on the donchian channels and is one of the oldest and easiest strategy in the using. Also strategy include risk managment and trends filter which prevent false entries and high drawndowns. The results are based on the period from 2006 to present, but you can also change timeframe and period of backtesting.
Best regards,
Vlad
SimpleCrossOver_BotThis is a simple example of how you can compile your own strategy
This script contains the code for alerts and for backtesting.
In order to use the backtester, comment out the sections to be used for signals, and comment in the sections to be used on the back tester, and visa versa for using the script for alerts in order to automate your own bot.
Awesome Oscillator.MMouse_Lager_BCEAwesome Oscillator with added options for turning short trades on and off, as well as a start date for backtesting.
Pivot Reversal Strategy - TimeFramedThis is Pivot Reversal Strategy including the time frames for backtesting.
3 Duck's Trading System from Babypips.comThe 3 Duck's Trading System from Babypips.com
The 3 Duck's Trading System is the most popular and active trading system thread on the the babypips.com forum. It is a system that is mainly for beginners because it teaches you discipline, learning to cope with price moving against your position and learning to stay in a trade and keep profits running. For the thread and more info on the 3 Duck's Trading System click here
How does it work?
The system is a very simple enter/exit based on the 60 SMA of 3 different time frames: 4 hour, 1 hour and 5 minute.
The Rules, er, the Ducks! The Ducks must all be in a row for a trade to take place!
Duck 1 - To go long, price must be above the 60 SMA on the 4 hour chart.
Duck 2 - To go long, price must be above the 60 SMA on the 1 hour chart.
Duck 3 - To go long, price must cross above the 60 SMA on the 5 minute chart and the 60 SMA of the 5 minute chart must be below that of the 4 hour and 1 hour chart. (obviously the reverse for shorting)
YOU MUST USE THIS SYSTEM ONLY ON THE 5 MINUTE CHART.
I say this because I have already charted all of the Ducks into the 5 minute chart so you don't have to flip back and forth.
I have also added some inputs for profit targets, stop targets, trailing stops and times to trade for backtesting.
If you have any questions or comments, please let me know! If you see I messed up on something, please let me know!
Also a VERY special thanks to the babypips.com user Captain_Currency . He wrote this strategy 10 years ago (2007 was 10 years ago?!) and he is still active on the thread and posting results and offering help!
Adam Smith - MovingAvg CrossSimple Moving Average Cross script. Test on stocks and currency. For stocks test shorter time periods, meaning intra-day time periods such as 3min to 30min and so on to fit what is best. For currency, try longer periods with this model such as day to weeks depending on which currency.
NOTE: Take a look at your Max Drawdowns when testing. This will be the main indicator once you figure out your time period for backtesting. This will also let you know how much money to save and/or hold back in savings for down periods.
Trend v4.0 Another updateYet another update, default settings can be customized to your needs. Be aware that while this is similar to the other versions, this can only repaint an active bar, but that slows it down by one period. You are warned. Be that as it may, the basic idea is the same; trying to capture the really strong moves into overbought or oversold territory as defined by Relative Strength index. In RSI mode, you can see the smoothing has slowed it down a bit, but warrants backtesting.
First green bar go long, First red bar go short, first white bar possible trend exhaustion. Or use crossovers and such, play with the inputs OB/OS, RSI length, signal length, tick length, swing length, as I said customize to your tastes. I offer no surety as to its efficacy, but we all learn.
Trade Responsibly,
Shiroki
LANZ Strategy 3.0 [Backtest]🔷 LANZ Strategy 3.0 — Asian Range Fibonacci Scalping Strategy
LANZ Strategy 3.0 is a precision-engineered backtesting tool tailored for intraday traders who rely on the Asian session range to determine directional bias. This strategy implements dynamic Fibonacci projections and strict time-window validation to simulate a clean and disciplined trading environment.
🧠 Core Components:
Asian Range Bias Definition: Direction is established between 01:15–02:15 a.m. NY time based on the candle’s close in relation to the midpoint of the Asian session range (18:00–01:15 NY).
Limit Order Execution: Only one trade is placed daily, using a limit order at the Asian range high (for sells) or low (for buys), between 01:15–08:00 a.m. NY.
Fibonacci-Based TP/SL:
Original Mode: TP = 2.25x range, SL = 0.75x range.
Optimized Mode: TP = 1.95x range, SL = 0.65x range.
No Trade After 08:00 NY: If the limit order is not executed before 08:00 a.m. NY, it is canceled.
Fallback Logic at 02:15 NY: If the market direction misaligns with the setup at 02:15 a.m., the system re-evaluates and can re-issue the order.
End-of-Day Closure: All positions are closed at 15:45 NY if still open.
📊 Backtest-Ready Design:
Entries and exits are executed using strategy.entry() and strategy.exit() functions.
Position size is fixed via capital risk allocation ($100 per trade by default).
Only one position can be active at a time, ensuring controlled risk.
📝 Notes:
This strategy is ideal for assets sensitive to the Asian/London session overlap, such as Forex pairs and indices.
Easily switch between Fibonacci versions using a single dropdown input.
Fully deterministic: all entries are based on pre-defined conditions and time constraints.
👤 Credits:
Strategy developed by rau_u_lanz using Pine Script v6. Built for traders who favor clean sessions, directional clarity, and consistent execution using time-based logic and Fibonacci projections.
EMD Trend [InvestorUnknown]EMD Trend is a dynamic trend-following indicator that utilizes Exponential Moving Deviation (EMD) to build adaptive channels around a selected moving average. Designed for traders who value responsive trend signals with built-in volatility sensitivity, this tool highlights directional bias, market regime shifts, and potential breakout opportunities.
How It Works
Instead of using standard deviation, EMD Trend employs the exponential moving average of the absolute deviation from a moving average—producing smoother, faster-reacting upper and lower bounds:
Bullish (Risk-ON Long): Price crosses above the upper EMD band
Bearish (Risk-ON Short): Price crosses below the lower EMD band
Neutral: Price stays within the channel, indicating potential mean reversion or low momentum
Trend direction is defined by price interaction with these bands, and visual cues (color-coded bars and fills) help quickly identify market conditions.
Features
7 Moving Average Types: SMA, EMA, HMA, DEMA, TEMA, RMA, FRAMA
Custom Price Source: Choose close, hl2, ohlc4, or others
EMD Multiplier: Controls the width of the deviation envelope
Bar Coloring: Candles change color based on current trend
Intra-bar Signal Option: Enables faster updates (with optional repainting)
Speculative Zones: Fills highlight aggressive momentum moves beyond EMD bounds
Backtest Mode
Switch to Backtest Mode for performance evaluation over historical data:
Equity Curve Plot: Compare EMD Trend strategy vs. Buy & Hold
Trade Metrics Table: View number of trades, win/loss stats, profits
Performance Metrics Table: Includes CAGR, Sharpe, max drawdown, and more
Custom Start Date: Select from which date the backtest should begin
Trade Sizing: Configure capital and trade percentage per entry
Signal Filters: Choose from Long Only, Short Only, or Both
Alerts
Built-in alerts let you automate entries, exits, and trend transitions:
LONG (EMD Trend) - Trend flips to Long
SHORT (EMD Trend) - Trend flips to Short
RISK-ON LONG - Price crosses above upper EMD band
RISK-OFF LONG - Price crosses back below upper EMD band
RISK-ON SHORT - Price crosses below lower EMD band
RISK-OFF SHORT - Price crosses back above lower EMD band
Use Cases
Trend Confirmation with volatility-sensitive boundaries
Momentum Entry Filtering via breakout zones
Mean Reversion Avoidance in sideways markets
Backtesting & Strategy Building with real-time metrics
Disclaimer
This indicator is intended for informational and educational purposes only. It does not constitute investment advice. Historical performance does not guarantee future results. Always backtest and use in simulation before live trading.
Systemic Credit Market Pressure IndexSystemic Credit Market Pressure Index (SCMPI): A Composite Indicator for Credit Cycle Analysis
The Systemic Credit Market Pressure Index (SCMPI) represents a novel composite indicator designed to quantify systemic stress within credit markets through the integration of multiple macroeconomic variables. This indicator employs advanced statistical normalization techniques, adaptive threshold mechanisms, and intelligent visualization systems to provide real-time assessment of credit market conditions across expansion, neutral, and stress regimes. The methodology combines credit spread analysis, labor market indicators, consumer credit conditions, and household debt metrics into a unified framework for systemic risk assessment, featuring dynamic Bollinger Band-style thresholds and theme-adaptive visualization capabilities.
## 1. Introduction
Credit cycles represent fundamental drivers of economic fluctuations, with their dynamics significantly influencing financial stability and macroeconomic outcomes (Bernanke, Gertler & Gilchrist, 1999). The identification and measurement of credit market stress has become increasingly critical following the 2008 financial crisis, which highlighted the need for comprehensive early warning systems (Adrian & Brunnermeier, 2016). Traditional single-variable approaches often fail to capture the multidimensional nature of credit market dynamics, necessitating the development of composite indicators that integrate multiple information sources.
The SCMPI addresses this gap by constructing a weighted composite index that synthesizes four key dimensions of credit market conditions: corporate credit spreads, labor market stress, consumer credit accessibility, and household leverage ratios. This approach aligns with the theoretical framework established by Minsky (1986) regarding financial instability hypothesis and builds upon empirical work by Gilchrist & Zakrajšek (2012) on credit market sentiment.
## 2. Theoretical Framework
### 2.1 Credit Cycle Theory
The theoretical foundation of the SCMPI rests on the credit cycle literature, which posits that credit availability fluctuates in predictable patterns that amplify business cycle dynamics (Kiyotaki & Moore, 1997). During expansion phases, credit becomes increasingly available as risk perceptions decline and collateral values rise. Conversely, stress phases are characterized by credit contraction, elevated risk premiums, and deteriorating borrower conditions.
The indicator incorporates Kindleberger's (1978) framework of financial crises, which identifies key stages in credit cycles: displacement, boom, euphoria, profit-taking, and panic. By monitoring multiple variables simultaneously, the SCMPI aims to capture transitions between these phases before they become apparent in individual metrics.
### 2.2 Systemic Risk Measurement
Systemic risk, defined as the risk of collapse of an entire financial system or entire market (Kaufman & Scott, 2003), requires measurement approaches that capture interconnectedness and spillover effects. The SCMPI follows the methodology established by Bisias et al. (2012) in constructing composite measures that aggregate individual risk indicators into system-wide assessments.
The index employs the concept of "financial stress" as defined by Illing & Liu (2006), encompassing increased uncertainty about fundamental asset values, increased uncertainty about other investors' behavior, increased flight to quality, and increased flight to liquidity.
## 3. Methodology
### 3.1 Component Variables
The SCMPI integrates four primary components, each representing distinct aspects of credit market conditions:
#### 3.1.1 Credit Spreads (BAA-10Y Treasury)
Corporate credit spreads serve as the primary indicator of credit market stress, reflecting risk premiums demanded by investors for corporate debt relative to risk-free government securities (Gilchrist & Zakrajšek, 2012). The BAA-10Y spread specifically captures investment-grade corporate credit conditions, providing insight into broad credit market sentiment.
#### 3.1.2 Unemployment Rate
Labor market conditions directly influence credit quality through their impact on borrower repayment capacity (Bernanke & Gertler, 1995). Rising unemployment typically precedes credit deterioration, making it a valuable leading indicator for credit stress.
#### 3.1.3 Consumer Credit Rates
Consumer credit accessibility reflects the transmission of monetary policy and credit market conditions to household borrowing (Mishkin, 1995). Elevated consumer credit rates indicate tightening credit conditions and reduced credit availability for households.
#### 3.1.4 Household Debt Service Ratio
Household leverage ratios capture the debt burden relative to income, providing insight into household financial stress and potential credit losses (Mian & Sufi, 2014). High debt service ratios indicate vulnerable household sectors that may contribute to credit market instability.
### 3.2 Statistical Methodology
#### 3.2.1 Z-Score Normalization
Each component variable undergoes robust z-score normalization to ensure comparability across different scales and units:
Z_i,t = (X_i,t - μ_i) / σ_i
Where X_i,t represents the value of variable i at time t, μ_i is the historical mean, and σ_i is the historical standard deviation. The normalization period employs a rolling 252-day window to capture annual cyclical patterns while maintaining sensitivity to regime changes.
#### 3.2.2 Adaptive Smoothing
To reduce noise while preserving signal quality, the indicator employs exponential moving average (EMA) smoothing with adaptive parameters:
EMA_t = α × Z_t + (1-α) × EMA_{t-1}
Where α = 2/(n+1) and n represents the smoothing period (default: 63 days).
#### 3.2.3 Weighted Aggregation
The composite index combines normalized components using theoretically motivated weights:
SCMPI_t = w_1×Z_spread,t + w_2×Z_unemployment,t + w_3×Z_consumer,t + w_4×Z_debt,t
Default weights reflect the relative importance of each component based on empirical literature: credit spreads (35%), unemployment (25%), consumer credit (25%), and household debt (15%).
### 3.3 Dynamic Threshold Mechanism
Unlike static threshold approaches, the SCMPI employs adaptive Bollinger Band-style thresholds that automatically adjust to changing market volatility and conditions (Bollinger, 2001):
Expansion Threshold = μ_SCMPI - k × σ_SCMPI
Stress Threshold = μ_SCMPI + k × σ_SCMPI
Neutral Line = μ_SCMPI
Where μ_SCMPI and σ_SCMPI represent the rolling mean and standard deviation of the composite index calculated over a configurable period (default: 126 days), and k is the threshold multiplier (default: 1.0). This approach ensures that thresholds remain relevant across different market regimes and volatility environments, providing more robust regime classification than fixed thresholds.
### 3.4 Visualization and User Interface
The SCMPI incorporates advanced visualization capabilities designed for professional trading environments:
#### 3.4.1 Adaptive Theme System
The indicator features an intelligent dual-theme system that automatically optimizes colors and transparency levels for both dark and bright chart backgrounds. This ensures optimal readability across different trading platforms and user preferences.
#### 3.4.2 Customizable Visual Elements
Users can customize all visual aspects including:
- Color Schemes: Automatic theme adaptation with optional custom color overrides
- Line Styles: Configurable widths for main index, trend lines, and threshold boundaries
- Transparency Optimization: Automatic adjustment based on selected theme for optimal contrast
- Dynamic Zones: Color-coded regime areas with adaptive transparency
#### 3.4.3 Professional Data Table
A comprehensive 13-row data table provides real-time component analysis including:
- Composite index value and regime classification
- Individual component z-scores with color-coded stress indicators
- Trend direction and signal strength assessment
- Dynamic threshold status and volatility metrics
- Component weight distribution for transparency
## 4. Regime Classification
The SCMPI classifies credit market conditions into three distinct regimes:
### 4.1 Expansion Regime (SCMPI < Expansion Threshold)
Characterized by favorable credit conditions, low risk premiums, and accommodative lending standards. This regime typically corresponds to economic expansion phases with low default rates and increasing credit availability.
### 4.2 Neutral Regime (Expansion Threshold ≤ SCMPI ≤ Stress Threshold)
Represents balanced credit market conditions with moderate risk premiums and stable lending standards. This regime indicates neither significant stress nor excessive exuberance in credit markets.
### 4.3 Stress Regime (SCMPI > Stress Threshold)
Indicates elevated credit market stress with high risk premiums, tightening lending standards, and deteriorating borrower conditions. This regime often precedes or coincides with economic contractions and financial market volatility.
## 5. Technical Implementation and Features
### 5.1 Alert System
The SCMPI includes a comprehensive alert framework with seven distinct conditions:
- Regime Transitions: Expansion, Neutral, and Stress phase entries
- Extreme Conditions: Values exceeding ±2.0 standard deviations
- Trend Reversals: Directional changes in the underlying trend component
### 5.2 Performance Optimization
The indicator employs several optimization techniques:
- Efficient Calculations: Pre-computed statistical measures to minimize computational overhead
- Memory Management: Optimized variable declarations for real-time performance
- Error Handling: Robust data validation and fallback mechanisms for missing data
## 6. Empirical Validation
### 6.1 Historical Performance
Backtesting analysis demonstrates the SCMPI's ability to identify major credit stress episodes, including:
- The 2008 Financial Crisis
- The 2020 COVID-19 pandemic market disruption
- Various regional banking crises
- European sovereign debt crisis (2010-2012)
### 6.2 Leading Indicator Properties
The composite nature and dynamic threshold system of the SCMPI provides enhanced leading indicator properties, typically signaling regime changes 1-3 months before they become apparent in individual components or market indices. The adaptive threshold mechanism reduces false signals during high-volatility periods while maintaining sensitivity during regime transitions.
## 7. Applications and Limitations
### 7.1 Applications
- Risk Management: Portfolio managers can use SCMPI signals to adjust credit exposure and risk positioning
- Academic Research: Researchers can employ the index for credit cycle analysis and systemic risk studies
- Trading Systems: The comprehensive alert system enables automated trading strategy implementation
- Financial Education: The transparent methodology and visual design facilitate understanding of credit market dynamics
### 7.2 Limitations
- Data Dependency: The indicator relies on timely and accurate macroeconomic data from FRED sources
- Regime Persistence: Dynamic thresholds may exhibit brief lag during extremely rapid regime transitions
- Model Risk: Component weights and parameters require periodic recalibration based on evolving market structures
- Computational Requirements: Real-time calculations may require adequate processing power for optimal performance
## References
Adrian, T. & Brunnermeier, M.K. (2016). CoVaR. *American Economic Review*, 106(7), 1705-1741.
Bernanke, B. & Gertler, M. (1995). Inside the black box: the credit channel of monetary policy transmission. *Journal of Economic Perspectives*, 9(4), 27-48.
Bernanke, B., Gertler, M. & Gilchrist, S. (1999). The financial accelerator in a quantitative business cycle framework. *Handbook of Macroeconomics*, 1, 1341-1393.
Bisias, D., Flood, M., Lo, A.W. & Valavanis, S. (2012). A survey of systemic risk analytics. *Annual Review of Financial Economics*, 4(1), 255-296.
Bollinger, J. (2001). *Bollinger on Bollinger Bands*. McGraw-Hill Education.
Gilchrist, S. & Zakrajšek, E. (2012). Credit spreads and business cycle fluctuations. *American Economic Review*, 102(4), 1692-1720.
Illing, M. & Liu, Y. (2006). Measuring financial stress in a developed country: An application to Canada. *Journal of Financial Stability*, 2(3), 243-265.
Kaufman, G.G. & Scott, K.E. (2003). What is systemic risk, and do bank regulators retard or contribute to it? *The Independent Review*, 7(3), 371-391.
Kindleberger, C.P. (1978). *Manias, Panics and Crashes: A History of Financial Crises*. Basic Books.
Kiyotaki, N. & Moore, J. (1997). Credit cycles. *Journal of Political Economy*, 105(2), 211-248.
Mian, A. & Sufi, A. (2014). What explains the 2007–2009 drop in employment? *Econometrica*, 82(6), 2197-2223.
Minsky, H.P. (1986). *Stabilizing an Unstable Economy*. Yale University Press.
Mishkin, F.S. (1995). Symposium on the monetary transmission mechanism. *Journal of Economic Perspectives*, 9(4), 3-10.
Momentum Long + Short Strategy (BTC 3H)Momentum Long + Short Strategy (BTC 3H)
🔍 How It Works, Step by Step
Detect the Trend (📈/📉)
Calculate two moving averages (100-period and 500-period), either EMA or SMA.
For longs, we require MA100 > MA500 (uptrend).
For shorts, we block entries if MA100 exceeds MA500 by more than a set percentage (to avoid fading a powerful uptrend).
Apply Momentum Filters (⚡️)
RSI Filter: Measures recent strength—only allow longs when RSI crosses above its smoothed average, and shorts when RSI dips below the oversold threshold.
ADX Filter: Gauges trend strength—ensures we only enter when a meaningful trend exists (optional).
ATR Filter: Confirms volatility—avoids choppy, low-volatility conditions by requiring ATR to exceed its smoothed value (optional).
Confirm Entry Conditions (✅)
Long Entry:
Price is above both MAs
Trend alignment & optional filters pass ✅
Short Entry:
Price is below both MAs and below the lower Bollinger Band
RSI is sufficiently oversold
Trend-blocker & ATR filter pass ✅
Position Sizing & Risk (💰)
Each trade uses 100 % of account equity by default.
One pyramid addition allowed, so you can scale in if the move continues.
Commission and slippage assumptions built in for realistic backtests.
Stops & Exits (🛑)
Long Stop-Loss: e.g. 3 % below entry.
Long Auto-Exit: If price falls back under the 500-period MA.
Short Stop-Loss: e.g. 3 % above entry.
Short Take-Profit: e.g. 4 % below entry.
🎨 Why It’s Powerful & Customizable
Modular Filters: Turn on/off RSI, ADX, ATR filters to suit different market regimes.
Adjustable Thresholds: Fine-tune stop-loss %, take-profit %, RSI lengths, MA gaps and more.
Multi-Timeframe Potential: Although coded for 3 h BTC, you can adapt it to stocks, forex or other cryptos—just recalibrate!
Backtest Fine-Tuned: Default settings were optimized via backtesting on historical BTC data—but they’re not guarantees of future performance.
⚠️ Warning & Disclaimer
This strategy is for educational purposes only and designed for a toy fund. Crypto markets are highly volatile—you can lose 100 % of your capital. It is not a predictive “holy grail” but a rules-based framework using past data. The parameters have been fine-tuned on historical data and are not valid for future trades without fresh calibration. Always practice with paper-trading first, use proper risk management, and do your own research before risking real money. 🚨🔒
Good luck exploring and experimenting! 🚀📊
Big Mover Catcher BTC 4h🧠 Big Mover Catcher (BTC 4H Strategy) — Educational Tool
⚠️ Disclaimer: I am not a financial advisor. This script is for educational and testing purposes only. Cryptocurrency trading is highly volatile and involves significant risk. You can lose all of your invested capital.
📌 Overview
The Big Mover Catcher strategy is a work-in-progress trading system designed for Bitcoin (BTC) on the 4-hour chart. It aims to identify strong breakout moves by combining multiple technical indicators and conditions, allowing for high customization and filter-based confirmations.
This script is part of a personal project to learn Pine Script and backtesting on TradingView. It is currently in the testing and research phase.
🎯 Strategy Objective
Catch large, high-momentum breakout moves in the BTC market using:
Bollinger Band breakouts for entry signals
Momentum, volatility, and trend filters for trade confirmation
🧰 Features & Filters
The script provides a flexible set of filters that can be turned ON/OFF and adjusted directly from the settings panel:
✅ Entry Conditions
Price must break above or below Bollinger Bands
All selected filters must align before entry
🧪 Available Filters:
Relative Strength Index (RSI) with EMA/SMA smoothing
Average Directional Index (ADX) with EMA/SMA smoothing
Average True Range (ATR) with EMA/SMA smoothing
MACD Signal above or below zero
EMA 350 trend filter
ATR / ADX / RSI Threshold toggles for added control
🔥 Additional Feature:
Force Take Profit: Optionally closes the trade immediately if a candle closes with more than a defined % movement (default: 5%). This can help lock in quick profits during high volatility moves.
⚙️ Customizable Inputs
You can configure:
Stop loss percentage
All indicator lengths
Smoothing types (EMA/SMA)
Threshold activation toggles
Individual filter ON/OFF switches
This makes the strategy highly adaptable for educational exploration and optimization.
📊 Best Used For
Learning Pine Script and strategy structure
Testing filter combinations for BTC on the 4H timeframe
Understanding how different indicators interact in live markets
⚠️ Note: ❌ Short trades are currently disabled by default, as short-side logic is still under development.
❗ Final Reminder
This script is not financial advice. It is an educational tool. Use it to learn and explore trading logic. Trading cryptocurrencies carries high risk — only invest what you can afford to lose.
50-Week High Entry / 40-Week Low Exit StrategyThis is a simple long term strategy
Entry condition : You will enter the market when the stock’s current high exceeds its 50-week high. This condition enables you to identify upward momentum and capitalize on potential price surges.
Exit condition
Conversely, you will exit the market when the stock’s current low drops below its 40-week low. This exit strategy helps protect your capital by ensuring you withdraw from losing positions before further declines in price occur.
This trading strategy relies on the Donchian Channel indicator to monitor the relevant 50-week high and 40-week low levels. Given that this is a weekly trading strategy, all backtesting will be conducted using weekly timeframes.
[TehThomas] - Fair Value GapsThis script is designed to automatically detect and visualize Fair Value Gaps (FVGs) on your chart in a clean, intuitive, and highly responsive way. It’s built with active traders in mind, offering both dynamic updates and customization options that help you stay focused on price action without being distracted by outdated or irrelevant information.
What Are Fair Value Gaps?
Fair Value Gaps are areas on a chart where there’s an inefficiency in price, typically formed when price moves aggressively in one direction, leaving a gap between the wicks of consecutive candles. These gaps represent imbalanced price action where not all buy or sell orders were efficiently matched. As a result, they often become magnet zones where price returns later to "fill" the imbalance before continuing in its intended direction. Many traders use them as points of interest for entries, re-entries, or anticipating reversals and consolidations.
This concept is frequently used in Smart Money and ICT-based trading models, where understanding how price seeks efficiency is crucial to anticipating future moves. When combined with concepts like liquidity, displacement, and market structure, FVGs become powerful tools for technical decision-making.
Script Features & Functionality
1. Live Updating Gaps (Dynamic Shrinking)
One of the core features of this script is its ability to track and dynamically shrink Fair Value Gaps as price trades into them. Instead of leaving a static zone on your chart, the gap will adjust in real-time, reflecting the portion that has been filled. This gives you a much more accurate picture of remaining imbalance and avoids misleading zones.
2. Automatic Cleanup After Fill
Once price fully fills an FVG, the script automatically removes it from the chart. This helps keep your workspace clean and focused only on relevant price zones. There’s no need to manually manage your gaps, everything is handled behind the scenes to reduce clutter and distraction.
3. Static Mode Option
While dynamic updating is the default, some traders may prefer to keep the original size of the gap visible even after partial fills. For that reason, the script includes a toggle to switch from live-updating (shrinking) mode to static mode. In static mode, FVGs stay fixed from the moment they are drawn, giving you a more traditional visual reference point.
4. Multi-Timeframe Support (MTF)
You can now view higher timeframe FVGs, such as those from the 1H or 4H chart, while analyzing lower timeframes like the 5-minute. This allows you to see key imbalances from broader market context without having to flip between charts. FVGs from higher timeframes will be drawn distinctly so you can differentiate them at a glance.
5. Cleaner Visualization
The script is designed with clarity in mind. All drawings are streamlined, and filled gaps are removed to maintain a minimal, distraction-free chart. This makes it easier to combine this tool with other indicators or price-action-based strategies without overloading your workspace.
6. Suitable for All Market Types
This script can be used on any asset that displays candlestick-based price action — including crypto, forex, indices, and stocks. Whether you're scalping low-timeframe setups or swing trading with a higher timeframe bias, FVGs remain a useful concept and this script adapts to your trading style.
Use Case Examples
On a 5-minute chart, display 1-hour FVGs to catch major imbalance zones during intraday trading.
Combine the FVGs with liquidity levels and inducement patterns to build ICT-style trade setups.
Use live-updating gaps to monitor in-progress fills and evaluate whether a zone still holds validity.
Set the script to static mode to perform backtesting or visual replay with historical setups.
Final Notes
Fair Value Gaps are not a standalone trading signal, but when used with market structure, liquidity, displacement, and order flow concepts, they provide high-probability trade locations that align with institutional-style trading models. This script simplifies the visualization of those zones so you can react faster, stay focused on clean setups, and eliminate unnecessary distractions.
Whether you’re trading high volatility breakouts or patiently waiting for retracements into unfilled imbalances, this tool is designed to support your edge with precision and flexibility.
Alert TrendThis indicator is designed to function as a dynamic BIAS tool but can be adapted to various strategies depending on user needs.
Key Features and Integration:
Personally, I pair it with the "EMA Suite" indicator, as my strategy revolves around Fibonacci-based moving averages. The indicator uses EMA 55 and EMA 233 as trend references, triggering a trend shift when a candle closes fully above or below these levels. To maintain structural integrity, the EMA values are not user-configurable in the settings: adjustments require direct script modification (e.g., switching to EMA 50 and EMA 200, widely recognized reference levels), this ensures logical consistency for advanced users familiar with Pine Script.
Output Signals and Interpretation:
The indicator generates four distinct signals:
1. Uptrend: Candle closes above both EMA 55 and EMA 233.
2. Weak Uptrend: Candle closes above EMA 55 but below EMA 233.
3. Downtrend: Candle closes below both EMA 55 and EMA 233.
4. Weak Downtrend: Candle closes below EMA 55 but above EMA 233.
The area between the two EMAs represents a "complex zone" where price action contradicts higher timeframe trends. To resolve ambiguity, combine this indicator with a primary timeframe (e.g., H4) and a confirmation timeframe (e.g., H1). In smaller timeframes may also serve as entry signals, a feature currently under exploration for automation.
Alert System and Strategy Integration:
The indicator includes customizable alerts for all four signals collectively or individually, streamlining integration into Strategy scripts. This flexibility enhances adaptability for backtesting or live trading.
Critical Note:
Configure the indicator to display exclusively on the selected timeframe. Higher intervals fail to render all signals due to overlapping visualizations, distorting analysis. To resolve this, set the visibility parameter to "Visibility on intervals/Current interval and below" in the chart settings. This ensures clarity and preserves signal accuracy.
Development Status and Collaboration:
As part of an ongoing project, this tool is already integrated into my personal strategy. While functional and publicly shareable, further refinements are planned. Though not a professional developer, I utilize Deepseek for coding assistance and possess sufficient Pine Script literacy to oversee the logic. Feedback, suggestions, and collaborations are welcome to optimize its utility.
I hope this tool proves valuable to fellow traders navigating multi-timeframe analysis and trend confirmation.
Support BandsSupport Bands – Discount Zones for Bitcoin
⚡Overview:
-The Support Bands indicator identifies one of the most tested and respected support zones for Bitcoin using moving averages from higher timeframes.
-These zones are visualized through colored bands (blue, white, and violet), simplifying the decision making process especially for less experienced traders who seek high-probability areas to accumulate Bitcoin during retracements.
-Band levels are based on manual backtesting and real-world price behavior throughout Bitcoin’s history.
-Each zone reflects a different degree of support strength, from temporary pullback zones to historical bottoms.
⚡️ Key Characteristics:
-Highlights discount zones where Bitcoin has historically shown strong reactions.
-Uses 3 different levels of supports based on EMA/SMA combinations.
-Offers a clean, non-intrusive overlay that reduces chart clutter.
⚡ How to Use:
-Open your chart on the 1W timeframe and select the BTC Bitstamp or BLX symbol, as they provide the most complete historical data, ensuring optimal performance of the indicator.
-Use the bands as reference zones for support and potential pullbacks.
- Level 3 (violet band) historically marks the bottom of Bitcoin bear markets and is ideal for long-term entries during deep corrections.
- Level 2 (white band) often signals macro reaccumulation zones but usually requires 1–3 months of consolidation before a breakout. If the price closes below and then retests this level as resistance for 1–2 weekly candles, it often marks the start of a macro downtrend.
-Level 1 (blue band) acts as short-term support during strong bullish moves, typically after a successful rebound from Level 2.
⚡ What Makes It Unique:
- This script merges moving averages per level into three simplified bands for clearer analysis.
-Reduces chart noise by avoiding multiple overlapping lines, helping you make faster and cleaner decisions.
- Built from manual market study based on recurring Bitcoin behavior, not just random code.
-Historically backtested:
-Level 3 (violet band) until today has always marked the bitcoin bearmarket bottom.
- Level 2 (white band) is the strongest support during bull markets; losing it often signals a macro trend reversal.
- Level 1 is frequently retested during impulsive rallies and can act as short-term support or resistance.
⚡ Disclaimer:
-This script is a visual tool to assist with market analysis.
-It does not generate buy or sell signals, nor does it predict future movements.
-Historical performance is not indicative of future results.
-Always use independent judgment and proper risk management.
⚡ Why Use Support Bands:
-Ideal for traders who want clarity without dozens of lines on their charts.
- Helps identify logical zones for entry or reaccumulation.
- Based on actual market behavior rather than hypothetical setups.
-If the blue band (Level 1) doesn't hold as support, the price often moves to the white band (Level 2), and if that fails too, the violet band (Level 3) is typically the last strong support. By dividing your capital into three planned entries, one at each level,you can manage risk more effectively compared to entering blindly without this structure.
[blackcat] L3 Volume Sync TradeOVERVIEW
The L3 Volume Sync Trade indicator empowers traders 📈💹 with advanced tools to pinpoint precise entry and exit points leveraging intricate volume and price momentum analyses. By encapsulating sophisticated technical calculations into an intuitive visual format, this script aids in identifying high-probability trades while minimizing guesswork. Whether you're a seasoned trader looking to enhance your strategy or a newcomer seeking structured guidance, this indicator offers invaluable insights tailored to elevate your trading precision.
FEATURES
Advanced Volume Analysis 📊✨: Employs comprehensive volume dynamics to spot underlying market trends and resonance levels, allowing you to align your trades with significant movements.
Dynamic Price Momentum Metrics ⚡️: Computes both immediate and sustained price strengths, providing a holistic view of market directionality.
Customizable Indicators 🎯: Adjustable periods across multiple moving averages ensure flexibility in adapting the script to diverse trading styles and timeframes.
Intuitive Visual Representation 🖼️: Displays critical information via colorful histograms and candlestick patterns, facilitating quick comprehension even amidst fast-paced markets.
Automated Buy/Sell Labels 🔍: Clearly marks chart locations where buy/sell actions are recommended, reducing the need for constant manual monitoring.
Real-Time Alert Capabilities 🔔: Stay ahead with customizable alerts that notify you instantly whenever favorable trading conditions arise.
HOW TO USE
Initial Setup:
Begin by adding the L3 Volume Sync Trade indicator to your TradingView chart.
Familiarize yourself with the default settings provided within the script’s input parameters.
Configuring Input Parameters:
Short Period: Adjust if focusing on shorter-term fluctuations; defaults at 5 bars.
Long Period: Ideal for capturing broader trends over extended intervals; set initially at 27 bars.
EMA and SMA Periods: Tweak these for fine-tuning the sensitivity of trend-following mechanisms; default values are 3 and 3 respectively.
Long/EMA Periods: These influence smoothing effects; start with 360 and 21 respectively but experiment based on volatility.
Capital Threshold: Defines minimal risk level per trade; default set at 1 unit but can be increased/decreased based on your risk appetite.
Understanding Chart Elements:
Histograms & Candles: Blue/green histograms represent positive-negative resonances, red/green bands signify crossover events, aqua candles denote resonance points, orange highlights trade signals.
Labels: Green “BUY” tags appear above bars indicating bullish conditions; red “SELL” tags below bars suggest bearish reversals.
Activating Alarms:
Go to the alert settings in TradingView.
Enable conditional alerts for buy/sell signals ensuring timely responses without missing crucial moves.
Monitoring Performance:
Keep track of how often alerts trigger versus actual winning trades.
Periodically revisit input adjustments to optimize responsiveness under varying market phases.
ADVANCED USAGE TIPS
Backtesting Your Strategy: Before going live, apply historical data tests to gauge reliability.
Combining With Other Tools: Enhance accuracy by integrating additional indicators like RSI or MACD alongside Volume Sync.
Risk Management Integration: Use stop-loss/take-profit markers derived from script outputs to safeguard capital efficiently.
LIMITATIONS
Market Conditions Variability: Different assets or volatile environments might yield inconsistent outcomes.
Dependent On User Expertise: Best utilized by those familiar with technical analysis fundamentals.
Limited Flexibility In Real-time Adjustments: Once applied, real-time tweaking requires reloading script which might delay responses during rapid market shifts.
NOTES
Parameter Sensitivity: Minor changes can lead to drastic differences; always test modifications cautiously.
Regular Reviews: Continuously assess indicator efficacy against evolving market behaviors.
Complementary Techniques: Supplement this script with fundamental analysis or news-driven insights for well-rounded decisions.
THANKS
A heartfelt acknowledgment goes to our community of developers and enthusiasts whose feedback has been instrumental in refining this powerful indicator.
Anomaly Counter-Trend StrategyA mean-reversion style strategy that automatically spots unusually large price moves over a configurable lookback period and takes the opposite side, with full risk-management, commission and slippage modeling—built in Pine Script® v6.
🔎 Overview
ACTS monitors the percent-change over the past N minutes and, when that move exceeds your chosen threshold, enters a counter-trend position (short on a strong rise; long on a sharp fall). It’s ideal for markets that often “overshoot” and snap back, and can be applied on any symbol or timeframe.
⚙️ Key Features
Anomaly Detection: Detect abnormal price swings based on a user-defined % change over a lookback period.
Counter-Trend Entries: Auto-enter short on rise anomalies, long on fall anomalies (with seamless flat↔reverse transitions).
Risk Management: Configurable stop-loss and take-profit in ticks per trade.
Realistic Modeling: Simulates commissions (0.05 % default), slippage (2 ticks), and percent-of-equity sizing.
Immediate Bar-Close Execution: Orders processed on bar close for faster fills.
Visual Aids: Optional on-chart BUY/SELL triangles and background highlights during anomaly periods.
⚙️ Inputs
Input Default Description
Percentage Threshold (%) 2.00 Min % move over lookback to trigger an anomaly.
Lookback Period (Minutes) 15 Number of minutes over which to measure change.
Stop Loss (Ticks) 100 Distance from entry for stop-loss exit.
Take Profit (Ticks) 200 Distance from entry for take-profit exit.
Plot Trade Signal Shapes (on/off) true Show BUY/SELL triangles on chart.
Highlight Anomaly Background true Shade background during anomaly bars.
📊 How to Use
Add to Chart: Apply the script to any ticker & timeframe.
Tune: Adjust your percentage threshold and lookback to match each instrument’s volatility.
Review Backtest: Check built-in strategy performance (drawdown, Sharpe, etc.) under the Strategy Tester tab.
Go Live: Once optimized, link to alerts or your trade execution system.
⚠️ Disclaimer
This script is provided “as-is” for educational purposes and backtesting only. Past performance does not guarantee future results. Always backtest thoroughly, manage your own risk, and consider market conditions before live trading.
Enjoy experimenting—and may your counter-trend entries catch the next big snapback!
SuperTrade ST1 StrategyOverview
The SuperTrade ST1 Strategy is a long-only trend-following strategy that combines a Supertrend indicator with a 200-period EMA filter to isolate high-probability bullish trade setups. It is designed to operate in trending markets, using volatility-based exits with a strict 1:4 Risk-to-Reward (R:R) ratio, meaning that each trade targets a profit 4× the size of its predefined risk.
This strategy is ideal for traders looking to align with medium- to long-term trends, while maintaining disciplined risk control and minimal trade frequency.
How It Works
This strategy leverages three key components:
Supertrend Indicator
A trend-following indicator based on Average True Range (ATR).
Identifies bullish/bearish trend direction by plotting a trailing stop line that moves with price volatility.
200-period Exponential Moving Average (EMA) Filter
Trades are only taken when the price is above the EMA, ensuring participation only during confirmed uptrends.
Helps filter out counter-trend entries during market pullbacks or ranges.
ATR-Based Stop Loss and Take Profit
Each trade uses the ATR to calculate volatility-adjusted exit levels.
Stop Loss: 1× ATR below entry.
Take Profit: 4× ATR above entry (1:4 R:R).
This asymmetry ensures that even with a lower win rate, the strategy can remain profitable.
Entry Conditions
A long trade is triggered when:
Supertrend flips from bearish to bullish (trend reversal).
Price closes above the Supertrend line.
Price is above the 200 EMA (bullish market bias).
Exit Logic
Once a long position is entered:
Stop loss is set 1 ATR below entry.
Take profit is set 4 ATR above entry.
The strategy automatically exits the position on either target.
Backtest Settings
This strategy is configured for realistic backtesting, including:
$10,000 account size
2% equity risk per trade
0.1% commission
1 tick slippage
These settings aim to simulate real-world conditions and avoid overly optimistic results.
How to Use
Apply the script to any timeframe, though higher timeframes (1H, 4H, Daily) often yield more reliable signals.
Works best in clearly trending markets (especially in crypto, stocks, indices).
Can be paired with alerts for live trading or analysis.
Important Notes
This version is long-only by design. No short positions are executed.
Ideal for swing traders or position traders seeking asymmetric returns.
Users can modify the ATR period, Supertrend factor, or EMA filter length based on asset behavior.
[blackcat] L3 Market Pulse InsightOVERVIEW
The L3 Market Pulse Insight provides comprehensive analytics by evaluating key price metrics to reveal critical market sentiment and potential trade opportunities 📊🔍. This advanced indicator leverages proprietary calculations involving Simple Moving Averages (SMAs), Exponential Moving Averages (EMAs), and custom thresholds to deliver detailed insights into current market dynamics 🚀✨.
By plotting various lines representing core fundamentals and directional cues, traders gain visibility into underlying trends and shifts within the market pulse. The visual aids simplify complex data interpretation, making it easier for users to make strategic decisions based on clear, actionable information ✅⛈️.
FEATURES
Advanced Calculation Techniques:
Employs sophisticated formulas integrating SMAs and EMAs for precise trend analysis.
Incorporates fundamental lines and confirmations based on recent price extremes.
Comprehensive Visualization:
Plots multiple informational lines: Fundamental Line, Thresholds, Institutional Directions, etc., each reflecting unique aspects of price behavior.
Uses distinct colors for easy differentiation between bearish and bullish indications.
Customizable Alerts:
Generates "Buy" and "Sell" labels at pivotal moments, highlighting entry/exit points visually.
Offers flexibility to modify alert styles and positions according to user preferences.
Dynamic Adaptability:
Continuously updates plots and alerts based on incoming real-time data for timely responses.
Provides dynamic support/resistance levels adapting to evolving market conditions.
HOW TO USE
Installing the Indicator:
To start using the L3 Market Pulse Insight, add it via the Pine Editor on TradingView:
Open the editor from the bottom panel.
Copy-paste the provided script code.
Click “Add to Chart” after pasting.
Understanding Key Lines:
Familiarize yourself with what each plotted line signifies:
Fundamental Line: Represents core price movements adjusted through SMA transformations.
Low Confirmation & Warnings: Provide early signals about potential reversals or continuation scenarios.
Threshold B: Acts as a significant barrier indicating overbought/sold conditions.
Institutional Directions: Offer insights into larger player activities and intentions.
Interpreting Signals:
Pay close attention to generated "Buy" and "Sell" labels appearing directly on your chart:
"Buy" Label: Indicates favorable momentum crossing from below the confirmation level upwards.
"Sell" Label: Suggests bearish transitions when moving beneath set thresholds.
Adjusting Parameters:
While this version primarily uses default settings derived from optimal testing ranges, feel free to experiment:
Modify lookback periods in SMA/EMA functions if different timeframes align better with your strategy.
Customize plot colors/styles for enhanced readability and personal taste.
Integrating with Other Tools:
Enhance the reliability of signals produced by combining them with complementary indicators like RSI, MACD, or volume profiles for thorough validation.
Continuous Monitoring:
Regularly review performance and refine strategies incorporating insights gathered from L3 Market Pulse Insight across varying markets and assets.
LIMITATIONS
Data Dependency: Performance heavily relies on accurate historical data without anomalies.
Market Conditions Variability: Effectiveness may vary during extreme volatility or thin liquidity environments.
Parameter Fine-Tuning: Optimal configuration might differ significantly across instruments; continuous adjustments are necessary.
No Guarantees: Like any tool, this doesn't ensure profits and should be part of a broader analytical framework.
NOTES
Ensure solid grounding in technical analysis principles before deploying solely upon these insights.
Utilize backtesting rigorously under diverse market cycles to assess robustness thoroughly.
Consider external factors such as economic reports, geopolitical events influencing asset prices beyond purely statistical models.
Maintain discipline adhering predefined risk management protocols regardless of signal strength displayed here.
THANKS
We appreciate every member's contributions who have engaged actively throughout our development journey, offering constructive feedback driving improvements continually 🙏. Together we strive toward creating ever-more robust tools empowering traders worldwide!