Script_Algo - Pivot Trend Rider Strategy📌 This strategy aims to enter a trade in the direction of the trend, catching a reversal point at the end of a correction.
The script is unique due to the combination of three key elements:
🔹 Detection of reversal points through searching for local lows and highs
🔹 Trend filter based on SMA for trading only in the trend direction
🔹 Adaptive risk management using ATR for dynamic stop-losses and take-profits
This allows the strategy to work effectively in various market conditions, minimizing false signals and adapting to market volatility.
⚙️ Principle of Operation
The strategy is based on the following logical components:
📈 Entry Signals:
Long: when a local low (pivot low) is detected in an uptrend
Short: when a local high (pivot high) is detected in a downtrend
📉 Position Management:
Stop-loss and take-profit are calculated based on ATR
Automatic reverse switching when an opposite signal appears
📊 Trend Filter:
Uses SMA to determine trend direction (can be disabled if needed)
🔧 Default Settings
Pivot detection: 11 bars
SMA filter length: 16 periods
ATR period: 14
SL multiplier: 2.5
TP multiplier: 10
Trend filter: enabled
🕒 Usage Recommendations
Timeframe: from 1 hour and above
Assets: cryptocurrency pairs, stocks
🤖 Trading Automation
This script is fully ready for integration with cryptocurrency exchanges via Webhook.
📊 Backtest Results
As seen from testing results, over 4.5 years this strategy could have potentially generated about $5000 profit or 50% of initial capital on the NAERUSDT crypto pair on the 4H timeframe.
Position size: $1000
Max drawdown: $1400
Total trades: 376
Win rate: 38%
Profit factor: 1.34
⚠️ Disclaimer
Please note that the results of the strategy are not guaranteed to repeat in the future. The market constantly changes, and no algorithm can predict exactly how an asset will behave.
The author of this strategy is not responsible for any financial losses associated with using this script.
All trading decisions are made solely by the user.
Trading financial markets carries high risks and can lead to loss of your investments.
Before using the strategy, it is strongly recommended to:
✅ Backtest the strategy on historical data
✅ Start with small trading volumes
✅ Use only risk capital you are ready to lose
✅ Fully understand how the strategy works
🔮 Further Development
The strategy will continue to evolve and improve. Planned updates include:
Adding additional filters to reduce false signals
Optimizing position management algorithms
Expanding functionality for various market conditions
💡 Wishing everyone good luck and profitable trading!
📈 May your charts be green and your portfolios keep growing!
Developed by Script_Algo | MIT License | Version 1.0
การวิเคราะห์แนวโน้ม
High Accuracy Engulfing Strategy [PIPNEXUS]Indicator Description:
The PIPNEXUS Trend & Volume Continuation Indicator is built to identify trend continuation opportunities while filtering signals through volume analysis. It highlights moments when the market is most likely to sustain its direction, helping traders avoid false breakouts and weak moves. By combining price action with volume confirmation, this tool delivers more reliable entries and exits, making it ideal for both intraday and swing trading.
Key Features:
Detects potential trend continuation setups
Uses volume validation to filter out weak signals
Works seamlessly across multiple timeframes
Designed to reduce noise and improve overall trade accuracy
Ultimate 30m – Final Const AlertUltimate 30m – Final Const Alert
A ready-to-use 30-minute trading framework that combines four pillars—trend, momentum, volume and key levels—into one clean overlay. It waits for a confluence of:
A volatility-based channel breakout
RSI confirmation above/below the mid-line
Rising/falling Awesome-Oscillator sequence
OBV leadership relative to its own average
A minimum volume surge versus the 20-period mean
Price acceptance (close > prior close for longs, < for shorts)
Long or short signals are fired only when every filter aligns and no position is already open. Each signal comes with pre-calculated, asymmetric exits: a tight ATR-derived stop and a 2.5× risk reward target, both plotted in real time while the trade is alive.
Add the script, create one “Any alert() function call” alarm and you’ll get instant, push-ready notifications the moment the setup triggers—no coding or manual drawing required.
CryptoThunder Storm v1.21CryptoThunder Storm v1.21 — Strategy (non-repainting, HTF-aware)
CryptoThunder Storm is a Pine v6 strategy that trades the cross of two moving-average variants computed on an alternate (higher) timeframe derived from your current chart. It’s built to be non-repainting by evaluating signals only at HTF bar boundaries and by avoiding lookahead. The script can trade LONG, SHORT, BOTH, or be disabled, and it includes a one-click invert Long/Short mode.
How it works
Two MA streams (Open/Close series).
You can choose from multiple MA types (SMA/EMA/DEMA/TEMA/WMA/VWMA/SMMA/Hull/LSMA/ALMA/SSMA/TMA). The script computes:
closeSeries – MA of the (possibly delayed) close
openSeries – MA of the (possibly delayed) open
Alternate Resolution (HTF).
The inputs allow you to multiply your current chart’s timeframe (e.g., on 5m with multiplier 3 → HTF = 15m). Both series are requested via request.security() with lookahead_off.
Non-repainting gating.
Signals are evaluated once per HTF bar (htfClosed gate). This ensures entries/alerts are aligned with HTF boundaries and prevents forward-shifting.
Entry logic.
Long when closeSeriesAlt crosses above openSeriesAlt.
Short when closeSeriesAlt crosses below openSeriesAlt.
Invert mode swaps these actions (a former long signal opens a short, and vice versa).
Orders are processed on bar close (process_orders_on_close=true).
Risk management (optional).
Optional initial TP/SL exits via strategy.exit() (ticks/points). Set 0 to disable.
Visuals.
The script colors bars (optional) and plots the two HTF series with a filled band, plus compact UP/DN/CL markers that match the executed side after inversion/filtering.
Inputs & configuration
Use Alternate Resolution?
Turns the HTF logic on/off. When off, the strategy uses the chart timeframe.
Multiplier for Alternate Resolution
Multiplies the current timeframe to form the HTF (e.g., 3×).
MA Type / Period / Offsets
MA Type — choose from 12 variants.
MA Period — core length.
Offset for LSMA / Sigma for ALMA — MA-specific tuning.
Offset for ALMA — center of mass for ALMA.
Delay Open/Close MA — shifts the source back by n bars for a more conservative (non-peek) calculation. Keep at 0 unless you know you want extra delay.
Show coloured Bars to indicate Trend?
Colors bars relative to HTF band.
What trades should be taken: LONG / SHORT / BOTH / NONE
Filters which sides are actually traded.
Invert Long/Short logic?
Swaps long ↔ short everywhere (orders, markers, JSON alerts).
Backtest window (Number of Bars for Back Testing)
Crude limiter to speed up testing. 0 = test full history.
TP/SL (Initial Stop Loss / Target Profit Points)
Values in ticks/points. 0 disables. They apply to both sides via strategy.exit().
Alert options
Turn on alerts (JSON)
Show alert marks (UP/DOWN/CLOSE)
Send CLOSE alerts (toggle)
The strategy fires alert() internally. Create an alert on “Any alert() function call”.
The payload is a simple JSON string:{ "text":"C98USDT.P UP"}
Messages:
UP — a long entry was executed (or, with Invert on: the inverted long signal that opens a long).
DOWN — a short entry executed.
CLOSE — position closed or flipped.
Tip: If you want to route long/short to different webhooks, parse the text field for UP, DOWN, or CLOSE
Plotting & markers
Band: Fills between the two HTF MA lines.
Bar color (optional): Quick visual trend cue.
Markers:
▲ “UP” below bar when a long executes.
▼ “DN” above bar when a short executes.
✖ “CL” on position close/flip.
These reflect the final executed side, after trade filters and after Invert mode
Best practices & notes
Non-repainting design.
request.security(..., lookahead_off) prevents future data leakage.
Signals are gated to HTF bar boundaries, so you won’t get intra-HTF recalculations.
Strategy orders are processed at bar close.
Choosing the multiplier.
A 2×–4× multiplier often balances responsiveness vs stability (e.g., 5m→15m or 20m). Larger multipliers reduce churn and false signals.
TP/SL units.
Values are in ticks/points of the chart symbol. On crypto, check your instrument’s tick size and adjust accordingly.
Trade filters apply after inversion.
With invertLS = true and tradeType = LONG, only final longs (post-inversion) are allowed.
Strategy vs chart counts.
The Tester reports closed trades; your chart shows entries/markers including the latest open trade. This can explain 8 vs 12 discrepancies over short windows.
Performance.
calc_on_every_tick=false and the backtest limiter keep the script responsive on long histories.
Tips: user on mid-volume crypto pair, 1M chart, best MA is: SMMA, Hull, SSMA, DEMA, TEMA.
This strategy is for research and education. Markets carry risk; past performance doesn’t guarantee future results. Always forward-test on paper and validate your exchange execution, tick size, and fees before deploying live.
Advanced Crypto Day Trading - Bybit Optimized mapercivEMA RSI ATR MACD trading script strategy with filters for weekdays
Higher Lows, Lower Highs & Failures with Signal Quality ScoringAn attempt at a higher low and lower high with scoring
Delayed X Exit Strategy - Final Versionattempt at a scored lowerhigh, higher lower delayed exit strat
CycleVISION [BitAura]𝐂ycle𝑽𝑰𝑺𝑰𝑶𝑵
This Pine Script® indicator combines a long-term trend-following strategy with a cycle valuation Z-score analysis to generate a Trend Probability Indicator (TPI). The TPI aggregates signals from multiple trend and on-chain metrics to identify optimal entry and exit points for a single asset, with USD as a cash position. The system also calculates a comprehensive Z-score based on performance and valuation metrics to assess market cycles, aiming to enhance risk-adjusted returns for long-term investors.
Logic and Core Concepts
The 𝐂ycle𝑽𝑰𝑺𝑰𝑶𝑵 System uses two primary components to guide investing decisions:
1. Trend Probability Indicator (TPI)
Mechanism : Aggregates five proprietary, universal, trend signals and three on-chain metrics into a composite TPI score, normalized between -1 and 1.
Thresholds : Enters a long position when the TPI score exceeds a user-defined long threshold (default: 0.0) and exits to cash when it falls below a short threshold (default: -0.5).
Execution : Trades are executed only on confirmed bars within a user-specified backtest date range, ensuring robust signal reliability.
2. Cycle Valuation Z-Score
Mechanism : Computes an average Z-score from six metrics: Sharpe Ratio, Sortino Ratio, Omega Ratio, Weekly RSI, Crosby Ratio, and Price Z-Score, using a 1200-bar lookback period.
Purpose : Identifies overvalued or undervalued market conditions to complement TPI signals, with thresholds at ±1.8 for extreme valuations.
Visualization : Displays the average Z-score and individual components, with gradient-based bar coloring to reflect valuation strength.
Features
Dynamic Trend Signals : Combines trend and on-chain data into a single TPI score for clear long/cash decisions.
Comprehensive Valuation : Calculates Z-scores for multiple performance and price metrics to assess market cycles.
Customizable Inputs : Allows users to adjust TPI thresholds, backtest date ranges, and valuation metrics visibility.
Visual Outputs :
Valuation Table : Displays TPI score, Z-scores, and performance metrics (Sharpe, Sortino, Omega, Max Drawdown, Net Profit) in a configurable table (Lite, Medium, Full).
Equity Curve : Plots the system’s equity curve compared to buy-and-hold performance.
Price and TPI Plot : Overlays TPI-adjusted price bands with glow effects and filled gaps for trend visualization on the price chart.
Valuation Coloring : Applies backgrounds based on Z-score ranges (e.g., strong buy above 1.8, strong sell below -1.8).
Configurable Alerts : Notifies users of TPI signal changes (Long to Cash or Cash to Long) with detailed messages.
Color Presets : Offers five color themes (e.g., Arctic Blast, Fire vs. Ice) or custom color options for long/short signals.
Pine Script v6 : Leverages matrices, tables, and gradient coloring for enhanced usability.
How to Use
Add to Chart : Apply the indicator to any chart (the chart’s ticker is used for calculations, e.g., INDEX:BTCUSD ).
Configure Settings : Adjust TPI thresholds, backtest start date (default: 01 Feb 2018), and valuation metrics visibility in the Inputs menu.
Select Color Theme : Choose a preset color mode (e.g., Arctic Blast) or enable custom colors in the Colors group.
Monitor Outputs : Check the Valuation Table for TPI and Z-score data, and view the Price and TPI Plot for trend signals.
Analyze Performance : Enable the equity curve and performance metrics in the Backtesting Options group to compare results.
Set Alerts : Right-click a plot, select "Add alert," and choose "Trend Change: Long to Cash" or "Trend Change: Cash to Long" for notifications.
The system is optimized for daily timeframe and tested across various assets to ensure robustness.
Notes
The script is closed-source.
Use a standard price series (not Heikin Ashi or other non-standard types) for accurate results.
The script avoids lookahead bias by using barmerge.lookahead_off in request.security() calls.
A minimum 1200-bar lookback is mandatory for Z-score calculations to avoid errors, with warnings displayed if insufficient price history is available.
The BitAura watermark can be toggled in the Table Settings group.
Disclaimer : This script is for educational and analytical purposes only and does not constitute financial advice. Trading involves significant risk, and past performance is not indicative of future results. Always conduct your own research and apply proper risk management.
MS - Crypto RSI-Based Trading StrategyThis is a comprehensive trend-following and momentum-based strategy designed for the cryptocurrency market. It combines multiple leading indicators to filter out market noise and generate high-quality buy and sell signals.
Key Indicators:
Moving Average (MA): To determine the main trend direction.
Relative Strength Index (RSI): To measure momentum and identify overbought/oversold conditions.
Directional Movement Index (DMI): To confirm the strength of the trend.
Volume & ATR: To validate market interest and filter out excessive volatility.
Buy Conditions (All Must Be True):
Price and Trend Alignment: The current price is above the MA50 (with a 5% buffer).
Momentum Confirmation: The RSI is between 50 and 70.
Trend Strength: The +DI is greater than the -DI.
Market Interest: Volume is 1.5 times its moving average.
Low Volatility: The ATR is below its average.
Sell Conditions (Any One Is True):
Trend Reversal: The price drops below the MA50 (with a 5% buffer).
Momentum Loss: The RSI drops below 45.
Trend Weakness: The -DI crosses above the +DI.
Market Fatigue: Volume drops below 50% of its moving average.
High Volatility: The ATR is above its average.
Disclaimer: This is a backtesting tool and not financial advice. Past performance is not an indicator of future results. Always use proper risk management and conduct your own research before trading.
ECG Sanbot IndicatorNot my best but my first strategy to pass prop firms. Strength based signals. Change the length and repainting settings before setting alerts up.
First strategy to pass my prop firm. Change the tf and length to see reliable signals. Option to remove repainting if you want to set alerts. Not the best compared to my other scripts but will always get you in the green.
Core Logic
Calculates a double-smoothed EMA source on a higher timeframe (tf input).
Builds two RSI streams:
Repainting RSI (lookahead on) → reacts quickly to market changes.
Non-repainting RSI (lookahead off) → provides stable, confirmed values.
Computes the ECG difference between the two RSI streams.
Generates a buy signal when the ECG difference crosses above the upper threshold.
Generates a sell signal when the ECG difference crosses below the lower threshold.
Risk Management
Each trade uses a fixed trade size (trade_size).
Built-in stop-loss and take-profit controls:
Stop Loss: default 0.1% from entry price.
Take Profit: default 0.2% from entry price.
Both long and short entries are supported (direction selectable).
Customization Options
Adjustable timeframe (tf) for RSI source.
Fully configurable thresholds, lengths, and EMA smoothing.
Toggle between repainting vs. non-repainting behavior.
Backtest period controls (start and end date).
Visualization
Plots the ECG difference line in red.
Displays horizontal threshold lines for signal reference.
Pivot Points Strategy🟢 It enters long trades near support zones (S1–S3)
🔴 It enters short trades near resistance zones (R1–R3)
🎯 All positions aim to exit at the central pivot (P).
🚫 It avoids trading when price crosses the pivot during the bar.
🔄 Strategy resets when a new pivot is calculated.
📊 Supports pyramiding up to 5 positions for scaling in.
Chiến lược Lọc Tín hiệu (Cooldown & ATR)Chiến lược Lọc Tín hiệu (Cooldown & ATR)
Chiến lược Lọc Tín hiệu (Cooldown & ATR)
Lavender Multi-Signal Momentum StrategyOverview
The Lavender strategy is a sophisticated momentum-based trading system specifically optimized for Tesla (TSLA) on the 15-minute timeframe. It combines multiple technical signals to identify high-probability long entries during strong trending conditions.
Key Features
🎯 Multi-Signal Entry System
The strategy uses 4 distinct signal types that can be enabled/disabled individually:
Supertrend Pullback (Default: ON)
Identifies pullbacks in uptrends using Supertrend (ATR: 9, Factor: 0.5)
Enters when price retests EMA9-20 zone during bullish Supertrend
Donchian Breakout + Z-Score Momentum (Default: ON)
53-period Donchian channel breakouts
Combined with 35-period Z-Score momentum filter
Only triggers with positive momentum confirmation
Keltner Squeeze Expansion (Default: OFF)
Detects volatility squeeze conditions
Enters on breakout above Keltner Channel after compression
Opening Range Breakout (ORB) (Default: ON)
Tracks first hour range (9:30-10:30 AM)
Triggers on breakout above opening range high
🧭 Trend Regime Filter
EMA Trend Filter: 20 EMA > 100 EMA (Default: ON)
ADX Strength Filter: ADX > 22 with 15/13 smoothing (Default: ON)
Only trades when both trend conditions align
💵 Advanced Risk Management
Risk per Trade: 2.0% of capital (Default)
ATR-Based Stop Loss: 15-period ATR × 1.6 multiplier
Risk/Reward Ratio: 4:1 (Default)
Position Sizing: Automatic based on stop distance
Capital Options: Dynamic equity or fixed capital ($200,000 default)
⚙️ Execution Control
Candle Close Entries: Prevents intrabar noise (Default: ON)
Candle Close Exits: Stop loss and take profit only at bar close (Default: ON)
Trading Session: 9:00 AM - 4:00 PM (Default)
Trading Days: Monday-Saturday (Default: 123456)
Default Settings Summary
ParameterDefault ValuePurposeRisk per Trade2.0%Capital risk percentageATR Length15Stop loss calculationATR Multiplier1.6Stop distance factorRisk/Reward4.0Take profit multiplierEMA Fast20Short-term trendEMA Slow100Long-term trendADX Threshold22Minimum trend strengthMin Signals Required1Entry trigger thresholdInitial Capital$200,000Backtesting capital
How It Works
Trend Confirmation: Checks EMA alignment and ADX strength
Signal Generation: Scans for active momentum signals
Entry Execution: Enters when minimum signal threshold is met
Risk Management: Calculates position size based on ATR stop
Exit Management: Manages trades with 4:1 risk/reward ratio
Best Use Cases
Tesla (TSLA) on 15-minute charts
Trending market conditions
Intraday momentum trading
Markets with clear directional bias
Visual Indicators
Blue Line: 100-period EMA (trend filter)
Green/Red Line: Supertrend indicator
Teal Line: Donchian channel high
Purple Triangles: Keltner breakout signals
Orange Arrows: Opening range breakouts
Green Dots: Combined entry signals
Red/Green Lines: Active stop loss and take profit levels
Risk Disclaimer
This strategy is optimized for Tesla's specific price behavior on 15-minute timeframes. Past performance does not guarantee future results. Always test thoroughly and manage risk appropriately.
Created by kevloewe - Specialized for TSLA 15M momentum trading
MS - Çoklu Onay Stratejisi (AL-SAT)"VOLUME, MA50, RSI, DMI, ATR
5 conditions, all turning positive at the same time gives a buy signal; one of them turning negative gives a sell signal. This should be evaluated with weekly data. Not financial advice."
Advanced MA Cross Strategy with ConfluenceOverview
A trend-following strategy that combines moving average crossovers with multiple technical confluence factors to identify high-probability long entries. This system is designed for traders seeking a disciplined, multi-faceted approach to market analysis with built-in risk management.
Core Strategy Logic
The strategy generates buy signals when a fast moving average crosses above a slow moving average, but only when multiple technical conditions align simultaneously. This confluence-based approach significantly reduces false signals and improves trade quality by ensuring multiple market dynamics support the directional bias.
Key Features
🎯 Multi-MA Support
5 Moving Average Types: EMA, SMA, WMA, HMA, VWMA
Customizable Periods: Flexible fast, slow, and trend filter lengths
Slope Validation: Ensures both MAs are trending upward before entry
📊 Seven-Point Confluence System
Volume Confirmation - Requires above-average trading volume
RSI Filter - Avoids overbought/oversold market conditions
MACD Alignment - Confirms momentum direction and strength
ADX Trend Strength - Validates trending market conditions
Bollinger Bands Position - Price positioning within volatility bands
Stochastic Momentum - Additional oscillator confirmation
Long-term Trend Filter - Ensures proper MA hierarchy (Fast > Slow > Trend)
🛡️ Advanced Risk Management
ATR-Based Dynamic Stops - Volatility-adjusted stop losses
Trailing Stop Logic - Protects profits as trades move favorably
Clear Exit Signals - Systematic position closure on MA cross-under
📈 Visual Intelligence
Real-Time Confluence Dashboard - Live monitoring of all filter conditions
Color-Coded Background - Visual confirmation when all factors align
Professional Signal Markers - Clear entry/exit visualization
MA Hierarchy Indicators - Trend structure validation
⚙️ Fully Customizable
Every parameter is user-adjustable, allowing traders to:
Modify MA lengths for different timeframes
Adjust confluence filter sensitivity
Customize risk management parameters
Enable/disable individual filters as needed
Strategy Advantages
✅ Reduced False Signals - Multiple confirmation layers filter out low-quality setups
✅ Trend Following - Designed to capture sustained directional moves
✅ Risk-Aware - Built-in stop loss and position sizing
✅ Transparent Logic - Real-time display of all decision factors
✅ Adaptable - Works across multiple timeframes and instruments
✅ Professional Grade - Institutional-quality technical analysis
Best Use Cases
Trending Markets: Excels in sustained directional price movements
Medium to Long-term Swing Trading: Optimized for multi-day to weekly holds
Risk-Conscious Trading: Ideal for traders prioritizing capital preservation
Educational Tool: Perfect for learning confluence-based analysis
Recommended Settings
Timeframes: 4H, Daily, Weekly for optimal signal quality
Instruments: Works on all liquid markets (Forex, Stocks, Crypto, Commodities)
Risk Management: 1-2% risk per trade recommended
Important Notes
⚠️ Long-Only Strategy: Designed specifically for upward price movements
⚠️ Confluence Dependent: All filters must align for signal generation
⚠️ Trending Market Bias: Performance may be limited in sideways markets
Disclaimer: This strategy is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own analysis and consider your risk tolerance before trading.
/MNQ 5m WAVE (Fusion B-L/S)This strategy—built for the Nasdaq-100 micro future (/MNQ) on the 5-minute chart—combines a simple momentum trigger with a set of context filters and layered exits. The core entry uses a fast/slow EMA crossover (5 vs. 13) and only fires when volatility is adequate, trend/participation are aligned, and price sits at a tradable distance from VWAP. Signals are executed strictly on bar close (no intrabar execution), which avoids repainting and keeps backtests consistent with live behavior at bar close.
imgur.com i.imgur.com i.imgur.com
Volatility filtering relies on ATR (smoothed true range). You can toggle it globally and per side (long/short) and set an absolute threshold in points. If the market is below the threshold, new entries are inhibited; above it, entries are allowed. Because the threshold is in points, you should calibrate it to the symbol and timeframe (defaults are tuned for /MNQ 5m).
Trend and impulse are checked via a Weinstein-style block: a mid-term SMA and its slope, plus a volume condition. Longs require closes above the SMA with non-negative slope; shorts require closes below the SMA with non-positive slope. Additionally, current volume must exceed the prior bar and a short SMA of volume. This aims to separate genuine breakouts with participation from low-quality pokes.
Relative location uses a smoothed VWAP (separate smoothing for longs and shorts). Longs must trade above VWAP and within a configurable proximity window (e.g., ≤1.1%); shorts must be below VWAP and within their own proximity (e.g., ≤0.3%). This favors buying strength near an institutional reference and selling weakness near value, discouraging stretched entries with poor signal-to-noise.
The entry trigger, once all filters agree, is the EMA cross—up for longs, down for shorts. You can restrict the strategy to “Both,” “Longs Only,” or “Shorts Only.” Orders are placed at the close of the confirming bar, with fixed size by default and configurable commissions/margins in the strategy properties.
Exits combine three layers: (1) a fixed percentage stop loss from average entry; (2) a fixed percentage take profit; and (3) a trailing stop that activates only after a minimum favorable excursion and then follows the highest high/lowest low with a configurable distance behind. Trailing lines are drawn as step lines, and the area between entry and the active trailing is shaded, making risk protection and give-back immediately visible.
Optionally, you can enable an automatic “bars in trade” close (useful for fast rotation/stop-hunt styles). When enabled, the position closes once the bar count since entry exceeds a user-defined maximum. A floating label displays the live bar count versus the cap, with distinct styling for longs and shorts.
Execution is wired for automation. Each entry/exit emits a structured JSON payload via TradingView’s alert_message (ideal for “order fill” endpoints such as /signal), including OHLCV and informational metrics (ATR and ADX). Additionally, the strategy can issue a parallel alert() with a compact “advice” payload (toggle “Enable alert() pushes to /advice”). This separation lets the same event feed both execution and a validation/notification layer.
Visually, the script plots the working EMAs, the Weinstein SMAs, smoothed VWAPs, and the trailing lines per side, and it marks crosses with clear icons. The entry price is highlighted, and the fill between entry and trailing is colored (green/red) to show whether profits are being locked in or risk is increasing—so trade management is readable at a glance.
Key parameters exposed: EMA lengths per side; Weinstein block periods and thresholds (slope and volume); VWAP smoothing and per-side proximity; SL/TP percentages and trailing configuration (start and behind distance); ATR lengths and thresholds per side; trade direction selector; and the bars-auto-close module with its on-chart counter. Defaults are reasonable for /MNQ on 5m but are meant to be tuned to your instrument’s volatility and session microstructure.
Operating philosophy: enter less but better—on breakouts with bias and participation—preferably not too far from VWAP; then manage exits in layers that protect gains without choking extended moves. Asymmetry between long and short proximity/targets reflects the typically sharper nature of declines versus advances and can be tailored to your data.
Limitations and guidance: the ATR threshold is absolute (points), so it is not portable without calibration; ensure VWAP proximity windows fit your intraday seasonality and the session you trade (RTH/ETH). While the system is close-of-bar and non-repainting, results may vary with data feeds or session settings. Always validate in paper first; no strategy guarantees outcomes.
Disclaimer: for educational and informational purposes only. Not financial advice. Derivatives and leveraged products carry substantial risk, including the possibility of total loss. Tune parameters and automations at your own risk.
AMF PG Strategy_v2The AMF PG Strategy (Praetorian Guard) is an advanced trading system designed to seamlessly adapt to market conditions. Its unique structure balances precise entries with intelligent protection, giving traders confidence in both trending and volatility environments.
Key points include:
Adaptive Core (AMF Engine) – A dynamic framework that automatically adjusts for clearer long- and short-term opportunities and generates a robust tracking line.
Praetorian Guard – A built-in protective shield that activates in extreme conditions and helps stabilize performance when markets become turbulent.
Versatility – Effective across multiple timeframes, from scalping to swing trading, without constant parameter adjustments.
Clarity – Clear visual signals and color-coded monitoring for instant decision-making.
This strategy is designed for traders who want more than just entries and exits; it offers a command center for disciplined, adaptable, and resilient trading.
Disclaimer:
It should be noted that no strategy is guaranteed. This strategy does not provide buy-sell-hold advice. Responsibility rests with the user.
Version 2: Bugs overlooked in Version 1 have been corrected and improvements have been made.
AVWAP+RSI Confluence — 1R TesterRSI + 1R ATR - Monthly P\&L (v4)
WHAT THIS STRATEGY DOES (OVERVIEW)
* Pine strategy (v4) that combines a simple momentum trigger with a symmetric 1R ATR risk model and an on-chart Monthly/Yearly P\&L table.
* Momentum filter: trades only when RSI crosses its own SMA in the direction of the trend (price vs Trend EMA).
* Risk engine: exits use fixed 1R ATR brackets captured at entry (no drifting targets/stops).
* Accounting: the table aggregates percentage returns by month and year using strategy equity.
ENTRY LOGIC (LONGS & OPTIONAL SHORTS)
Indicators used:
* RSI(rsiLen) and its SMA: SMA(RSI, rsiMaLen)
* Trend filter: EMA(emaTrendLen) on price
Longs:
1. RSI crosses above its RSI SMA
2. RSI > rsiBuyThr (filters weak momentum)
3. Close > EMA(emaTrendLen)
Shorts (optional via enableShort):
1. RSI crosses below its RSI SMA
2. RSI < rsiSellThr
3. Close < EMA(emaTrendLen)
EXIT LOGIC AND RISK MODEL (1R ATR)
* On entry, snapshot ATR(atrLen) into atrAtEntry and the average fill price into entryPx.
* Longs: stop = entryPx - ATR \* atrMult; target = entryPx + ATR \* atrMult
* Shorts: mirrored.
* Stops and targets are posted immediately and remain fixed for the life of the trade.
POSITION SIZING AND COSTS
* Default position size: 25% of equity per trade (adjustable in Properties/inputs).
* Commission percent and a small slippage are set in strategy() so backtests include friction by default.
MONTHLY / YEARLY P\&L TABLE (HOW IT WORKS)
* Uses strategy equity to compute bar returns: equity / equity\ - 1.
* Compounds bar returns into current month and current year; commits each finished period at month/year change (or last bar).
* Renders rows as years; columns Jan..Dec plus a Year total column.
* Cells colored by sign; precision and maximum rows are controlled by inputs.
* Values represent percentage returns, not currency P\&L.
VISUAL AIDS
* Two pivot trails (pivot high/low) are plotted for context only; they do not affect entries or exits.
CUSTOMIZATION TIPS
* Raise rsiBuyThr (long) or lower rsiSellThr (short) to filter weak momentum.
* Increase emaTrendLen to tighten trend alignment.
* Adjust atrLen and atrMult to fit your timeframe/instrument volatility.
* Leave enableShort = false if you prefer long-only behavior or shorting is constrained.
NON-REPAINTING AND BACKTEST NOTES
* Signals use bar-close crosses of built-in indicators (RSI, EMA, ATR); no future bars are referenced.
* calc\_on\_every\_tick = true for responsive visuals; Strategy Tester evaluates on bar close in history.
* Backtest stop/limit fills are simulated and may differ from live execution/liquidity.
DISCLAIMERS
* Educational use only. This is not financial advice. Markets involve risk. Past performance does not guarantee future results.
INPUTS (QUICK REFERENCE)
* rsiLen, rsiMaLen, rsiBuyThr, rsiSellThr
* emaTrendLen
* atrLen, atrMult, enableShort
* leftBars, rightBars, prec, showTable, maxYearsRows
SHORT TAGLINE
RSI momentum with 1R ATR brackets and a built-in Monthly/Yearly P\&L table.
TAGS
strategy, RSI, ATR, trend, risk-management, backtest, Pine-v4
Turtle Trading System (Not Financial Advise)I am testing this script, not financial advise, but this is how it works, i hope;
How the Script Works
The script is a TradingView strategy that backtests and automates the Turtle rules. It uses two systems, a short-term S1 (20-day) and a long-term S2 (55-day), which you can select to test.
The strategy follows these core principles:
Trend Identification: The script uses Donchian Channels to identify breakouts. A new trend is signaled when the price breaks above the highest high or below the lowest low of a specified period.
Position Sizing: The script automatically calculates the size of each trade unit to ensure you risk a consistent percentage of your capital on every trade. This is based on the Average True Range (ATR), which measures volatility.
Pyramiding: When a trade moves in a profitable direction, the script will add more units at specific intervals to increase your position and ride the trend. This is how the Turtles made their big profits.
Win/Loss Condition:
A crucial rule is implemented for System 1 (S1): you only enter a trade if the previous S1 trade was a loss. If the last S1 trade was a win, you must wait for a signal from System 2 (S2).
How to Enter and Exit a Long Position
The script will automatically enter a long position when the price breaks above the highest high of the last 20 days (S1) or 55 days (S2), depending on which system you've selected.
Stop-Loss (SL): Your stop-loss is automatically placed at a distance of 2 * N (ATR) below the entry price. . This is a crucial risk management rule that limits your potential loss. The stop-loss is also plotted visually on the chart.
Exit Long: The script will close the long position automatically under two conditions:
Reversal: The price drops and closes below the lowest low of the last 10 days (S1) or 20 days (S2).
Stop-Loss Hit: The price hits your initial stop-loss, limiting your loss.
How to Enter and Exit a Short Position
Enter Short: The script will automatically enter a short position when the price breaks below the lowest low of the last 20 days (S1) or 55 days (S2).
Stop-Loss (SL): Your stop-loss is automatically placed at a distance of 2 * N (ATR) above the entry price. . This prevents large losses if the price moves against you.
Exit Short: The script will close the short position automatically under two conditions:
Reversal: The price rallies and closes above the highest high of the last 10 days (S1) or 20 days (S2).
Stop-Loss Hit: The price hits your initial stop-loss, limiting your loss.
ENAUSDT.P Strategy – Alerts Ready (JSON)Ena/usdt trend trading strategy.
Backtesting results:
Starting date: 2 September 2025
7 days:
PnL: +13.91 (+1.39%)
Max drawdown: -17.68 (-1.73%)
Total trades: 22
Win rate: 63.64%
Profit factor: 1.82
30 days:
PnL: +81.16 (+8.12%)
Max drawdown: -26.38 (-2.51%)
Total trades: 89
Win rate: 68.54%
Profit factor: 2.52
90 days:
PnL: +270.64 (+27.06%)
Max drawdown: -36.29 (-3.34%)
Total trades: 273
Win rate: 67.09%
Profit factor: 2.72
365 day:
PnL: +702.89 (+70.29%)
Max drawdown: -130.40 (-10.16%)
Total trades: 986
Win rate: 65.42%
Profit factor: 1.67
AMF PG Strategy AMF Command Center Strategy (Praetorian Guard)
The AMF PG Strategy (Praetorian Guard) is an advanced trading system built to adapt seamlessly across market conditions. Its unique structure balances precision entries with intelligent protection, giving traders confidence in both trending and volatile environments.
Key highlights include:
Adaptive Core (AMF Engine) – A dynamic framework that automatically adjusts and generates a powerful tracking line for clearer long and short opportunities.
Praetorian Guard – A built-in protective shield that activates in extreme conditions, helping stabilize performance when markets become turbulent.
Versatility – Effective across multiple timeframes, from scalping to swing trading, without constant parameter adjustments.
Clarity – Clean visual signals and color-coded tracking for instant decision-making.
This strategy was designed for traders who want more than just entries and exits — it offers a command center for disciplined, adaptive, and resilient trading.
RMI trend changeThe "RMI Trend Swing" is an automated trend-following and swing trading strategy built on a composite indicator of RMI (Relative Momentum Index) and MFI (Money Flow Index), supplemented by ADX (Average Directional Index) trend strength filtering and time-based session filtering. The strategy is designed to identify the inception points of medium-term trends and enter positions when momentum is strong, aiming to capture significant swing moves. It provides intuitive visual feedback through a dynamic band on the chart.
Core Logic & Components
Core Indicator Calculation:
RMI-MFI Composite Value: The primary signal generator. It averages a variant of the standard RSI (RMI) and the MFI, combining price change and volume factors to provide a more holistic view of market momentum.
Range-Weighted Moving Average (RWMA): A moving average weighted by each bar's range. Bars with higher volatility (larger ranges) have a greater impact, making the RWMA more responsive to market consensus and significant price movements.
Volatility Band (Band): Dynamically calculated based on the ATR (Average True Range), forming upper and lower channels around the RWMA to act as dynamic support and resistance levels.
Trade Signal Generation:
Long Signal (Buy): Generated when the RMI-MFI composite value crosses above the user-defined "Positive above" threshold (default: 66) from below, concurrently with a rising short-term EMA(5), and only if the ADX indicator confirms strong trend strength (above its threshold, default: 25).
Short Signal (Sell): Generated when the RMI-MFI composite value falls below the user-defined "Negative below" threshold (default: 30), accompanied by a falling short-term EMA(5), and confirmed by a strong ADX reading.
Multi-Layer Filtration:
ADX Trend Filter: Signals are only executed if the ADX value is above the set level, ensuring the strategy only trades in trending markets and avoids whipsaws during choppy, low-trend consolidation periods.
Trading Session Filter: Users can define a specific daily trading window (default: 09:30 - 16:00). Entry orders are only placed during this active session, helping to avoid the low liquidity and atypical volatility often seen in pre-market and post-market hours.
Auto-Close Mechanism: The strategy includes a scheduled close function (default: between 15:10-15:20) to exit all positions automatically before the market close, effectively managing overnight risk for day-trading scenarios.
Visual Output:
The strategy plots a distinct colored band on the chart for at-a-glance market assessment.
Green Band/Candles: Indicates a bullish trend phase. The RWMA line and the band below it are colored green, and all price candles also turn green.
Red Band/Candles: Indicates a bearish trend phase. The RWMA line and the band above it are colored red, and all price candles turn red.
Buy/Sell Labels: Small labels are plotted on the chart at the exact bar where a new entry signal is generated, providing clear markers for trade triggers.
Key Advantages
Multi-Factor Confirmation: Combines momentum, volume-weighted averages, and trend strength for higher-quality signals.
Integrated Risk Management: Employs ADX and time filters to avoid poor trading environments and includes a mandatory daily close.
Intuitive Visualization: The colored bands and candles provide an immediate and clear representation of the prevailing market regime.
Ideal Instruments & Market Conditions
This strategy is best suited for trend-prone instruments (such as equity indices, major cryptocurrencies, and forex majors) on intraday timeframes for swing trading. It performs optimally in markets with clear, sustained directional movement and will typically generate fewer trades during sideways, ranging conditions. 策略概述
“RMI趋势波段”是一个基于RMI(Relative Momentum Index,相对动量指数)与MFI(资金流量指数)复合指标,并辅以ADX(平均方向指数)趋势强度过滤和交易时间过滤的自动化趋势跟踪与波段交易策略。该策略旨在识别中期趋势的起始点,并在趋势强劲时入场,以期捕捉主要波段行情,同时通过可视化带状区域直观展示市场动态。
核心逻辑与组成部分
核心指标计算:
RMI-MFI 复合值: 策略的核心信号源。它计算了标准RSI的变体(RMI)和MFI的平均值,结合了价格变动和交易量因素,能更综合地反映市场的动量。
范围移动平均线 (RWMA): 一种根据K线波动幅度加权的移动平均线。波动大的K线权重更高,能更灵敏地反映市场价格的共识。
波动带 (Band): 基于ATR(平均真实波幅)动态计算得出,围绕RWMA形成上轨和下轨,构成一个动态支撑阻力通道。
交易信号生成:
多头信号 (买入): 当RMI-MFI复合值从下方突破预设的“Positive above”阈值(默认66),同时短期EMA(5)上扬,且ADX指标显示趋势强劲(高于阈值,默认25)时,产生买入信号。
空头信号 (卖出): 当RMI-MFI复合值跌破预设的“Negative below”阈值(默认30),同时短期EMA(5)下跌,且ADX指标显示趋势强劲时,产生卖出信号。
多重过滤条件:
ADX趋势过滤: 只有当ADX值高于设定的水平时,才会接受RMI产生的交易信号,确保只在趋势明确的市场环境中交易,避免在震荡市中频繁假信号。
交易时间过滤: 用户可自定义每日的交易时间段(默认:09:30 - 16:00),策略只在该时间窗口内才会开仓,帮助规避盘前盘后流动性低或波动异常的时间段。
自动平仓: 策略内置定时平仓功能(默认在15:10-15:20之间),每日收盘前自动了结所有头寸,避免隔夜风险。
可视化效果:
策略在图表上绘制了精美的彩色带状区域。
绿色区域/蜡烛图: 表示当前为多头趋势,RWMA线及下方的带状区域会显示为绿色,同时所有K线也会变为绿色。
红色区域/蜡烛图: 表示当前为空头趋势,RWMA线及上方的带状区域会显示为红色,同时所有K线也会变为红色。
在信号触发点,还会在图表相应位置生成买入或卖出的标签标记。
策略优势
多维度确认: 结合动量、成交量加权均线和趋势强度,信号质量较高。
风险控制: 通过ADX和时间过滤器有效过滤不良信号,并强制日内平仓。
直观清晰: 通过颜色和带状区域的变化,市场状态一目了然。
适用品种与场景
该策略主要适用于趋势性较强的标的(如股票指数、主流加密货币、外汇主要货币对等)的日中波段交易。在趋势明朗的行情中表现最佳,在横盘整理期间可能会减少交易频率。
Trend Scalping Strategy Overview
This is a short-term trading strategy designed to capitalize on momentum shifts within a broader trend. It combines multiple technical indicators across different timeframes—including Stochastic, RSI, and custom trend logic—to generate entry and exit signals. The strategy incorporates a time filter to operate only during specified high-liquidity hours and includes a mandatory end-of-session close-out to avoid overnight risk. It is suitable for volatile markets like equities, futures, and cryptocurrencies.
Input Parameters
Source
The price data used for calculations. Default is hl2 (the average of high and low prices).
Short Term Trend (x_len_a)
The period for the short-term RSI calculation. Default is 5. Used to capture recent price momentum.
Long Term Trend (x_len_b)
The period for the Stochastic Oscillator calculation. Default is 60. Defines the medium-to-long-term trend context.
Smooth Long Term Trend (x_k_b)
The smoothing period applied to the Stochastic value (K). Default is 13. Reduces noise for a clearer trend signal.
Clear Short Term Pullback Appears Recently (x_changk)
The lookback period to identify a recent significant pullback. Default is 15.
Threshold of Short Term Pullback Clear (x_rsi_ct)
The RSI level indicating an oversold (for longs) or overbought (for shorts) condition. Default is 35.0.
Threshold of Short Term Pullback End (x_rsi_ft)
The RSI level signaling that the short-term pullback has concluded and momentum is reversing. Default is 50.0.
Exit if Reason Over (x_exit_if_reason_over)
A boolean switch. If enabled, the strategy will automatically close a position if the original entry condition is no longer valid.
Time Filter (Start/End Hour & Minute)
Defines the specific intraday window during which the strategy is active (e.g., 7:00 to 15:10). All trades are initiated and managed only within this window.
Strategy Logic
Indicator Calculation:
y_stoch: The raw Stochastic Oscillator value calculated over the x_len_b period.
y_k: A smoothed version of the Stochastic (y_stoch) using a Simple Moving Average with period x_k_b.
y_rsi: The Relative Strength Index calculated on the Source price over the short-term period x_len_a.
Entry & Exit Conditions:
The core logic generates a composite signal (y_upper for long, y_lower for short) based on three components:
The deviation of the smoothed Stochastic (y_k) from its midpoint (50).
The deviation of the RSI (y_rsi) from its pullback-end threshold (x_rsi_ft).
The extremity of the recent RSI move compared to the pullback-clear threshold (x_rsi_ct) over the x_changk period.
Long Entry (LE): Triggered when the composite signal y_upper is greater than 0 AND the current time is within the allowed trading window.
Short Entry (SE): Triggered when the composite signal y_lower is less than 0 AND the current time is within the allowed trading window.
Conditional Exit: If x_exit_if_reason_over is true, long positions are closed if y_upper <= 0, and short positions are closed if y_lower >= 0.
Time-Based Filter:
The strategy only evaluates entries and exits if the current bar's time falls within the user-defined start_time and end_time range.
Mandatory Close-Out:
A critical risk management feature: All open positions are automatically closed at 16:10 (4:10 PM) based on the chart's timezone, ensuring no positions are held overnight or into the late session.
Plotting
The strategy plots three key series in the indicator pane:
Stochastic (y_stoch): Red line.
Smoothed Stochastic (y_k): Blue line.
RSI (y_rsi): Yellow line.
A hline at 50 serves as a visual midpoint reference for both Stochastic and RSI.
Usage Recommendations
This strategy performs best in markets with high volatility and strong trending characteristics.
It is highly recommended to use this script with a brokerage account that supports and enforces stop-loss orders on the strategy's behalf, as the script itself does not calculate stop-loss levels.
Parameters, especially periods and thresholds, should be optimized for the specific asset and timeframe being traded.
Always conduct rigorous backtesting and forward testing before deploying capital. 策略概述
本策略是一个基于多时间框架动能的短线交易策略,通过结合短期与长期趋势指标、RSI超买超卖判断以及时间过滤机制,在趋势明确时入场,并在特定条件或时间点退出交易。策略适用于股票、期货、加密货币等高频波动的市场。
输入参数说明
数据源(Source)
默认使用 hl2(最高最低价的平均值),也可选择其他价格数据。
短期趋势周期(Short Term Trend)
默认值为5,用于计算短期RSI,捕捉近期价格动量的变化。
长期趋势周期(Long Term Trend)
默认值为60,用于计算随机指标(Stochastic)的周期,判断中长期趋势方向。
长期趋势平滑周期(Smooth Long Term Trend)
默认值为13,对长期随机指标进行平滑处理,减少噪音。
近期回调检测周期(Clear Short Term Pullback Appears Recently)
默认值为15,用于检测短期是否出现明显回调。
RSI超卖阈值(Threshold of Short Term Pullback Clear)
默认值为35.0,RSI低于该值视为短期超卖,可能出现反弹。
RSI回调结束阈值(Threshold of Short Term Pullback End)
默认值为50.0,RSI回升至此表示短期回调结束。
条件失效时退出(Exit if Reason Over)
若启用,当入场条件不再成立时自动平仓。
交易时间范围
可设置策略运行的开始与结束时间(以小时和分钟为单位),仅在指定时间段内交易。
策略逻辑
指标计算:
随机指标(Stochastic):基于长期周期计算,反映价格在近期区间内的位置。
平滑随机值(y_k):对随机指标进行移动平均平滑处理。
RSI指标:基于短期周期计算,反映近期价格动量的强弱。
多空判断:
多头信号(y_upper):
当平滑随机值高于50、RSI高于结束阈值,且近期出现明显超卖回调时,触发做多信号。
空头信号(y_lower):
当平滑随机值低于50、RSI低于结束阈值,且近期出现明显超买回调时,触发做空信号。
时间过滤:
策略仅在用户设定的时间范围内(例如7:00至15:10)运行,避免在波动性较低或非主力交易时段操作。
强制平仓机制:
每天下午16:10(或指定时间区间)强制平仓所有头寸,避免隔夜风险或尾盘波动。
图表显示
策略在副图中绘制以下三条线:
随机指标(红色)
平滑随机值(蓝色)
RSI指标(黄色)
水平线50:作为多空分界线参考。
使用建议
本策略适合在流动性高、波动性强的市场中运行。
建议配合止损机制使用,以控制单笔交易风险。
用户可根据不同品种调整参数周期和阈值,优化入场时机。