EMA 19/91 Cross + Candle Confirm + 91 Trend FilterSimple Average Strategy Gives signal to buy and sell u wukll get another warning no doubt but i cannot add alert untill it is publishedStrategia Pine Script®di boption4mzrj0
ORB MASTER V10 - AUTOPILOTThis is a custom-built Opening Range Breakout (ORB) Algorithm designed for US Futures (NQ, MNQ, ES). It features an automated dynamic Risk Management System (Auto SL & TP), a smart Chandelier Trailing Stop, and a Multi-Timeframe Trend Filter (EMA 200). Perfect for the 15:30 NY Open.Strategia Pine Script®di Frank211
WindsThis is a 5-minute trading strategy designed for gold, incorporating trend filtering, entry signals, and fixed percentage risk management (stop-loss and take-profit). It includes visual aids such as position range boxes and cost lines to enhance trade monitoring. The strategy aims to capture short-term price movements while maintaining clear risk control and visual feedback for traders.Strategia Pine Script®di winds110
ORB StrategyOpening Range Break Strategy. It works, sometimes. Stop loss to break even is not currently working, dont rely on that. To be honest in backtesting, it hurt more than it helped. The ORB strategy has been around for a long time; it has ebbs and flows on when it is working. You'll know that it's currently working because your Youtube feed will be full of videos for it. Native Quantlynk and Ghost integration using {{strategy.order.alert_message}} NOT FINANCIAL ADVICE. NO GUARANTEES OF ANY KIND. Strategia Pine Script®di greatestNothing20
Volume ScalperScalping strategy; Only tested it on the 1 and 2 MNQ. Good luck. Native Quantlynk and Ghost alerts using {{strategy.order.alert_message}} NOT FINANCIAL ADVICE. NO GUARANTEES OF ANY KIND. Strategia Pine Script®di greatestNothing17
TSM RSI Shift Zone StrategyTSM RSI Shift Zone Strategy is a momentum-based system using RSI shift levels. Enters Long after RSI crosses above 70 and confirms momentum. Enters Short after RSI crosses below 30 and confirms momentum. Exits when RSI crosses 50 or optional SL/TP is hit. Designed for trending markets. Trading involves risk.Strategia Pine Script®di SARAVANANTamilShareMarket2
TSM RSI Shift Zone Strategy [Converted]This strategy is a momentum breakout system based on RSI levels. It enters long when RSI crosses above 70 (strong bullish momentum). It enters short when RSI crosses below 30 (strong bearish momentum). It exits trades when RSI crosses back through 50 (momentum weakening). Optional stop loss and take profit can be enabled. It trades strength and weakness breakouts — not reversals.Strategia Pine Script®di SARAVANANTamilShareMarket3
Nasdaq Liquidity Fade Engine (NLFE)Summary in one paragraph Nasdaq Liquidity Fade Engine is a daily timeframe strategy for Nasdaq index futures and close proxies such as NQ, MNQ, and NDX. It is designed to act only when a small set of tape, mean location, and trend energy conditions align, and it expresses risk using an ATR sized bracket so the same settings scale across NQ and MNQ. It is original because it can optionally anchor its signal feed to a single continuous Nasdaq tape while executing on related instruments, reducing symbol noise when you want one consistent decision stream. Add it to a clean chart and read entries and exits from the built in strategy markers. Orders confirm on bar close, so markers settle on close. Scope and intent • Markets. NQ, MNQ, NDX, and other highly liquid Nasdaq linked instruments • Timeframes. Primarily daily, other timeframes are supported but not the optimization target • Default demo used in the publication. CME_MINI:NQ1! on 1D • Purpose. Provide a compact, auditable daily decision engine for Nasdaq instruments with explicit volatility scaled risk • Limits. This is a strategy. Orders are simulated by the TradingView engine on standard candles only Originality and usefulness This is not a stack of common indicators. It is a minimal asymmetric rule set with a portability layer. • Unique concept or fusion. Optional tape anchored signal feed plus asymmetric long and short gating plus ATR normalized risk brackets • What failure mode it addresses. Reduces discretionary over trading by restricting entries to specific tape states and by enforcing a hard stop framework instead of indefinite holds • Portable yardstick. ATR on the traded symbol is the common unit for stop and target sizing across NQ and MNQ • Protected scripts. The implementation is protected to reduce low effort cloning and to preserve version integrity, while the method and practical use are disclosed here Method overview in plain language The strategy evaluates a small set of state conditions on each bar. It uses a selected signal feed for its tape inputs and applies risk on the traded chart symbol. Long and short are intentionally asymmetric to reflect Nasdaq drift and downside behavior. Base measures • Tape state. Candle direction and relative participation measured from the selected signal feed • Mean location. A rolling mean reference used to define location and fade context • Trend energy. A trend strength filter used to avoid low quality fades • Risk unit. ATR of the traded symbol used as a volatility scaled sizing unit for exits Components • Tape contraction state. Detects low participation pullback behavior on the signal feed. Used to qualify long opportunity context in a way that is not tied to a fixed point value. • Mean location state. Uses a rolling mean reference to avoid taking fades in the wrong location regime. • Trend energy gate. Uses a trend strength threshold to require sufficient directional energy when the short side activates. • ATR bracket risk. Uses ATR multiples for stop and target distances on the traded symbol, keeping risk scalable across NQ and MNQ. Fusion rule The model uses two separate gate sets. Long and short do not share identical prerequisites. The intent is to capture pullback opportunity under contraction while only enabling shorts when location and energy align. Signal rule • Long suggestion appears when the tape state indicates a contraction style pullback and the regime filter is satisfied • Short suggestion appears when the tape state indicates a fadeable push that is location constrained under the mean reference and trend energy is above the threshold • Long only mode disables opening shorts, while still allowing the short condition to flatten an open long • Long and short mode allows directional flips when the opposite condition triggers Inputs with guidance Setup • Use NQ as signal source. When enabled, the tape inputs are sourced from the chosen NQ feed so signals can remain consistent across NQ, MNQ, and NDX charts. When disabled, tape inputs come from the chart symbol. • NQ symbol. The anchor feed used when signal sourcing is enabled. • Signal timeframe. Blank uses the chart timeframe. For the intended daily workflow, use 1D. Logic • EMA length. Typical range 10 to 60. Higher values smooth the mean reference and reduce sensitivity. Lower values increase responsiveness. • Start year filter. Use to constrain testing to the regime you want to study. Defaults reflect the post 2008 regime focus. Filters • ADX length and smoothing. Typical range 10 to 20. Shorter reacts faster and can increase churn. • ADX minimum. Typical range 15 to 30. Raising it filters shorts and concentrates on higher energy phases. Risk • Use ATR stop and target. Enables ATR sized bracket exits. • ATR length. Typical range 10 to 21 on daily. • Stop ATR multiple. Typical range 0.3 to 2.5. Raising it gives more room and increases risk per trade. • Target ATR multiple. Typical range 4 to 30 for more frequent targets. Very large values behave like an expansion capture mode where exits are dominated by the stop or by an opposite regime switch rather than by the target. Properties visible in this publication • Initial capital for the example. 100000 • Base currency. USD • request.security uses lookahead off everywhere • Strategy only. Default order size method Fixed with value 1 contract. Pyramiding 0. Commission 5 USD per contract. Slippage 5 ticks. Process orders on close On. Bar magnifier Off. Recalculate after order is filled Off. Calc on every tick Off. Realism and responsible publication • No performance claims. Past results never guarantee future outcomes • Execution varies by venue, liquidity, and volatility • Orders process on bar close and fills use TradingView engine assumptions • Non standard chart types are not supported for strategies Honest limitations and failure modes • This is optimized for the daily timeframe. Intraday use can change signal frequency and behavior materially. • If you enable tape anchoring, volume and candle state come from the selected feed. This can be useful for consistency, but it also means the tape input is not the same as the executed symbol for instruments with different session structures or synthetic volume. • Very quiet regimes can reduce signal contrast. Consider longer lengths or higher thresholds. • Gap heavy periods can change stop and target behavior. • If both stop and target are inside the same bar range, fills follow standard candle assumptions. Legal Education and research only. Not investment advice. You are responsible for your decisions. Test on historical data and in simulation before any live use. Use realistic costs. Strategia Pine Script®di exlux4
Liquidity Swings SOL V10.2 - 3CommasHere's a publish-ready description: Liquidity Swings — Smart Money Sweep Strategy Automated futures strategy that identifies and trades institutional liquidity sweeps on SOLUSDT 30-minute charts. How it works: Price tends to sweep above/below key swing levels where stop losses cluster — these are liquidity zones. Smart money grabs this liquidity, then reverses. This strategy detects those sweeps and enters on the reversal. Features: Liquidity zone detection using pivot-based swing highs/lows Multi-layer trend filtering (HTF EMA + local EMA cross + price action) Breakout detection with volume confirmation Zone-based & ATR-adaptive stop losses with safety cap Trailing stop with activation threshold Cascading partial take profits at opposing zones Optimized for SOL's volatility profile Designed for: SOLUSDT Perpetual Futures (Bybit) 30-minute timeframe 5x leverage, cross margin Compatible with 3Commas / WunderTrading webhook automation Risk management built-in: Every trade has a hard stop loss, safety cap, and optional trailing stop. No open-ended positions. ⚠️ Invite-only. DM for access.Strategia Pine Script®di lonrot2
Tribute To Peter LynchTribute To Peter Lynch - Fund Manager Simulator "Know what you own, and know why you own it." - Peter Lynch WHO WAS PETER LYNCH? Peter Lynch is one of the greatest investors who ever lived. From 1977 to 1990, he managed the Fidelity Magellan Fund and turned it from $18 million into $14 billion in assets. He averaged a 29.2% annual return for 13 straight years, making Magellan the best-performing mutual fund in the world. What made Lynch different? He believed regular people could beat Wall Street. He bought stocks in companies he understood - he'd ask minivan owners at movie theaters what they thought of their Chrysler, he'd notice the local factory hiring more people, he'd pay attention to which donut shop had the longest line. He called this your "investor's edge" - the things you already know from your daily life that Wall Street analysts sitting in their offices can't see. Lynch famously said: "If you can tell your stock story to a fifth grader and they understand it, you've got a good one. The more complicated the story, the more likely it is to fall apart." He also had the stomach for downturns. During his 13 years at Magellan, the market dropped 10% or more NINE times, and Magellan fell right along with it every single time. But he never panicked. He knew that behind every stock is a company, and if the company is doing well, the stock will eventually follow. WHAT THIS SCRIPT DOES This is a fund manager simulator built entirely around Peter Lynch's investing philosophy. It's not a technical indicator. There are no moving averages, no RSI, no MACD. Lynch was a fundamental investor - he cared about what a company earns, how fast it's growing, how much debt it has, and whether the story makes sense. The script classifies any stock into one of Lynch's 6 categories, scores it on a 0-100 Lynch Score, evaluates the fundamental story, and generates buy/sell signals based purely on the same criteria Lynch used at Magellan. THE 6 STOCK CATEGORIES Lynch believed you can't treat all stocks the same. A 50% gain on a Slow Grower is fantastic and probably time to sell. The same 50% on a Fast Grower could be just the beginning of a 10-bagger. He broke every stock into 6 categories: 1. FAST GROWERS (20%+ earnings growth) Companies growing earnings fast, typically small to mid-sized. These are the potential 10-baggers. Lynch looked for PEG ratios below 1.0 and used his "baseball inning" concept - you want to buy these in innings 2-5, when the formula is proven but there's still a long runway ahead. Think of Walmart when it only had a few hundred stores, or Microsoft 3 years after its IPO. 2. SLOW GROWERS (3-8% earnings growth) Large, mature companies that grow about as fast as the overall economy. You buy these for the dividend. Lynch looked for steady, rising dividends with a low payout ratio (so the dividend is safe). If the dividend yield drops or the payout ratio gets too high, it's time to move on. 3. STALWARTS (10-14% earnings growth) Big, solid companies that aren't going to disappear but aren't going to triple overnight either. Lynch's rule: take your 30-50% gain and rotate the money into another Stalwart. These are your portfolio's defense - they hold up in recessions and won't go bankrupt. 4. CYCLICALS (tied to the economic cycle) Companies in industries like autos, airlines, steel, and chemicals that boom and bust with the economy. Here's Lynch's counterintuitive trick: buy cyclicals when the PE is HIGH (that means earnings are at the trough and about to recover) and sell when the PE is LOW (earnings have peaked and are about to fall). This is the opposite of how PE works for every other category. 5. TURNAROUNDS (beaten down, potential recovery) Companies in deep trouble that might recover. Lynch always checked: does this company have enough cash to survive? Is there a real plan (new management, cost cutting, selling bad divisions)? He said don't buy on hope - wait for actual evidence the turnaround is working. But when they work, the upside can be enormous. 6. ASSET PLAYS (hidden value) Companies sitting on assets the market doesn't see or doesn't value - real estate, patents, brand names, cash on the balance sheet. Lynch's example: Disney after it opened Epcot. Growth slowed, but the company was sitting on the Disney name, all that Florida land, and a library of characters worth billions that were carried on the books for nothing. BAR REPLAY - WHERE THIS SCRIPT REALLY SHINES This script was built with TradingView's Bar Replay feature in mind. Bar Replay is what transforms this from a backtest into a fund manager simulator. HOW TO USE BAR REPLAY: 1. Add the script to your chart 2. Pick any stock and classify it (Fast Grower, Stalwart, etc.) 3. Set your fundamental inputs if using Manual mode, or let Auto mode pull TradingView financial data 4. Click the Bar Replay button on your toolbar (the clock icon with a rewind arrow) 5. Pick a starting date - maybe go back 5 years, or 10, or start right before a crash 6. Press Play and watch the simulation unfold bar by bar WHAT YOU'LL SEE IN BAR REPLAY: - The Lynch Score updates in real time as fundamentals change each quarter - The Story Status shifts: "Growth Accelerating" might become "Growth Slowing" as the company matures - Buy and sell signals fire when Lynch's criteria are met - The P&L tracker shows your position gain in real time - The Peter Lynch portrait in the corner changes color based on how your portfolio is doing: -- Equity rising: Lynch appears in bright GREEN against a deep BLUE background, getting more vivid as gains grow -- Heavy drawdown: Lynch turns CRIMSON RED against a BLACK background -- Stop loss hit: The portrait FLASHES RED as a warning -- Neutral: Lynch appears in CYAN/TEAL against dark navy - The daily Lynch wisdom quote rotates, keeping you in his mindset BAR REPLAY SCENARIOS TO TRY: - Start replay on Apple (AAPL) in 2003 as a Turnaround - watch it reclassify into a Fast Grower - Replay Ford (F) through 2008-2012 as a Cyclical - see Lynch's high-PE-buy rule in action - Run Coca-Cola (KO) from 1990 as a Stalwart - practice the 30-50% rotate rule - Try any stock through the 2020 COVID crash - Lynch survived 9 crashes at Magellan, now you can experience one SETTINGS GUIDE - EXPLAINED SIMPLY Think of the settings like customizing a video game character before you play. Here's what each group does: GROUP 1: STOCK TYPE "What kind of company is this?" Pick one of the 6 categories. This changes ALL the rules the script uses. Baseball Inning: Where is this company in its life? - Innings 1-3 = Young, lots of room to grow (like a kid) - Innings 4-6 = Middle age, proving itself - Innings 7-9 = Old, running out of gas Early innings get a score bonus. Late innings get a penalty. GROUP 2: FUNDAMENTAL DATA "Where do the numbers come from?" - Auto mode: TradingView pulls real financial data (EPS, revenue, debt) automatically. Best for stocks. - Manual mode: You type in the numbers yourself. Use this for crypto, forex, or if Auto data looks wrong. GROUP 3: PEG & VALUATION "How do I know if a stock is cheap or expensive?" PEG = Price-to-Earnings divided by Growth rate. - PEG of 1.0 = fairly priced (PE matches growth rate) - PEG below 1.0 = cheap (you're paying less than what the growth is worth) - PEG above 2.0 = expensive The Buy Threshold (default 1.0) means: "only buy if PEG is at or below this number." The Sell Threshold (default 2.0) means: "sell if PEG goes above this number." GROUP 4: BALANCE SHEET HEALTH "Is this company in good financial shape?" - Max Debt/Equity: How much debt is too much? Default 0.50 means total debt shouldn't be more than half of the company's net worth. Lynch always checked the balance sheet. - Min Cash Ratio: Does the company have enough cash? Important for Turnarounds. - Max Payout Ratio: Is the company paying out too much of its earnings as dividends? Above 80% means the dividend might get cut. GROUP 5: CATEGORY RULES "Special rules for each stock type." These are the specific thresholds for each of the 6 categories. The defaults are based on Lynch's actual criteria from his books. Examples: - Fast Grower Min Growth 20%: Lynch said a Fast Grower needs at least 20% earnings growth - Stalwart Rotate Target 40%: Lynch rotated Stalwarts after 30-50% gains - Cyclical Trough PE 25: Buy cyclicals when PE is HIGH (counterintuitive!) GROUP 6: STRATEGY SETTINGS "Should the Lynch Score control the trades?" - Score Gate OFF (default): The Lynch Score is just a meter showing conviction. Trades fire based on category rules alone. - Score Gate ON: The Lynch Score must be above the entry threshold to buy and below the exit threshold to sell. This adds an extra filter. GROUP 7: RISK MANAGEMENT "How much can I lose on one trade?" - Stop Loss: If the stock drops this % from your entry price, sell automatically. Default 15%. - Take Profit: If the stock rises this % from your entry price, sell automatically. Default 100% (a double). GROUP 8: DISPLAY "What do I see on the chart?" - Show/hide the Lynch portrait, the dashboard panel, and buy/sell signals - Customize your bull/bear/neutral colors THE DASHBOARD The top-right panel shows everything Lynch would want to see at a glance: - LYNCH SCORE: A 0-100 conviction meter with a visual bar. Built from 5 sub-scores: -- PEG Score (0-25): Is the stock cheap relative to its growth? -- Earnings Score (0-25): Is earnings growth meeting the target for this category? -- Balance Sheet Score (0-20): How healthy is the financial structure? -- Margin Score (0-15): Are profit margins good and expanding? -- Dividend Score (0-15): Is the dividend policy appropriate for this category? - STORY STATUS: The current fundamental narrative in plain English -- "Growth Accelerating", "Trough - Buy Zone", "Turnaround Succeeding", etc. - SIGNAL: The specific reason behind the current buy or sell signal - P&L: When in a trade, shows your unrealized gain/loss and warns Stalwart holders when approaching the rotate target - VALUATION: PEG ratio, PE ratio, and fair value comparison - EARNINGS: EPS, EPS growth rate, and revenue growth vs. category targets - BALANCE SHEET: Debt/equity ratio and net cash per share - MARGINS: Profit margin trend (expanding or contracting) - DIVIDENDS: Yield, payout ratio, and sustainability assessment - DAILY WISDOM: A rotating quote from Peter Lynch to keep you grounded RESEARCH & SOURCES This script was built using the following primary sources, all studied extensively: 1. "One Up On Wall Street" by Peter Lynch with John Rothchild (1989) share.google Lynch's first book laying out his complete investment philosophy - the 6 categories, PEG ratio, the "story" framework, and the idea that everyday investors have edges over professionals. 2. "Beating the Street" by Peter Lynch with John Rothchild (1993) share.google Lynch's second book where he walks through his actual portfolio decisions at Magellan, explains his mutual fund strategy, and shows step-by-step how he picks stocks. 328 pages of real-world application. 3. "The Peter Lynch Playbook" compiled by Mayur Jain (@mjbaldbard) share.google A comprehensive set of notes summarizing both Lynch books plus interview snippets. Covers portfolio allocation percentages, category-specific checklists, the 2-minute drill for each stock type, risk/reward profiles, and sell criteria. This document was instrumental in translating Lynch's qualitative approach into quantifiable rules. 4. Peter Lynch's "Stock Shop" Video Consultation (Fidelity Archives) youtu.be A full-length video presentation where Lynch personally explains his approach to categorizing stocks, building stories, understanding PE ratios, evaluating balance sheets, and managing risk. Key quotes transcribed and used to calibrate the scoring engine and story status logic. IMPORTANT NOTES - This is a STRATEGY script, not an indicator. It generates actual backtestable trades. - The script is purely fundamental. No technical analysis. Lynch didn't use charts to make decisions. - Auto mode requires stocks with TradingView financial data. For other instruments, use Manual mode. - The Lynch Score is a CONVICTION METER by default, not a trade gate. Enable Score Gate in settings if you want it to filter trades. - All portrait coloring is non-repainting. Colors only update on confirmed (closed) bars. - Start with Bar Replay. That's where the magic happens. Watch the story unfold bar by bar, just like Lynch did at his desk at Fidelity every morning. "The key organ is the stomach, not the brain." - Peter Lynch Strategia Pine Script®di Beck_MullenAggiornato 25
LBR with HM Gartley 1935 on Log Returns Momentum Vol TargetOverview Linda Bradford Raschke's Momentum-based strategy, made by conclusions from the book Profits in the Stock Market by H.M. Gartley in 1935, and uses log returns for directional bias as well as dynamic volatility targeting to maintain consistent risk exposure. Sizes positions inversely to realized volatility (from log returns std dev) for better compounding in trending markets like gold (XAUUSD). Key Features Log returns calculation: ln(close / close ) for time-additive momentum. Directional signals: Enter long when momentum > 0, short when < 0 (configurable strict crossover mode). Volatility scaling: Targets user-defined annual vol (default 20%) → reduces size in high-vol periods. Exits: Percentage TP/SL + explicit close on opposite signals for reliable backtests. Debug visuals: Momentum plot, signal shapes, real-time table (vol, size factor, qty, signal state). How to Use Best on Daily or higher timeframes for meaningful log momentum (e.g., XAUUSD, BTCUSD, stocks). Adjust Momentum Lookback (default 50 bars), Target Vol %, TP/SL %. Backtest with commissions/slippage enabled for realism. Use on log-scale chart for % perspective. Limitations & Notes No guarantees of profitability; markets involve risk. Designed for educational/quant purposes; test thoroughly. Not financial advice. Open-source for community learning. Credits Built on standard quant finance principles (log returns for normality/additivity, vol targeting for risk control). Inspired by discussions on compounding and GARCH-like vol estimation from Linda Bradford Raschke's conclusions from the book Profits in the Stock Market by H.M. Gartley in 1935.Strategia Pine Script®di uzair2join5
Swing Strategy Feature Set V [theEccentricTrader]█ OVERVIEW This swing strategy is part of a broader research and exploration framework designed to encourage users to experiment with a variety of technical concepts and evaluate the comparative effectiveness of different strategy configurations. For example, users can first configure a core strategy as a benchmark, then iteratively test a range of feature configurations as additional entry conditions and compare their performance against one another and against the core strategy. Feature Set V includes concepts beginning with the letter "V" and forms part of a larger swing strategy suite that covers a wide range of technical concepts. The objective of the suite is not curve-fitting, but rather structured experimentation, exploration and statistical validation (or invalidation) of technical concepts. Concepts exclusive to the feature set are as follows: Vertical Horizontal Filter Volume Positive Volume Index Negative Volume Index On-Balance Volume Price Volume Trend Volume Weighted Average Price Volume Zone Oscillator Vortex Indicator █ OPERATIONAL Initial Capital The initial capital is defined as a monetary value denominated in a given base currency. The default initial capital is set to 100,000. The default base currency is set to the selected symbol's default base currency. Users can adjust the initial capital and select an alternative base currency via strategy Settings/Properties. Risk as Percentage of Equity The equity is defined as the sum of initial capital, net profit and open profit. The risk is defined as a percentage of equity per-trade. As a result, net profit outcomes are subject to compounding effects over time. The default risk is set to 1% of equity. Users can adjust the strategy's per-trade risk via strategy Settings/Inputs/STRATEGY. For further information on how the risk is applied in practice, refer to the position sizing section below. Unit of Value The unit of value is defined as a decimal precision factor that converts user-defined point or pip distances into actual price units used by the selected symbol. Different symbols express price movement using different conventions. For example, some symbols are quoted directly in whole price points, while others use pips or fractional point increments. The unit of value provides a normalisation layer that allows all distance-based logic in the strategy to operate consistently across symbols. Examples: A unit of value of 1 corresponds to a price increment of 1.0. A unit of value of 10 corresponds to a price increment of 0.1. A unit of value of 100 corresponds to a price increment of 0.01. A unit of value of 1000 corresponds to a price increment of 0.001. A unit of value of 10000 corresponds to a price increment of 0.0001. Users should consult their broker’s published symbol specifications to confirm how price movement is defined for the symbols they intend to backtest. Incorrect configuration of the unit of value may result in misaligned stop distances, targets and/or risk calculations. The default unit of value is set to 1. Users can adjust the unit of value via strategy Settings/Inputs/STRATEGY. Stop Buffer The stop buffer is defined as the number of points or pips beyond a stop loss level required for the level to be considered clearly breached. The default stop buffer is set to 0 points/pips. Users can adjust the stop buffer via strategy Settings/Inputs/STRATEGY. Risk Range The risk range is defined as the difference between the entry price and the stop loss price (inclusive of the stop buffer) for any given trade. Position Sizing Position sizing determines the quantity of contracts, shares or units opened for each trade based on the user-defined risk and the selected symbol’s pricing structure. "syminfo.pointvalue" is a built-in Pine Script variable that defines the number of underlying units contained within a single contract for any given symbol, and is critical for accurate position size calculations. The position size is calculated as follows: The risk range is multiplied by the syminfo.pointvalue to convert the price movement into its monetary equivalent. The user-defined risk amount (expressed as a percentage of equity) is divided by this monetary risk per unit to determine the position size. This ensures that each trade risks a consistent proportion of account equity regardless of point or pip based quoting conventions, symbol price scale or contract specifications. While the strategy targets a fixed percentage of equity risk per-trade, the exact risk applied cannot always be matched precisely due to symbol-specific constraints such as contract sizing and margin requirements. In these cases, the strategy opens the largest permissible position that does not violate operational constraints, resulting in a realised risk that is as close as possible to the user-defined risk without exceeding it. For further information on the syminfo.pointvalue variable, please refer to: www.tradingview.com Margin The margin is defined as the minimum percentage of a position’s notional value that must be covered by the strategy’s available equity in order for TradingView's strategy tester to simulate opening and maintaining that position. For example, a margin setting of 25% means the simulated account must hold equity equal to at least 25% of the position’s notional value in order to enter or maintain that trade, the remaining 75% is considered provided by the simulated broker. A lower margin percentage allows the account to open larger positions relative to its equity, because the required equity portion is smaller. Conversely, a higher margin percentage demands more of the account's equity be committed to any given position. When the account’s equity falls below the required margin, the strategy tester emulates a margin call event, in which the broker emulator forcibly closes or reduces positions so that remaining positions no longer exceed available equity relative to the margin requirement. This behaviour is documented as part of TradingView’s margin/leverage feature for strategies. Margin settings in a strategy are used solely for simulation purposes and do not automatically match any broker’s real-world margin requirements (which can vary by broker, asset class and symbol). Users should consult their broker’s published specifications for further details. The default margin is set to 25% for both long and short positions. Users can adjust the margin for long and short positions independently via strategy Settings/Properties/MARGIN. For further information on the strategy tester's margin functionality, please refer to: www.tradingview.com www.tradingview.com Pyramiding The pyramiding count is defined as the maximum number of open positions permitted at any one time. TradingView's strategy tester does not facilitate hedging, as such, long entries will close any open short positions and short entries will close any open long positions. The default pyramiding count is set to 100. Users can adjust the pyramiding count via strategy Settings/Properties. For further information on TradingView's strategy tester and broker emulator, please refer to: www.tradingview.com Spread The spread is defined as the difference between a given symbol's bid (buy) price and ask (sell) price. Typical spreads vary by broker and symbol. Some brokers offer fixed spreads on certain symbols, while others offer variable spreads that fluctuate with market conditions. Users should consult their broker's published specifications for further details. Commission The commission is defined as a transaction cost applied by a broker and may be expressed as a percentage of position size, a per-contract fee or a fixed fee per-transaction. Commission structures vary by broker and symbol. Some brokers charge no explicit commission and instead generate revenue through the spread or other indirect sources, while others will typically apply one of the three aforementioned commission types, depending on the product offered. Users should consult their broker's published specifications for further details. The default commission is set to 0.005% of position size. Users can select and adjust the commission type via strategy Settings/Properties/COST SIMULATION. █ CORE STRATEGY Green and Red Candles A green candle is defined as a candle that closes at or above its open price and a red candle is defined as a candle that closes below its open price. Swing Highs and Swing Lows A swing high is defined as a green candle, or a series of consecutive green candles, followed by a single red candle that completes the swing and forms the peak. A swing low is defined as a red candle, or a series of consecutive red candles, followed by a single green candle that completes the swing and forms the trough. Peak and Trough Prices The peak price of a complete swing high is either the high of the red candle that completes the swing high or the high of the preceding green candle, depending on which is higher. The trough price of a complete swing low is either the low of the green candle that completes the swing low or the low of the preceding red candle, depending on which is lower. Fixed Reward-to-Risk Fixed reward-to-risk is defined as a user-defined reward multiple for a given unit of risk. Variable Reward-to-Risk Variable reward-to-risk is defined as a path-dependent reward multiple for a given unit of risk. Swing High Swing Low (SHSL) Strategy The SHSL strategy uses swing lows for core long entry conditions and swing highs for core short entry conditions. The strategy is designed for standard OHLC candlestick charts only and will not behave as intended on other chart types. All entries are processed at candle close and use the candle close price for the entry price. Long stop losses are anchored to the most recent trough and short stop losses are anchored to the most recent peak. Users can choose between long-only and short-only configurations, or alternatively simulate trades in both directions (long-short). However, when the "Both" option is selected, long entries will close any open short positions and short entries will close any open long positions (as mentioned in the pyramiding sub-section above). This can and will result in variable reward-to-risk outcomes. The default direction is set to "Long" for a long-only configuration. The default exit type is set to "Target" for a fixed reward-to-risk configuration. Long targets are determined by adding a user-defined multiple of the risk range to the entry price and short targets are determined by subtracting a user-defined multiple of the risk range from the entry price. Even when using a fixed reward-to-risk configuration, realised reward-to-risk outcomes may vary due to market gaps, particularly when positions are held across session boundaries or market closures. Gaps can cause stop losses or exits to be executed at prices materially different from those implied by the strategy’s static distance calculations. Users who wish to minimise gap-related variability may consider applying the close at end of session filter (see core filters section below), accepting that this introduces its own form of reward-to-risk variability. The default reward-to-risk is set to 1. Users can adjust strategy parameters via strategy Settings/Inputs/STRATEGY. Selecting a non-target exit type removes profit targets and renders the reward-to-risk input inactive. Trailing Stop Loss A trailing stop loss is defined as an exit type that dynamically moves a stop loss level in a favourable direction when a predefined condition is met. For example, a predefined point move or the formation of a higher trough or lower peak. Risk Range Trailing Stop Loss The risk range trailing stop loss is defined as a trailing stop mechanism that activates once price has moved favourably by one full risk range. Upon activation, the stop loss is moved to breakeven and subsequently trails favourable price movement by the risk range into profit. Users can apply this exit type by selecting "Trail" via strategy Settings/Inputs/STRATEGY. Trend Trailing Stop Loss The trend trailing stop loss is defined as a trailing stop mechanism that dynamically moves a stop loss level to newly formed higher troughs (for longs) or lower peaks (for shorts). Users can apply this exit type by selecting "Trend Trail" via strategy Settings/Inputs/STRATEGY. Candle Trailing Stop Loss The candle trailing stop loss is defined as a trailing stop mechanism that dynamically moves a stop loss level to newly formed higher candle lows (for longs) or lower candle highs (for shorts). Users can apply this exit type by selecting "Candle Trail" via strategy Settings/Inputs/STRATEGY. Opposing Candle Colour Close The opposing candle colour close exit type is defined as an exit condition that closes any long positions when a new red candle forms and closes any short positions when a new green candle forms. Users can apply this exit type by selecting "Opposing Candle" via strategy Settings/Inputs/STRATEGY. █ CORE FILTERS Minimum Risk Range Filter The minimum risk range filter is defined as an entry filter that invalidates trade signals with a risk range below a user-defined threshold. The default minimum risk range is set to 4 points/pips. Users can adjust the minimum risk range via strategy Settings/Inputs/RISK RANGE FILTER. It is recommended that users set the minimum risk range at least 1–2 points/pips above the selected symbol’s spread to invalidate trades that would be completely impractical under realistic trading conditions. Time Zone The time zone is defined using either an IANA region identifier (e.g. Europe/London, America/New_York) or a fixed UTC/GMT offset (e.g. UTC+1, GMT-05:30). Fixed offsets do not account for daylight saving time. The default time zone is set to Europe/London. Users can change the time zone via strategy Settings/Inputs/TIME ZONE. For further information on time zone configuration, please refer to: data.iana.org en.wikipedia.org Session Filter The session filter is defined as an entry filter that invalidates trade signals that fall outside a user-defined intraday trading session, with session start and end times bound to the strategy time zone. TradingView candle timestamps represent the candle open time, not the candle close time. As a result, session boundaries are evaluated based on when a candle opens, even though entries and exits are processed at candle close. To avoid trades being entered or held beyond the intended session end, users should configure the session end time at least one full timeframe period earlier than the desired practical session close. For example, on a 5-minute chart with a desired session end at 22:00, the session should typically be configured to end at 21:55. This ensures that no new trades are taken at the final session close and that any session-dependent exit logic is applied before the session ends in practice. When using custom or non-standard timeframes where the desired session end does not align cleanly with candle boundaries, it is recommended that users set the session end two full timeframe periods earlier than the desired session end. This provides an additional safety buffer, ensuring the strategy avoids taking trades near the session boundary. By default, the session filter is set to false and the default session is set to "2300-2155". Users can apply the session filter and adjust session boundaries via strategy Settings/Inputs/SESSION FILTER. Close At End of Session Filter The close at end of session filter is defined as an exit filter that closes all open positions when the active trading session ends, provided that the session filter is appropriately configured and applied. When enabled, the strategy monitors the session filter state and detects the transition from an active session to an inactive session. All open trades are closed on the first candle that falls outside the defined session window. This ensures that no positions are carried beyond the user-defined trading session. The close at end of session filter operates independently of entry conditions and other exit types. When enabled, it will force the closure of all open positions at session end regardless of the selected exit configuration. Enabling the close at end of session filter can result in variable reward-to-risk outcomes. Because positions are forcibly closed at session end regardless of stop loss or target placement, exits may occur at prices that differ from those implied by the fixed reward-to-risk configuration. This behaviour is intentional and reflects a design trade-off between enforcing strict session boundaries and allowing trades to reach their predefined directional objectives, regardless of how severely distorted the realised reward-to-risk outcomes could be in the event of price gaps. By default, the close at end of session filter is set to false. Users can apply the close at end of session filter via strategy Settings/Inputs/CLOSE AT END OF SESSION FILTER. Users should also ensure that the session filter is applied and that session boundaries are configured appropriately with respect to candle timestamp behaviour, as described in the session filter section above. Sample Period Filter The sample period filter is defined as an entry filter that invalidates trade signals that fall outside a user-defined date-time range, with start and end date-times bound to the strategy time zone. TradingView candle timestamps represent the candle open time, not the candle close time. As a result, sample period boundaries are evaluated based on when a candle opens, even though entries and exits are processed at candle close. To avoid trades being entered beyond the intended sample period end, users should configure the sample period end date-time at least one full timeframe period earlier than the desired practical sample period end date-time. For example, on a 5-minute chart with a desired end date-time of 01/01/2026 22:00, the end date-time should typically be configured to 01/01/2026 21:55. The default sample period start and end date-times are set to 01/01/1900 00:00 and 01/01/3000 00:00, respectively. Users can adjust the sample period via strategy Settings/Inputs/SAMPLE PERIOD FILTER. █ GENERIC FILTERS Generic Filter Behaviour Unless otherwise stated: "None" inputs return true. Filters return true only when their selected condition is satisfied. Close Above-Equal/Below Filter The close price above-equal/below filter is defined as an entry filter that evaluates the most recent candle close price relative to a given time-series value and invalidates trade signals that do not satisfy a user-defined directional condition. "Above-Equal" returns true when the most recent candle close price is greater than or equal to any given time-series value. "Below" returns true when the most recent candle close price is less than any given time-series value. Minimum and Maximum Boundary Filters Minimum and maximum boundary filters are defined as entry filters used to constrain time-series values to predefined minimum and/or maximum thresholds, invalidating trade signals that do not satisfy a user-defined threshold criteria. The filters consist of two independent threshold components, minimum (above-equal) and maximum (below-equal), which may be applied individually or together. When both components are applied simultaneously the filters act as a value range constraint, invalidating trade signals that fall outside of the specified bounds. "Above-Equal" returns true when the evaluated value is greater than or equal to the user-defined minimum boundary. "Below-Equal" returns true when the evaluated value is less than or equal to the user-defined maximum boundary. Minimum Percentage Change Positive-Flat/Negative Filter The minimum percentage change filter is an entry filter that measures the relative change of a time-series value over a configurable historical window and applies a directional threshold condition, invalidating trade signals that do not meet the directional threshold criteria. The filter compares the current value to its value n bars ago and computes the percentage difference. A signal returns true only if this percentage change satisfies both: The selected directional requirement. The user-defined minimum percentage change magnitude. "Positive-Flat" direction logic: Accepts values that have increased or remained unchanged, provided the percentage change is greater than or equal to the minimum threshold. "Negative" direction logic: Accepts values that have decreased, provided the magnitude of the decrease meets or exceeds the minimum threshold. When the minimum threshold is set to 0%, the filter behaves as a pure directional check: "Positive-Flat" accepts ≥ 0% changes. "Negative" accepts < 0% changes only. Basic and Exclusive Rejection Filters The basic rejection filter is defined as an entry filter that evaluates swing-based wick or body rejections of a given price level and invalidates trade signals that do not satisfy the rejection criteria. For long trades, "Rejection" returns true when all three of the following conditions are met: The previous candle open is above a given rejection price. The trough price is less than or equal to a given rejection price. The green candle that completes the swing closes above a given rejection price. For short trades, "Rejection" returns true when all three of the following conditions are met: The previous candle open is below a given rejection price. The peak price is greater than or equal to a given rejection price. The red candle that completes the swing closes below a given rejection price. The exclusive rejection filter is defined as an entry filter that meets basic rejection filter criteria for only one user-defined price level from a set of given price levels. If the rejection criteria is met for more than one of the given price levels the filter will return false. Basic and Multi-Part Trend Filters Basic and multi-part trend filters are defined as entry filters that evaluate changes in time-series values from one period to the next and invalidate trade signals that do not satisfy a user-defined trend condition. Basic trends operate independently of prior trend state, whereas multi-part trends are defined by the presence or absence of preceding trend sequences. The multi-part trend states are distinguished numerically and the conditions are bound to a user-defined trend count. "Basic Uptrend" returns true when a time-series value is greater than the preceding value. For example, a basic volume uptrend filter returns true if the most recent candle's volume is greater than the preceding candle's volume. "Basic Downtrend" returns true when a time-series value is less than the preceding value. For example, a basic volume downtrend filter returns true if the most recent candle's volume is less than the preceding candle's volume. "Uptrend" returns true while a multi-part uptrend state is valid. The uptrend state begins when a new basic uptrend forms following a basic downtrend and remains valid until a new basic downtrend forms. The user-defined trend count will determine which multi-part trend condition is selected. For example, if the user-defined trend count is set to 3, then only 3-part uptrend conditions will return true. "Downtrend" returns true while a multi-part downtrend state is valid. The downtrend state begins when a new basic downtrend forms following a basic uptrend and remains valid until a new basic uptrend forms. The user-defined trend count will determine which multi-part trend condition is selected. For example, if the user-defined trend count is set to 3, then only 3-part downtrend conditions will return true. █ FEATURE SET V SPECIFIC FILTERS All feature set specific indicators use the same calculations as the built-in TradingView indicators unless otherwise stated in the relevant filter sub-section. While users do not need to apply the indicators for the strategy to function, they can of course apply the relevant indicators as visual aids if they so desire. For further information on how to apply built-in TradingView indicators, please refer to: www.tradingview.com As there are no built-in TradingView indicators for the VHF, VWAP and VZO values used in this script, code samples are provided in the relevant sections so that users can build their own Pine Script indicators. For further information on how to build Pine Script indicators, please refer to: www.tradingview.com www.tradingview.com Vertical Horizontal Filter (VHF) Filters As there is no built-in indicator for the VHF value used in this script, users can build their own VHF indicator in Pine Script by copying the following code and pasting it into a new indicator: //@version=6 indicator(title = "Vertical Horizontal Filter", shorttitle = "VHF", overlay = false) import TradingView/ta/12 as ta vhf_source = input.source(defval = close, title = 'VHF Source', group = 'Vertical Horizontal Filter (VHF)') vhf_length = input.int(defval = 28, minval = 1, title = 'VHF Length', group = 'Vertical Horizontal Filter (VHF)') vhf = ta.vhf(vhf_source, vhf_length) plot(vhf, color = color.blue) The VHF defaults are as follows: Source is set to "Close". Length is set to 28. Users can adjust the VHF inputs via strategy Settings/Inputs/VERTICAL HORIZONTAL FILTER (VHF). The VHF minimum and maximum boundary filter (see generic filters section above) defaults are as follows: Apply VHF above-equal is set to false. VHF above-equal threshold is set to 0.0. Apply VHF below-equal is set to false. VHF below-equal threshold is set to 1.0. The VHF minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The VHF trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the VHF filters and adjust filter parameters via strategy Settings/Inputs/VHF FILTERS. Volume Filters The Volume minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The Volume trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the Volume filters and adjust filter parameters via strategy Settings/Inputs/VOLUME FILTERS. Positive Volume Index (PVI) Filters The PVI minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The PVI trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the PVI filters and adjust filter parameters via strategy Settings/Inputs/POSITIVE VOLUME INDEX (PVI) FILTERS. Negative Volume Index (NVI) Filters The NVI minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The NVI trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the NVI filters and adjust filter parameters via strategy Settings/Inputs/NEGATIVE VOLUME INDEX (NVI) FILTERS. On-Balance Volume (OBV) Filters The OBV minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The OBV trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the OBV filters and adjust filter parameters via strategy Settings/Inputs/ON-BALANCE VOLUME (OBV) FILTERS. Price Volume Trend (PVT) Filters The PVT minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The PVT trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the PVT filters and adjust filter parameters via strategy Settings/Inputs/PRICE VOLUME TREND (PVT) FILTERS. Volume Weighted Average Price (VWAP) Filters Although there is a built-in VWAP indicator, its output may differ from the calculation used in this script. As such, it is recommended that users build their own VWAP indicator in Pine Script by copying the following code and pasting it into a new indicator: //@version=6 indicator(title = "Volume Weighted Average Price", shorttitle = "VWAP", overlay = false) vwap_source = input.source(title = 'VWAP Source', defval = hlc3, group = 'Volume Weighted Average Price (VWAP)') vwap_anchor = input.bool(title = 'VWAP Anchor', defval = true, group = 'Volume Weighted Average Price (VWAP)') vwap = ta.vwap(vwap_source, vwap_anchor) plot(vwap, color = color.blue) The VWAP indicator defaults are as follows: Source is set to "HLC3". Anchor is set to true. Users can adjust the VWAP inputs via strategy Settings/Inputs/VOLUME WEIGHTED AVERAGE PRICE (VWAP). The default mode for the close above-equal/below VWAP filter (see generic filters section above) is set to "None". The default mode for the VWAP rejection filter (see generic filters section above) is set to "None". Users can apply the VWAP filters and adjust filter parameters via strategy Settings/Inputs/VWAP FILTERS. Volume Zone Oscillator (VZO) Filters As there is no built-in indicator for the VZO value used in this script, users can build their own VZO indicator in Pine Script by copying the following code and pasting it into a new indicator: //@version=6 indicator(title = "Volume Zone Oscillator", shorttitle = "VZO", overlay = false) import TradingView/ta/12 as ta vzo_length = input.int(defval = 14, minval = 1, title = 'VZO Length', group = 'Volume Zone Oscillator (VZO)') vzo = ta.vzo(vzo_length) plot(vzo, color = color.blue) The default length for the VZO is set to 14. Users can adjust the VZO length via strategy Settings/Inputs/VOLUME ZONE OSCILLATOR (VZO). The VZO minimum and maximum boundary filter (see generic filters section above) defaults are as follows: Apply VZO above-equal is set to false. VZO above-equal threshold is set to -100. Apply VZO below-equal is set to false. VZO below-equal threshold is set to 100. The VZO minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The VZO trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the VZO filters and adjust filter parameters via strategy Settings/Inputs/VZO FILTERS. Vortex Indicator (VI) Filters The default length for the VI is set to 14. Users can adjust the VI length via strategy Settings/Inputs/VORTEX INDICATOR (VI). The VI above-equal/below VI signal filter is defined as an entry filter that evaluates the relative positioning of the VI value and its signal line and invalidates trade signals that do not satisfy a user-defined directional condition. The default mode for the VI above-equal/below VI signal filter is set to "None". The VI bandwidth increasing/decreasing filter is defined as an entry filter that evaluates whether the distance between the VI line and VI signal line is expanding or contracting over a configurable lookback period. The default VI bandwidth increasing/decreasing filter mode is set to "None". The default VI bandwidth increasing/decreasing lookback is set to 3. The VI minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The VI signal minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows: Mode is set to "None". Minimum percent change is set to 0. Lookback is set to 3. The VI trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. The VI signal trend filter (see generic filters section above) defaults are as follows: Mode is set to "None". Trend count is set to 3. Users can apply the VI filters and adjust filter parameters via strategy Settings/Inputs/VI FILTERS. █ ALERTS Users can set alerts for any given strategy configuration via the alerts dialogue box. Users must first ensure that the correct condition (the strategy title) is selected from the first drop-down list in the alert dialogue box's condition field. Default alert messages have been configured for both entries and exits so that users can more effectively distinguish between long and short entries and exits while using long-short configurations. To get alerts for both entries and exits the user should change the value in the condition field's second drop-down list from "Order fills only and alert() function calls" to "Order fills only". When using "Order fills only" with long-short configurations, it is recommended that users define their alert via the alert name field and use only the default {{strategy.order.alert_message}} call in the alert message field. Alert conditions generated by "Order fills only" are evaluated after entry conditions have been satisfied and operational constraints (risk, position size and margin requirements) have been applied. As such, trade signals that would result in position sizes exceeding the simulated account's margin constraints will not generate alerts. To get alerts for entries only the user should change the value in the condition field's second drop-down list from "Order fills only and alert() function calls" to "alert() function calls only". The default alert messages generated by "Order fills only" are as follows: "long entry". "long exit". "short entry". "short exit". The default alert messages generated by "alert() function calls only" are as follows: "long entry". "short entry". Alert conditions generated by "alert() function calls only" are operational-constraint-agnostic and will generate alerts whenever entry conditions are satisfied, regardless of the simulated account's margin constraints. For further information on setting and managing alerts, please refer to: www.tradingview.com www.tradingview.com www.tradingview.com █ LIMITATIONS AND CONSIDERATIONS Backtesting Backtest results should always be interpreted cautiously. Strategy performance can vary significantly across time periods and sample sets. While strong historical performance does not guarantee future results, poor historical performance reliably indicates a weak strategy when sample sizes are statistically meaningful. Statistical Significance and Path-Dependent Outcomes (Overfitting) In statistical practice, sample sizes of 100 observations are sometimes cited as a rough lower bound for certain forms of basic significance testing. In the context of trading strategy evaluation, such sample sizes are rarely sufficient to produce results that are meaningfully reliable or replicable. Based on practical experience, sample sizes closer to 1,000 observations or more are generally required before performance characteristics begin to stabilise. As a general rule, larger sample sizes increase the reliability and replicability of observed results. Path dependence refers to situations in which outcomes are determined not only by initial conditions, but by the specific and unique sequence of price movements over a given time period. Even with large sample sizes, favourable net profit outcomes should be interpreted with caution when they are primarily driven by either variable reward-to-risk configurations or fixed reward-to-risk configurations that employ unrealistically high reward multiples. In both cases, performance is often strongly influenced by path-dependent effects, making such outcomes less reliable and less replicable. Fixed reward-to-risk configurations are generally less susceptible to path dependence when the reward multiple is kept within reasonable bounds. However, empirical studies and practitioner research suggest that reward multiples above approximately 3:1 increasingly exhibit the same path-dependent characteristics observed in variable reward-to-risk strategies. Bar Magnifier Due to the limitations of OHLC data, intra-bar price movement cannot be precisely determined. When both stop loss and target levels are reached within the same candle, assumptions are made by the strategy tester. Pine Script's bar magnifier partially mitigates this limitation by evaluating lower-timeframe data. However, this feature is available only to TradingView Premium users and remains inherently limited. For further information on the bar magnifier functionality, please refer to: www.tradingview.com www.tradingview.com TradingView Premium users can enable bar magnifier via strategy Settings/Properties/FILL ORDERS. Processing Orders at Candle Close Backtests cannot accurately account for slippage between signal generation and trade execution. A practical mitigation is to use fixed-distance stop losses and targets rather than absolute price levels, a feature supported by many brokers and APIs. Empirical Probabilities Empirical probabilities are derived directly from observed outcomes rather than from theoretical models or assumed distributions. In the context of trading, they are calculated by measuring the relative frequency of events (such as wins and losses) across a large sample of historical trades. Unlike conditional or model-based probabilities, empirical probabilities make no assumptions. Their validity relies primarily on sample size and the consistency of the rules used to generate observations, making them particularly relevant for trading systems evaluated under the law of large numbers. Empirical probabilities are most useful for comparative analysis, such as assessing how different configurations, filters or exit mechanisms alter the statistical behaviour of a strategy under identical conditions. They are not intended to represent true predictive probabilities or to imply stable future performance. To study empirical probabilities for comparative purposes, it is recommended that users set commission and both long and short margin values to 0% in order to maximise sample size. However, users should not interpret any resulting profits as realistic. Setting commission and margin (in particular) to 0% produces highly distorted outcomes that are not representative of realistic live trading conditions. █ DISCLAIMER This Pine Script strategy is provided for educational purposes only and does not constitute financial advice in any form.Strategia Pine Script®di theEccentricTrader1
LBR Quant Finance Regime StrategyLinda Braodford Raschke Quant Finance Regime Strategy This strategy implements a regime-based trading framework that adapts between trend-following and mean-reversion logic depending on current market conditions. It is designed for research and educational purposes and does not guarantee performance. Core Concept Markets alternate between: • Expansion phases (trending) • Contraction phases (ranging) This strategy attempts to detect regime shifts using: ADX for trend strength Bollinger Band width for volatility expansion EMA(200) for structural trend bias When volatility and directional strength expand, the strategy uses trend-following entries. When volatility contracts, it shifts to mean-reversion logic. Entry Logic Trend Regime Conditions: ADX above threshold Bollinger width above average Supertrend alignment EMA trend confirmation MACD momentum confirmation Range Regime Conditions: ADX below threshold Bollinger width contracting RSI extreme levels Price at outer Bollinger bands Risk Management Position sizing: 8% of equity per trade (default) No pyramiding Exits: ATR-based stop loss ATR-based take profit ATR-activated trailing stop Global controls: Max strategy drawdown filter (default 25%) Daily equity loss guardrail (default 5%) If limits are exceeded, new trades are disabled. Default Strategy Properties Initial Capital: 100,000 Order Size: 8% of equity Commission: 0.06% Slippage: 2 ticks Pyramiding: 0 Orders processed on close These settings are used in the published version. Backtesting Guidance • Use on liquid instruments • Test over long historical periods • Ensure sufficient trade sample size (100+ trades recommended) • Adjust regime thresholds carefully No future-looking data is used. Results will vary by asset and timeframe. Chart Notes The background color shows regime detection: Green tint → trending Blue tint → ranging EMA line shows structural bias. No additional scripts are required. Important Past performance does not predict future results.Strategia Pine Script®di uzair2join0
LBR The Motley Fool Foolish Four Portfolio Rotation StrategyLinda Bradford Raschkey's Foolish Four Portfolio Rotation Strategy This strategy implements a rules-based portfolio rebalancing framework inspired by systematic dividend-style equity rotation concepts. It is designed to simulate structured portfolio reallocation on a fixed schedule rather than short-term trading. 🔍 What This Strategy Does The strategy: • Rebalances either monthly or yearly • Allocates capital across four positions • Uses fixed percentage allocation • Applies realistic trading conditions (commission + slippage) • Limits per-position risk to sustainable levels (default 5%) This is a capital allocation strategy — not a signal-based indicator. 🧠 Core Concept Instead of attempting to predict price direction, this model: Uses time-based portfolio rotation. Closes all open positions at rebalance. Reallocates capital according to chosen weighting logic. Maintains disciplined exposure caps. Two allocation modes are included: 1️⃣ Equal-Weight Variant Allocates capital evenly (25% per asset). 2️⃣ Weighted Variant Allocates heavier exposure to one asset (40%) and lighter to others (20%), capped by the defined risk % to remain compliant with sustainable equity exposure. ⚙️ Default Strategy Properties To comply with TradingView backtesting standards: Initial Capital: 100,000 Order Size Type: Percent of Equity Default Order Size: 25% Commission: 0.05% Slippage: 2 ticks Pyramiding: 0 Risk Cap Per Position: 5% (user adjustable 1–10%) These settings are used in the published version. If users modify these values, results will change. 📊 Backtesting Notes • Designed for long historical datasets • Works best on equities or ETFs • Monthly rebalance recommended to generate sufficient trade count • Not optimized for short-term scalping • No forward-looking data is used Users should test across multiple assets and timeframes. This script does not guarantee profitability and makes no performance claims. 📈 How To Use Add to chart of a liquid equity or ETF. Select Monthly or Yearly rebalance. Choose allocation variant. Keep realistic commission & slippage. Backtest over 10+ years for meaningful sample size. 📌 Important This is a structural portfolio framework for research purposes. Strategia Pine Script®di uzair2join3
ORB + Key Session Levels Strategy W/SLAaron's ORB + Key Session Levels Strategy W/SL Quantcrawler Aaron-Indicator turned strategyStrategia Pine Script®di robertcarusonj2220
ORB + Key Session Levels Strategy +SLAaron's ORB indicator as a strategy with a move SL to BE at TP1Strategia Pine Script®di robertcarusonj1164
LBR Cinderella Electric Curfew Session Capital ControlLinda Bradford Raschke's Cinderella Electric Curfew – Session Capital Control Overview This strategy demonstrates structured session-based trading with capital protection rules and volatility-adjusted risk management. The core idea is simple: Trade only during a defined exchange session, and automatically close all open positions once the session ends — enforcing a strict “capital curfew.” The script includes configurable session templates for major global markets and applies risk-based position sizing using ATR-derived stop distance. Core Features: Session-Based Trading Users can select a predefined exchange session (e.g., New York, London, Frankfurt, Tokyo, Hong Kong, Sydney). Trades are only allowed during the selected session window. Electric Curfew Logic All open positions are automatically closed when the session ends (with optional grace period in minutes). This prevents overnight exposure and reduces gap risk. Risk-Based Position Sizing Position size is calculated as: Risk Amount ÷ Stop Distance Where: Risk Amount = % of current equity Stop Distance = ATR × Multiplier This ensures consistent capital allocation regardless of volatility regime. ATR-Based Stops & Targets Optional stop-loss and take-profit levels are volatility-adjusted. Example Signal Logic A simple SMA crossover is included as a placeholder. Users are encouraged to replace it with their own entry logic. Intended Use This strategy is designed for: • Intraday traders • Session-based systems • Traders avoiding overnight risk • Prop-style capital discipline models The session control framework can be integrated into any strategy logic. Past performance does not guarantee future results.Strategia Pine Script®di uzair2join3
LBR Aberration Trend Following StrategyLinda Bradford Raschke's Aberration Trend Following Strategy Overview This strategy implements a directional Bollinger Band breakout model with volatility normalization and trend alignment. Instead of trading every band breakout, the system applies: • Trend bias using EMA • ATR-based volatility regime filtering • Volatility-adjusted stop-loss placement • Fixed risk-to-reward targeting Core Logic: [Bollinger Band Expansion: Entries trigger when price breaks beyond the outer band during acceptable volatility conditions. Trend Confirmation: Long trades require price above the trend EMA. Short trades require price below the trend EMA. Volatility Filter: ATR is compared against its rolling percentile median to avoid extremely low or extreme volatility environments. Risk Management: Stops are ATR-based and targets are defined using configurable risk-reward ratios. This strategy is designed for trending environments and performs best during volatility expansion phases. Strategia Pine Script®di uzair2join2
LBR's Game Theory EMA Strategy - Alternate Game Theory EMA Strategy Overview: This strategy combines EMA crossover structure with a normalized momentum “utility edge” model to filter low-conviction trades. Instead of trading every EMA crossover, the script evaluates whether directional momentum statistically favors buyers or sellers before entering. Core Logic: EMA Structure Shift: A fast EMA crossing a slow EMA signals a possible momentum transition. Trend Alignment: Trades are only taken in the direction of a higher timeframe trend (Trend EMA). Utility Edge Filter: RSI is normalized around 50 to estimate directional advantage: • RSI > 55 → Buyers show advantage • RSI < 45 → Sellers show advantage • Between 45–55 → Considered equilibrium zone (no trade) Optional ADX Filter Trades can be restricted to environments with expanding trend strength. Risk Management Default Properties: • Initial Capital: 10,000 • Risk per trade: 2% of equity • Risk–Reward Ratio: 1.5:1 • Commission: 0.05% • Slippage: 1 tick • Max Trades per Day: 5 • Daily Loss Limit: 2% Position sizing is volatility-adjusted: Position Size = (2% Equity) ÷ ATR Stop Distance Stops and targets expand or contract automatically based on market volatility. Intended Use Designed for trending instruments. Users are encouraged to test on long historical datasets to ensure sufficient trade sample size. This strategy does not predict price direction. It reacts to structural and momentum shifts. Past performance does not guarantee future results.Strategia Pine Script®di uzair2join27
MACD Divergence UltimateMACD Divergence Ultimate (V6) —— Structural Lock & Price Action Confirmation 📖 Strategy Overview This is a sophisticated trend-reversal and pullback strategy specifically engineered for the 15-minute timeframe and above. Unlike generic divergence scripts, this strategy implements a "Triple-Filter" mechanism: Momentum Decay Thresholds, Dynamic Structural Refreshing, and Candle Color Confirmation. It doesn't just look for "Divergence"—it hunts for the exact moment of exhaustion and confirmed reversal. 🚀 Core Logic Highlights 1. Momentum Decay Threshold The strategy goes beyond simple price/MACD decoupling. It introduces a decay_threshold parameter. A signal is only valid if the current MACD histogram peak has decayed to 60% (default) or less of the previous peak. This ensures we only trade when the trend’s momentum is significantly depleted. 2. "One Wave, One Trade" & Structural Reset This is the strategy’s primary defensive layer: Wave Locking: Within a single MACD wave (on one side of the zero line), the strategy allows only one entry attempt to prevent "catching a falling knife" during strong trending moves. Structural Refresh: If the market achieves a "New Price High + New MACD High" (for bulls), the system recognizes a trend continuation. It immediately unlocks and resets, preparing for the next valid divergence setup. 3. Candle Confirmation & "Golden Pullback" Entry Upon detecting a divergence (A-Bar), the system enters "Stalking Mode": Bullish Divergence: Must wait for the first Bullish Candle (Close > Open). Bearish Divergence: Must wait for the first Bearish Candle (Close < Open). Entry Optimization: Once confirmed, the system places a Limit Order at the 75% retracement level of that confirmation candle. We never chase; we only enter on high-probability pullbacks to maximize the Reward-to-Risk (RR) ratio. 4. New York Open Protection Built-in Time Filtering (defaulting to 08:30-10:30 New York Time) helps avoid the high-volatility "whipsaws" typical of the market open, which often create trap-like divergence signals. MACD 背离策略 📖 策略概述 这是一款专为 15分钟周期(及以上)设计的趋势反转/回调策略。与市面上平庸的背离脚本不同,本策略引入了动量衰减阈值、价格结构刷新锁以及K线行为确认三重过滤机制。它不只是在寻找“背离”,而是在寻找“力竭”且“确认反转”的黄金入场点。 🚀 核心逻辑亮点 1. 动量衰减阈值 (Momentum Decay) 本策略不仅要求 MACD 柱状图不创新高/新低,更引入了 decay_threshold 参数。只有当当前的 MACD 波峰衰减至前波的 60%(默认)以下时,系统才认为趋势动能已实质性枯竭,从而排除无效的微弱波动。 2. “一波一单”与结构刷新锁 这是本策略最强大的防御机制: 单波锁定:在 MACD 柱状图同属于零轴一侧的波动中,策略默认只进行一次交易尝试,避免在阴跌行情中反复抄底。 结构同步重置:如果行情出现“价格新高 + MACD新高”(多头能量增强),系统会判定之前的背离逻辑失效,并即刻解除锁定,重新捕捉下一个背离机会。 3. K线颜色确认与“黄金回撤”入场 系统在捕捉到背离信号(A柱)后,不会盲目入场,而是进入**“蹲守模式”**: 看涨背离:必须等到出现第一根阳线。 看跌背离:必须等到出现第一根阴线。 入场位优化:确认 K 线出现后,系统会挂出该 K 线 3/4 位置的回调单。这意味着我们始终在追求极致的盈亏比,不追高,只做高确定性的回调切入。 4. 纽约开盘保护 针对 15 分钟线,策略内置了时间过滤逻辑(默认避开纽约开盘 08:30-10:30),有效规避了开盘初期剧烈双向扫单带来的虚假背离信号。Strategia Pine Script®di super11438203734
LBR's Game Theory - EMA StrategyLinda Bradford Raschke's Game Theory EMA Strategy: Overview: This strategy combines EMA crossover structure with a momentum-based utility edge model inspired by basic game theory concepts. The objective is to participate only when directional momentum suggests one side of the market has a measurable advantage. Core Logic: Structure Shift: A fast EMA crossing a slow EMA signals a potential momentum transition. Trend Alignment: Trades are only taken in the direction of a higher timeframe trend (Trend EMA). Utility Edge Model: Momentum is normalized using RSI to approximate directional “utility.” When RSI is above 50, buyer utility is positive. When RSI is below 50, seller utility is positive. If the difference between buyers and sellers is too small (equilibrium zone), trades are avoided. Trend Strength Filter: Optional ADX filter ensures trades occur in expanding trend conditions. Risk Management: Default Properties: • Initial Capital: 10,000 • Risk per trade: 2% of equity • Risk–Reward: 1.8 : 1 • Commission: 0.05% • Slippage: 1 tick • No pyramiding Position size is dynamically calculated: Position Size = (2% Equity) ÷ Stop Distance Stops and targets are ATR-based to adapt to volatility. Intended Use: Best suited for: • Trending instruments (Forex majors, Indices, Gold, Crypto) • Multi-year datasets for proper statistical evaluation This strategy reacts to structural and momentum shifts. It does not predict future price movement. Past performance does not guarantee future results.Strategia Pine Script®di uzair2join7
VANTYX- Scalper Bot-Dr Abiram SivprasadVANTYX Scalper Bot is a high-precision algorithmic strategy designed for Crypto Perpetuals, Forex, and Indices. It combines robust trend-following logic with a multi-timeframe momentum filter to catch explosive moves while avoiding choppy "sideways" markets.Unlike many scalping scripts, this strategy is strictly engineered to be Non-Repainting. It uses a custom "Tuple Fix" to ensure that all Multi-Timeframe (MTF) data is pulled from Closed Candles only, guaranteeing that your backtest results match real-time performance.🧠 Core Strategy LogicThe strategy operates on a "Confluence" model, requiring four distinct conditions to align before entering a trade:Trend Direction (HalfTrend):We use the HalfTrend indicator to determine the immediate market bias.Long: Price is above the HalfTrend line (Blue).Short: Price is below the HalfTrend line (Red).Momentum Filter (MTF ADX & DI):A custom Multi-Timeframe ADX engine checks the strength of the trend on a higher timeframe (e.g., 15m or 1H).Rule: The ADX must be above a specific threshold (default 23) to confirm that the market is "Trending" and not "Sleeping."Direction: DI+ must be > DI- for Longs, and DI- > DI+ for Shorts.Macro Trend Filter (MTF EMA):To prevent trading against the major trend, the strategy checks a Higher Timeframe 200 EMA.Longs are only taken if Price > 200 EMA.Shorts are only taken if Price < 200 EMA.Volume Filter:Entries are only valid if the current Volume is above the average Volume (SMA 20), ensuring institutional participation.🛡️ Risk Management (The Engine)This strategy includes a professional-grade risk engine to protect capital:ATR-Based Stop Loss: Dynamic SL set at 1.5x ATR (Adjustable). This adapts to market volatility—wider stops in volatile markets, tighter stops in calm markets.ATR-Based Take Profit: Set at 3.0x ATR (Adjustable) to aim for a high Risk:Reward ratio (1:2 or 1:3).Ratchet Trailing Stop: An intelligent trailing stop that moves only in your favor. Once the price moves significantly, the stop tightens to lock in profits, ensuring winning trades don't turn into losers.⚙️ How to Use (Best Settings)Asset Class: Best for Crypto Perpetuals (BTC, SOL, ETH, XRP, MEME Coins) and Volatile Indices.Timeframe: Optimized for 5-Minute and 15-Minute charts.MTF Settings:If Trading 5m Chart $\rightarrow$ Set ADX to 15m and EMA to 1H.If Trading 15m Chart $\rightarrow$ Set ADX to 1H and EMA to 4H.Note: Always ensure ADX/EMA timeframes are higher than your chart timeframe.🛠️ Technical Note: The "Tuple Fix"Many TradingView strategies repaint because request.security leaks future data when using tuples. This script uses a custom function wrapper (f_adx_shifted) to explicitly request (previous closed bar) data for the ADX tuple calculation. This ensures 100% Backtest Accuracy. ⚠️ DisclaimerThis script is for educational and quantitative analysis purposes only. Past performance does not guarantee future results. Cryptocurrency trading involves high risk and leverage. Always forward-test on paper before deploying real capital.Strategia Pine Script®di abiramsivprasad2
Shree Final Daily 55 EMA RSI Volume NIFTY Filter TableHi this is a good script. This Indicator can give ou more. This include what ou want. Lone run this will be beneicial.Strategia Pine Script®di Pro_Momentum8