Uptrick: Price Memory Trend StrategyHere are clear, structured notes explaining the Pine Script code — the simplified "LSTM-like" trend predictor you were given earlier.
Overall Purpose of the Script
The script tries to imitate LSTM memory behavior (long-term memory + selective forgetting/updating) using only Pine Script's basic math and variables — because real LSTM neural networks (with matrices, multiple gates, backpropagation) are not possible in Pine.
It creates a persistent memory line that:
slowly forgets old information,
selectively accepts new price information,
tries to act as a trend-following / regime-detecting centerline.
Then it uses momentum of this memory line + deviation size to decide whether the market is in an uptrend or downtrend.
Key Sections Explained
1. Inputs (tunable parameters)
pinescriptmemoryStrength = input.float(0.14, "Forget Gate strength (like 1-f)", step=0.01, minval=0.01, maxval=0.99)
inputGate = input.float(0.22, "Input Gate strength", step=0.01, minval=0.01, maxval=1.0)
cellDecay = input.float(0.965, "Cell state decay", step=0.001, minval=0.8, maxval=0.999)
lookback = input.int(21, "Lookback for momentum", minval=5)
sensitivity = input.float(1.35, "Trend sensitivity multiplier", step=0.05)
ParameterWhat it controlsTypical effectHigher value means…memoryStrengthHow aggressively old memory is forgottenControls "forget gate" strengthForgets faster, more responsiveinputGateHow much new price is allowed into memoryControls how much price influences cellMemory follows price more closelycellDecayNatural fading of long-term memory per barPrevents memory from living foreverLower = memory fades fasterlookbackPeriod for momentum and deviation calculationSmoothness of trend detectionLonger = smoother, fewer signalssensitivityHow strong momentum must be to flip trendFinal trigger strictnessHigher = fewer but stronger signals
2. Memory Variables (the "LSTM core")
pinescriptvar float cell = na // long-term memory ≈ cell state C
var float hidden = na // short-term state ≈ hidden state h
if bar_index == 0
cell := price
hidden := price
cell → tries to act like LSTM cell state (long memory)
hidden → tries to act like LSTM hidden state (what we actually observe/use)
3. Simplified Gates
pinescriptforget = math.tanh(hidden * memoryStrength)
i_gate = math.tanh(price * inputGate)
candidate = price - hidden
forget — value between -1 and +1, but we treat higher positive = forget more
i_gate — how much new info we want to accept
candidate — the new information we could add (difference from current hidden)
Very crude approximation — real LSTM uses sigmoid + learned weights.
4. Core LSTM-like Update Rule
pinescriptcell := cell * (1 - forget) + candidate * i_gate
cell := cell * cellDecay
hidden := cell * 0.65 + price * 0.35
This is the heart of the "fake LSTM":
Keep (1 – forget) of old cell
Add a portion (i_gate) of the candidate change
Apply slow exponential decay (cellDecay < 1)
Hidden state = mix between long memory and current price
→ base = hidden becomes our smoothed, memory-aware centerline.
5. Trend Detection Logic
pinescriptmom = ta.change(base, lookback) // how much did memory move in last N bars?
dev = math.abs(price - base) // how far is price from memory center?
avgDev = ta.ema(dev, lookback * 2) // smoothed deviation size
trendScore = (mom / avgDev) * sensitivity // normalized momentum × sensitivity
Normalizes momentum by current volatility/deviation
High positive → strong upward memory movement → likely uptrend
High negative → strong downward memory movement → likely downtrend
6. Trend State Machine (non-repainting flip)
pinescriptvar int trend = 0 // 1 = Up, -1 = Down, 0 = Neutral
bullCondition = trendScore > 1.0 and trendScore <= 1.0
bearCondition = trendScore < -1.0 and trendScore >= -1.0
if bullCondition
trend := 1
else if bearCondition
trend := -1
else
trend := nz(trend )
Only changes trend when crossing the threshold from the other side
Prevents flickering / frequent flipping
Persistent until strong opposite signal appears
7. Visualization Summary
Background tint (light green/red)
Thick memory line (changes color with trend)
Dashed ±1.6× deviation bands
Big up/down labels on trend flips
Alert conditions on every new trend direction
Quick Tuning Guide
GoalSuggestionFewer but stronger signals↑ sensitivity (1.6–2.2), ↑ lookback (30–60)More responsive / earlier entries↑ inputGate, ↓ cellDecay, ↓ memoryStrengthSmoother memory line↓ inputGate, ↑ cellDecay (0.98+)Better in choppy markets↑ lookback, ↑ sensitivityBetter in trending markets↓ lookback, moderate sensitivity (~1.2–1.5)
Most Important Takeaway
This is not a real LSTM — it's a hand-crafted, analog-style memory filter inspired by LSTM ideas.
It tries to combine:
slow-adapting memory (like EMA but with forgetting control)
selective update depending on current deviation
momentum-of-memory as trend strength
Many traders find this kind of memory line more "intelligent" than simple moving averages when tuning the forget/input/decay parameters to match the market personality.
Indicators and strategies
London Breakout Optimized PFBest Practices:
Only take trades in trend and above/below VWAP
Avoid trading in low-volume or sideways markets
Use it for intraday 5-min charts (15-min for trend confirmation)
Track trades in a Trading Journal → improves discipline
Entry Rules:
Long (Buy):
Price above EMA21 & VWAP → bullish trend
EMA slope positive → strong trend confirmation
Pullback to entry zone OR breakout above resistance
Volume above 1.3× average → avoids weak moves
Short (Sell):
Price below EMA21 & VWAP → bearish trend
EMA slope negative → strong downtrend
Pullback to entry zone OR breakout below support
Volume above 1.3× average
Exit Rules:
Stop-Loss: ATR-based, dynamic (tight for fewer losses)
Take Profit: Risk × 3 (3:1 R:R)
Automatically handled by the strategy (strategy.exit)
Trade Manager + DivergenceTrade Manager + Divergence — Smart Entry & Automated Risk Control
Trade Manager + Divergence is a versatile trading strategy that combines automated RSI divergence detection, manual level entries, and a multi‑layered safety‑order system with advanced risk management.
It is designed for traders who want precise technical entries supported by fully automated position handling.
🔍 Key Features
1. RSI Divergence Entry Module
The strategy automatically detects:
Bullish divergence (Higher Low on RSI + Lower Low on price)
Bearish divergence (Lower High on RSI + Higher High on price)
Additional options include:
Divergence strength filtering
MA200 trend filter
Visual divergence markers on the chart
2. Manual Entry Levels
You can define:
A manual LONG entry price
A manual SHORT entry price
Automatic removal of the level after entry
Perfect for traders who prefer to work from key zones they identify themselves.
3. Multi‑Level Safety Order System
The strategy supports:
Initial base order
Up to 8 safety orders
Volume scaling
Step scaling
All parameters are fully customizable:
Order size
Distance between orders
Scaling coefficients
Maximum number of safety orders
4. Automated Take Profit
Take profit is calculated from the average position price:
Separate TP settings for LONG and SHORT
TP levels displayed directly on the chart
5. Breakeven Mechanism
After a specified number of safety orders, the strategy can:
Automatically close the position at breakeven
Include exchange fees in the calculation
6. Mini Status Panel
A compact table in the top‑right corner shows:
Position size
Position value
Number of open trades
Current PnL
Equity
This makes monitoring your position simple and intuitive.
⚙️ Clean and Organized Settings
All inputs are grouped into clear sections:
General
Entry Mode
Divergence Settings
Manual Levels
Risk Management
Each parameter includes a tooltip explaining its purpose.
📌 Disclaimer
This script does not guarantee profits and is not financial advice.
Always test strategies on historical data and use proper risk management.
ATR# ATR Trailing Stop Multi-Strategy v7 with Pivot & GST
## Overview
A comprehensive multi-indicator trading strategy that combines multiple technical analysis approaches with sophisticated risk management. The strategy uses a confirmation-based system where trades are executed only when multiple indicators agree on the direction.
## Core Strategy Logic
### Signal Confirmation System
- **Entry Condition**: Requires at least 3 confirmation points from different indicators
- **Weighted Indicators**:
- Dow Theory (Weight: 2 points)
- ATR Trailing Stop (Weight: 2 points)
- Gaussian Smooth Trend (Weight: 1 point)
- KAMA (Weight: 1 point)
- VWMA (Weight: 1 point)
- Alligator (Weight: 1 point)
### Exit Conditions
- **Profit Exit**: When opposite signals achieve 3+ confirmation points
- **Stop Loss**: Fixed percentage stop loss (configurable)
- **Filter-Based Exit**: Signals from individual indicators when filters are violated
## Technical Indicators
### 1. Dow Theory Filter
- Analyzes volume and volatility conditions
- Uses SMA 20/50 crossovers for trend direction
- Volume must exceed MA by threshold (default: 1.5x)
- NATR must exceed threshold (default: 1.0%)
### 2. ATR Trailing Stop System
- Three ATR-based trailing lines (Fast/Medium/Slow)
- Fast: ATR(5) × 0.5 multiplier
- Medium: ATR(10) × 1.5 multiplier
- Slow: ATR(20) × 3.0 multiplier
- State changes when medium line crosses slow line
### 3. Gaussian Smooth Trend (GST)
- Advanced smoothing using DEMA, Gaussian filter, and SMMA
- Includes standard deviation bands for volatility filtering
- Multiple color schemes available for visualization
### 4. KAMA (Kaufman Adaptive Moving Average)
- Two KAMA lines with different lengths (10, 24)
- Adaptive smoothing based on market volatility
- Signals generated on crossovers
### 5. VWMA (Volume Weighted Moving Average)
- Price weighted by volume
- Signals on price crossing VWMA
### 6. Alligator Indicator
- Three SMMA lines (Jaw/Teeth/Lips)
- Standard Williams Alligator settings
- Signals based on line alignment and price position
## Entry Block Filters
### ADX Filter (Optional)
- Filters trades based on trend strength
- Configurable min/max values for long and short positions
- Default: ADX between 15-60
### RSI Filter (Optional)
- Additional RSI-based filtering
- Separate ranges for long and short positions
- Default Long: RSI 20-70, Short: RSI 30-80
### NATR Filter (Optional)
- Filters based on normalized ATR
- Ensures minimum volatility for valid signals
- Default Long/Short: NATR 0.5-5.0%
## Additional Filters
### CCI Filter
- Filters signals based on CCI momentum
- Oversold condition for longs: CCI > -100 and rising
- Overbought condition for shorts: CCI < 100 and falling
### Volatility Filter
- Minimum ATR percentage requirement
- Default: 0.3% minimum ATR/price ratio
### Distance Filter
- Minimum distance from Alligator lips in pips
- Ensures sufficient movement before entry
- Default: 10 pips minimum
## Pivot Points Support
- Multiple pivot point calculation methods:
- Traditional
- Fibonacci
- Woodie
- Classic
- DM
- Camarilla
- Multiple timeframe support (Daily, Weekly, Monthly, etc.)
- Visual display of pivot levels and labels
## Risk Management
### Stop Loss
- Configurable percentage-based stop loss
- Default: 2.5%
- Applied immediately on entry
### Position Management
- Single position only (no pyramiding)
- Position tracking with P/L calculation
- Visual exit lines for individual indicator signals
## Visual Features
### Signal Display
- Colored arrows for each indicator signal
- Entry/Exit labels with price information
- Horizontal exit lines for visual confirmation
- All indicators can be toggled on/off
### Color Schemes
- GST with multiple color modes
- Customizable pivot point colors
- Consistent color coding across indicators
## Alerts
- Entry alerts for both long and short positions
- Exit alerts for both profit and stop loss exits
- Individual indicator alerts available
## Settings Overview
### Strategy Settings
- Dow Theory thresholds (Volume, NATR)
- Stop loss percentage
- ATR Trailing parameters
- Indicator toggles and weights
### Filter Settings
- Entry block filters (ADX, RSI, NATR)
- CCI parameters
- Volatility and distance filters
### Visual Settings
- Show/hide indicators
- Arrow and label display
- Color scheme selection
### Pivot Settings
- Calculation method
- Timeframe
- Level colors and visibility
## Usage Recommendations
### Timeframes
- Works on all timeframes
- Pivot points automatically adjust to timeframe
- Recommended: 15-minutes and above
### Market Conditions
- Best in trending markets
- Multiple filters help avoid choppy conditions
- Volume confirmation adds reliability
### Customization
- Adjust confirmation thresholds for more/less aggressive trading
- Modify filters based on market volatility
- Fine-tune stop loss based on risk tolerance
## Performance Notes
- Strategy uses close prices for order execution
- Maximum 500 labels to prevent chart clutter
- All calculations in real-time
- Historical backtesting supported
## Important Notes
- Past performance doesn't guarantee future results
- Test thoroughly before live trading
- Adjust parameters for specific instruments
- Consider commission and slippage in backtesting
Robert Miner DTOsc MTF - v6Below is the implementation of the MTF Momentum (DTOsc) with Miner's specific Buy Stop / Sell Stop entry logic. This ensures you only enter when the market breaks the high/low of the signal bar, confirming the reversal.
Right-Side Master Pro: Adaptive Trend SystemHere is a professional English introduction for your strategy, tailored for a TradingView description, portfolio presentation, or documentation.
I have provided two versions: a Concise Summary (for quick reading) and a Detailed Technical Breakdown (for in-depth explanation).
Option 1: Concise Summary (Best for TradingView Description)
Strategy Name: Right-Side Master Pro: A Systematic Trend-Following System
Description: Built on the timeless principles of trading legends like Jesse Livermore, William O'Neil, and Mark Minervini, the Right-Side Master Pro is a pure trend-following system designed to prioritize confirmation over prediction.
This strategy does not guess bottoms; it waits for specific momentum breakouts (Donchian Channels) aligned with institutional moving averages. Its core edge lies in its "Market Regime Filter," which restricts long positions on altcoins unless Bitcoin is in a confirmed uptrend (above the 200 EMA), effectively shielding capital during bear markets.
Key Features:
The "M" Filter: Automatically filters out bad market environments by tracking BTC trend health.
Hybrid Exit Strategy: Secures wins by closing 50% of the position at a 2R (Reward/Risk) target, while letting the remainder ride the "fat tail" trends with a dynamic trailing stop.
Capital Efficiency: Implements a "Time Stop" to cut stagnant trades that fail to launch within 5 bars, keeping capital active.
Volatility Sizing: Dynamically adjusts position size based on ATR, ensuring consistent risk exposure regardless of market volatility.
Option 2: Detailed Technical Breakdown (Best for Documentation)
Title: The Right-Side Master Pro Edition
Overview The Right-Side Master Pro is a sophisticated algorithmic trading strategy engineered for the cryptocurrency markets. It automates the "Right-Side Trading" philosophy, focusing on entering established trends during high-momentum breakouts while maintaining strict defensive protocols.
Core Logic & Mechanisms
1. Trend & Environment Filtering (The "M" Factor) Following O'Neil's CAN SLIM principle on Market Direction, this strategy incorporates a Bitcoin Regime Filter.
Logic: It monitors Bitcoin’s price relative to its 200-period EMA.
Effect: If BTC is bearish, the strategy disables all long signals for altcoins, preventing "catching falling knives" during systemic corrections.
2. Precision Entry (Momentum)
Trigger: Utilizes a Donchian Channel Breakout (20-period high) to identify genuine strength.
Trend Template: Entries are only valid if the short-term EMA (20) is above the long-term EMA (50), confirming a Stage 2 uptrend structure.
3. Advanced Risk Management
Volatility Sizing: Position size is calculated mathematically using Risk % / (2 * ATR), ensuring that high-volatility coins receive smaller allocations and stable coins receive larger ones.
Time Stop: Adhering to the "Time is Money" principle, the strategy forces an exit if the price fails to move away from the cost basis within 5 candles, eliminating dead money.
4. Hybrid Execution (The "Free Roll")
Take Profit 1 (TP1): Automatically liquidates 50% of the position when the price hits a 2:1 Reward-to-Risk ratio. This banks profit and reduces psychological pressure.
Trailing Stop: The remaining 50% is managed with a loose ATR-based trailing stop, designed to capture outlier trends (100%+ moves) without being shaken out by intraday noise.
Recommended Configurations
Daily Timeframe (1D): For conservative, high-win-rate growth using leverage (2x-3x).
4-Hour Timeframe (4H): For aggressive, high-turnover growth using spot or low leverage (1x).
ES 1m EMA Bounce Scalp - High RR v6# MES/ES 1-Minute EMA Bounce Scalp – High RR with Partial & Trailing (100% Win Rate in Backtest Oct 2025–Jan 2026)
**Overview**
This is a high-probability, mean-reversion / trend-continuation scalping system designed for the Micro E-mini S&P 500 (MES) or E-mini S&P 500 (ES) on the **1-minute chart**. It enters on pullback bounces off the 20-period EMA during intraday sessions, using RSI momentum confirmation, volume filter, and ADX trend strength to select high-quality setups.
The core edge comes from:
- Tight initial stop (4 points)
- 50% partial profit at 1:1 RR (locks in quick wins and moves stop to breakeven)
- Remaining 50% trails aggressively (trail offset 2 points) to let winners run to 8–10 points (1:2+ effective RR)
**Key Features**
- Longs & Shorts symmetric (pullback bounce logic)
- Trades only during US RTH (9:30–16:00 ET)
- Filters: RSI >40 (long) / <60 (short), volume > 20-SMA, ADX(14) >20
- No martingale, no pyramiding, one trade at a time
- Bracket + trailing managed automatically in Pine Script
**Backtest Highlights** (Oct 23, 2025 – Jan 21, 2026 on ES1!)
- Total trades: 107
- Win rate: 100% (0 losers)
- Net profit (1 contract): $20,227.50 after commissions
- Commissions: $322.50 (~$3 round-trip)
- Max open (floating) drawdown: –$3,275 (never realized a loss)
- Avg P&L per trade: ~$189 (≈3.78 points net)
- Longs: 45 trades, avg hold ~2.2 hours
- Shorts: 62 trades, avg hold ~8.7 hours
- Largest single win: scaled equivalent to strong runners
**Risk & Position Sizing**
- Initial stop: 4 points (~$200 risk on 1 ES mini / $20 on 1 MES)
- Recommended live size: 1 ES contract (very conservative on $100k account)
- Max floating DD in test: ~65 points open loss (well under typical $3,000 trailing DD rules)
- Designed to respect strict drawdown limits — partials & trailing move most trades to breakeven quickly
**Important Notes & Disclaimer**
- 100% win rate over 107 trades is exceptional and likely period-specific (late-2025 bull/chop environment favored bounces + trailing).
- Forward-test / paper trade required before live capital. Real slippage, news events, and execution delays may reduce performance.
- Not financial advice. Past performance ≠ future results. Use at your own risk.
- Best used with low-commission futures broker (Tradovate, AMP, IBKR, etc.) and 1-contract sizing to start.
**How to Use**
1. Apply to MES1! or ES1! on 1-minute chart
2. Set alerts for entries (built-in strategy alerts work perfectly)
3. Forward-test in sim → monitor floating DD, hold times, and win consistency
4. Manual or webhook auto-execution (e.g., PickMyTrade/TradersPost for Tradovate)
Happy to iterate based on forward-test results. Share your live stats!
Cheers,
Chris Brown (@hockeybrown2011)
Aggressive Growth Strategyagressive growth strategy for day trading sample script testing purpose only. do not copy this strategy
OrangePulse v3.0 Lite - Educational DCA StrategyThis open-source script is a simplified version of the OrangePulse algorithm, designed for educational purposes to demonstrate the power of Dollar Cost Averaging (DCA) and Mean Reversion.
📈 Strategy Logic:
The script uses a combination of Bollinger Bands and RSI (Relative Strength Index) to identify potential mean reversion opportunities.
- Entry: Triggered when price pushes below the lower Bollinger Band while RSI is in oversold territory.
- Management: Utilizes up to 3 Safety Orders (DCA) to improve the average entry price during pullbacks.
🎯 Features:
• Customizable Volume Scale and Step Scale for Safety Orders.
• Visual AVG price line and TP/SL levels.
• Time-window filter for backtesting.
• Real-time Status Table for position monitoring.
This script is shared in the spirit of open-source development on TradingView. It is intended to help traders understand how automated position building and risk management work in volatile markets.
Check my profile status/bio for more information on our project.
⚠️ Disclaimer: For educational purposes only. Past performance does not guarantee future results.
Dips Oleg Adaptive Dip‑Buying Strategy with Lot Precision & Smart Averaging
📘 Description
This strategy is a personalized adaptation of an idea originally developed by the respected author fullmax.
I reworked the concept to suit my own trading approach, adding lot‑precision rounding to avoid exchange quantity errors when using webhooks, and enhancing the visual and analytical components of the script.
🔧 What’s New in This Version
Configurable lot precision to ensure clean, exchange‑safe order sizes
Improved UI elements: base‑order labels, compact mini‑table, grouped settings
Dynamic safety‑order pricing based on price drops and scaling factors
Flexible date‑range filtering for controlled backtesting
Clear visualization of SMA threshold, safety levels, breakeven, and take‑profit
Adaptive threshold logic that adjusts depending on trend conditions
🎯 Core Logic
The strategy monitors how far price deviates from a short‑term SMA.
When the deviation crosses a user‑defined threshold, the script opens a base position.
If price continues to dip, the system deploys safety orders with:
scalable volume
scalable distance
precise rounding for compatibility with webhook automation
Once the position is built, the strategy manages exits using a fixed take‑profit target.
A breakeven reference line and auto‑cleanup logic help maintain clarity and prevent stale orders.
⚙️ Feature Overview
Dip‑based entry logic with bull/bear threshold switching
Safety orders with volume and step scaling
Take‑profit management
Breakeven visualization
Mini‑table showing real‑time position metrics
Clean chart overlays for easier interpretation
📝 Disclaimer
This script is intended for educational and analytical use.
It does not guarantee profits and should be tested thoroughly before being used in live trading.
Price_Deviation Oleg📘 Description
This script is an extended and customized version of the original work by the respected author fullmax.
I adapted the logic for my own trading needs and added several improvements, including lot‑precision rounding to prevent exchange errors when using webhook automation, as well as additional visualization elements for clarity.
🔧 Key Enhancements
Lot precision control (prevents invalid quantity errors on exchanges when using webhooks)
Base order labels for easier visual tracking
Mini‑table with live position metrics
Configurable date‑range window for backtesting
Dynamic safety‑order price calculation
Trailing take‑profit option
Improved visualization of thresholds, MA, and TP levels
🎯 How the Strategy Works
The script calculates a moving average and compares the current price deviation against user‑defined thresholds.
When the deviation condition is met, the strategy opens a base position and then manages it using safety orders that scale in both volume and distance.
After entering a position, the script manages exits using:
a fixed take‑profit target
or an optional trailing take‑profit
plus a breakeven reference line
and an auto‑close mechanism when the averaging cycle resets
All order quantities are rounded according to the selected lot precision to ensure compatibility with exchange requirements when sending webhook‑based orders.
⚙️ Features Overview
Deviation‑based entry logic
Safety orders with volume and step scaling
Configurable date window for testing
Trailing TP with adjustable distance
Breakeven visualization
Mini‑table showing quantity, USD value, open trades, PnL, and equity
Clean and intuitive chart visualization
📝 Disclaimer
This script is provided for educational purposes only.
It does not constitute financial advice and does not guarantee profits.
Always test strategies on historical data before using them in live trading.
Mean Reversion Oleg📘 Description
This script is an extended and customized version of the original “Mean Reversion V‑F” created by the respected author fullmax.
I adapted the logic for my own trading workflow and added several improvements aimed at stability, automation, and exchange‑safe execution when using webhooks.
🔧 Key Enhancements
Lot precision control (prevents exchange errors when sending webhook orders)
Base order labels for visual clarity
Mini‑table with live position metrics
Dynamic deviation levels (L1–L5)
Static averaging levels (B2–B5)
Trailing take‑profit option
Support for stock mode (fixed units instead of quantity)
Webhook fields for entry and exit signals
🎯 How the Strategy Works
The script calculates a moving average and builds five deviation‑based levels below it.
When price reaches these levels, the strategy opens a base order (B1) and then averages the position using B2–B5 levels.
After entering a position, the strategy manages it using:
a fixed take‑profit target
or an optional trailing take‑profit
plus a visual table showing position size, USD value, open PnL, and equity
All quantities are rounded according to the selected lot precision to ensure compatibility with exchange requirements when using webhook automation.
⚙️ Features Overview
Automated long entries based on deviation levels
Configurable order sizes for each averaging step
Optional stock‑mode (units instead of calculated quantity)
Dynamic and static level visualization
Trailing TP with adjustable distance
Clean UI with optional labels and mini‑table
📝 Disclaimer
This script is provided for educational purposes only.
It does not constitute financial advice and does not guarantee profits.
Always test strategies on historical data before using them in live trading.
boll+ATR更具布林上下轨道做5分钟短线的剥头皮策略,并且更具atr移动止盈止损
Add Bollinger Bands to the upper and lower bands for a 5-minute short-term charting strategy, and add ATR trailing stop-loss and take-profit orders.
Trade ManagerDescription
This script is a trade‑management system designed for both automated and manual trading workflows.
It combines VWRSI‑based signals, customizable price levels, safety orders, take‑profit logic, and optional MA‑trend filtering.
Key features:
Automated entries based on VWRSI
Manual LONG/SHORT level entries
Priority‑based entry logic (first condition triggers the trade)
Safety order scaling (volume and step multipliers)
Take‑profit targets for both LONG and SHORT positions
Breakeven logic with adjustable thresholds
Optional MA‑trend filter
Mini‑table showing position metrics
Base order labels and lot‑precision control
How it works:
If multiple entry modes are enabled, the script opens a position based on the first condition reached.
After entering a trade, the position can be averaged using safety orders and closed at the configured profit target.
Notes:
This script is for educational purposes and does not guarantee profits.
Always test on historical data and understand the risks before using it in live trading.
BB Upper breakout Short +2% (dr Ziuber)A short position is opened when the price on the 1-hour chart exceeds the Bollinger Bands by more than 2%. The position is closed when the profit reaches 2%.
Swing Failure Pattern Strategy Btc Only 5min🔍 Overview
The Swing Failure Pattern (SFP) Strategy is a pure price-action trading system designed to capture liquidity sweeps and market reversals around key swing highs and lows.
It is based on the concept that price often briefly breaks a swing level to trigger stop-losses, then reverses in the opposite direction.
This strategy trades only confirmed SFP setups, ensuring disciplined entries with clearly defined risk.
📈 Bullish SFP (Long Setup)
A Bullish Swing Failure Pattern forms when:
A valid swing low is created
Price wicks below the swing low
The candle closes back above the swing level
Confirmation occurs when price closes above the opposing high
➡️ Action: Enter LONG on the confirmation candle close
📉 Bearish SFP (Short Setup)
A Bearish Swing Failure Pattern forms when:
A valid swing high is created
Price wicks above the swing high
The candle closes back below the swing level
Confirmation occurs when price closes below the opposing low
➡️ Action: Enter SHORT on the confirmation candle close
🛑 Risk Management
Stop Loss
Long → Low of the SFP wick
Short → High of the SFP wick
Take Profit
Fixed Risk : Reward = 1 : 2
All SL and TP levels are fixed at entry (no repainting)
🔁 Trailing Take Profit (Optional)
Trailing TP can be enabled from settings
Trailing starts after 1R profit
Trail distance is R-based and fully adjustable
Works for both long and short trades
⏰ Time Filters
Optional No-Trade on Saturday & Sunday
Prevents new entries during weekends
Active trades continue to manage SL & TP normally
⚙️ Strategy Features
Price-action based (no indicators)
Confirmation-only entries
No repainting logic
Works on all markets and timeframes
Orders executed on candle close
🎯 Best Use Cases
Forex
Indices
Crypto
Futures
Best performance during London & New York sessions
⚠️ Disclaimer
This strategy is intended for educational and backtesting purposes only.
Always test and manage risk appropriately before live trading.
TSLA Mechanical Day Trading Strategy📌 How to Use This
Apply to TSLA
Recommended timeframe: 1-minute or 5-minute
Session: Regular Trading Hours (9:30–16:00 NY time)
Designed for day trading only (no overnight holds)
⚙️ Strategy Logic (Mechanical Rules)
1️⃣ Opening Momentum Pullback
Gap ≥ ±0.5% vs prior close
Trade only after 9:45
Pullback toward VWAP
Enter in direction of gap
2️⃣ VWAP Mean Reversion
Price deviates from VWAP by ≥ 0.3%
Enters counter-move back toward VWAP
3️⃣ Risk Management
Fixed % stop loss
Fixed % take profit
Flat before close
Secuencia estricta (pendiente) HMA->RSI BB"The code combines a 100-period HMA as the first condition, and an RSI smoothed by a Bollinger Band set to default parameters of 24 and 1 standard deviation. The first condition is that the price is above or below the HMA. The second condition is that the RSI moves above or below the Bollinger Bands. Depending on how the conditions align, the system takes either a short or a long position."
Konigs | Bollinger Band Mean Reversion (Session Filter)Core Idea:
In sideways markets, price tends to revert to the mean (the middle band).
Strategy:
Buy when price touches or moves below the lower band.
Sell when price reaches or exceeds the upper band.
Exit at the middle band (20-period moving average).
Confirm with: RSI/Stochastic or candle patterns for reversal at the bands.
Only works with low-volatility instruments:
EURCHF
Filter certain time to avoid unexpected volatility
VIX Crossing# VIX Crossing Strategy
## Overview
VIX Crossing is a quantitative trading strategy that combines volatility signals from the VIX index with trend confirmation from the Nasdaq-100 (NDX) to generate long entry signals. The strategy employs multiple exit conditions to manage risk and lock in profits systematically.
## Strategy Logic
### Entry Condition
The strategy initiates a long position when:
- **VIX Crossunder**: The VIX closing price crosses below its 5-bar simple moving average (SMA), signaling a decrease in implied volatility
- **AND NDX Confirmation**: The Nasdaq-100 closes above its 21-bar exponential moving average (EMA), confirming uptrend strength
This dual-signal approach reduces false entries by requiring both volatility normalization and positive market momentum.
### Exit Conditions
The strategy automatically closes positions when any of the following conditions are met:
1. **VIX Crossover (Volatility Exit)**: VIX closes above its SMA, indicating rising volatility
2. **Time-Based Exit**: Position is force-closed after 10 bars from entry, preventing prolonged drawdowns
3. **Take-Profit Exit**: Position closes when unrealized profit exceeds $3,000 per contract
4. **Stop-Loss Exit**: Position closes when unrealized loss exceeds $1,500 per contract
Exit conditions are evaluated each bar while the position is open, with explicit logging of the exit reason for trade analysis.
## Configuration Parameters
| Parameter | Default | Purpose |
|-----------|---------|---------|
| VIX SMA Length | 5 | Smoothing period for VIX volatility baseline |
| NDX EMA Length | 21 | Smoothing period for Nasdaq-100 trend confirmation |
| Force Close After X Bars | 10 | Maximum holding period in bars |
| TP Amount per Contract | $3,000 | Profit target per contract |
| SL Amount per Contract | $1,500 | Loss limit per contract |
## Risk Management Features
- **Position Sizing**: Capital allocation based on profit/loss per contract rather than fixed units, allowing for scalable risk
- **Dual Risk Controls**: Combined time-based and price-based exits prevent extended exposure
- **Profit Asymmetry**: 2:1 profit-to-loss ratio encourages risk/reward discipline
- **Contract-Based Accounting**: Profit targets and stop losses scale with position size
## Capital Requirements
- **Initial Capital**: $50,000
- **Commission**: $3 per contract (cash-based)
- **Instrument**: Designed for index-based derivatives or equities with liquid options markets
## Technical Indicators Used
- Simple Moving Average (SMA) for VIX smoothing
- Exponential Moving Average (EMA) for NDX trend detection
- Crossover/Crossunder detection for signal generation
## Underlying Assumptions
1. VIX crossunder events represent mean-reversion opportunities in Nasdaq-heavy portfolios
2. NDX EMA confirmation filters out uncorrelated volatility spikes
3. 10-bar holding period aligns with typical mean-reversion timeframes
4. Contract-based profit targets accommodate varying leverage levels
Anhnga4.0 - Filter ToggleINPUTS:
1.5 0.8 (OR 1.6 0.5/0.6)
BE=0.45
1
MAs: 35 135
7
This Pine Script code defines a trading strategy named **"Anhnga4.0 - Filter Toggle"**. It is a trend-following strategy that uses momentum oscillators and moving averages to identify entries, while featuring a specific "Overextension Filter" to avoid buying at the top or selling at the bottom.
Here is a breakdown of how the script works:
---
## 1. Core Trading Logic (The Entry)
The strategy looks for a "perfect storm" of three factors before entering a trade:
* **Momentum (WaveTrend):** It uses the WaveTrend oscillator (`wt1` and `wt2`).
* **Long:** A bullish crossover happens while the oscillator is below the zero line (oversold).
* **Short:** A bearish crossunder happens while the oscillator is above the zero line (overbought).
* **Trend Confirmation:** The price must be on the "correct" side of three different lines: the 20-period Moving Average (BB Basis), the 50-period SMA, and the 200-period SMA.
* **The Window:** You don't have to enter exactly on the cross. The `Signal Window` allows the trade to trigger up to 4 bars after the momentum cross, provided the trend filters align.
## 2. The "Overextension" Filter
This is a unique feature of this script. It calculates the distance between the current price and the **50-period Moving Average**.
* If the price is too far away from the MA (defined by the **ATR Limit**), the script assumes the move is "exhausted."
* If `Enable Overextension Filter?` is on, the strategy will skip these trades to avoid "chasing the pump."
* **Visual Cue:** The chart background turns **purple** when the price is considered overextended.
---
## 3. Risk Management & Exit Strategy
The script manages trades dynamically using Bollinger Bands and Risk:Reward ratios:
| Feature | Description |
| --- | --- |
| **Stop Loss (SL)** | Set at the **Lower Bollinger Band** for Longs and **Upper Band** for Shorts. |
| **Take Profit (TP)** | Calculated based on your **RR Ratio** (default is 2.0). If your risk is $10, it sets the target at $20 profit. |
| **Breakeven** | A "protection" feature. Once the price moves in your favor by a certain amount (the `Breakeven Trigger`), the script moves the Stop Loss to your entry price to ensure a "risk-free" trade. |
---
## 4. Visual Elements on the Chart
* **Green Lines:** Your target price (TP).
* **Red Lines:** Your initial Stop Loss.
* **Yellow Lines:** Indicates the Stop Loss has been moved to **Breakeven**.
* **Purple Background:** High alert—price is overextended; trades are likely being filtered out.
---
## Summary of Settings
* **BB Multiplier:** Controls how wide your initial stop loss is.
* **ATR Limit:** Controls how sensitive the "Overextension" filter is (higher = more trades allowed; lower = stricter filtering).
* **Breakeven Trigger:** Set to 1.0 by default, meaning once you are "1R" (profit equals initial risk) in profit, the stop moves to entry.
DkS Market Structure Breakout Strategy Crypto & ForexDkS Market Structure Breakout Strategy Crypto & Forex
🔍 Overview
DkSPro – Universal Market Analysis is a structure-based trading strategy designed for Crypto and Forex markets, focused on trend alignment, breakout confirmation, and volume validation.
This strategy is built to filter low-quality trades, avoid ranging conditions, and reduce false breakouts by requiring multiple layers of confirmation before any trade is executed.
It is intended for scalping and intraday trading, prioritizing consistency and risk control over trade frequency.
🧠 Strategy Logic (How It Works)
DkSPro follows a sequential decision process, not a single-indicator signal:
Trend Bias (EMA Structure)
A fast and slow EMA define the directional bias.
Long trades are only allowed during bullish EMA alignment.
Short trades are only allowed during bearish EMA alignment.
This prevents counter-trend and ranging-market entries.
Market Structure & Breakout Validation
The strategy identifies recent swing highs and lows.
Trades are triggered only after a confirmed breakout of structure, not during consolidation.
This avoids early entries and false momentum moves.
Volume Confirmation
Volume must exceed its moving average by a defined multiplier.
This ensures participation and filters out low-liquidity breakouts.
Volume thresholds adapt depending on the selected trading mode.
Momentum Confirmation (RSI)
RSI is used strictly as a momentum filter, not as a standalone signal.
It confirms that price movement aligns with the breakout direction.
Risk Management (Mandatory)
Every position includes a predefined Stop Loss and Take Profit.
Position sizing is based on a fixed percentage of equity, keeping risk per trade within sustainable limits.
All conditions must align simultaneously; otherwise, no trade is executed.
⚙️ Trading Modes
SAFE Mode
Stronger volume and RSI thresholds
Fewer trades, higher selectivity
Designed for risk control and consistency
AGGRESSIVE Mode
Slightly relaxed filters
Higher trade frequency during strong momentum
Intended for experienced users only
📊 Markets & Assets
This strategy has been actively used and tested on:
🟢 Crypto (Binance / Binance.US)
SOL-USDT
XRP-USDT
Other high-liquidity pairs (BTC, ETH)
Crypto mode benefits from stronger volume confirmation to adapt to higher volatility.
🔵 Forex
Major pairs such as EURUSD, GBPUSD, USDJPY
Optimized for liquid markets with lower relative volume
The same structural logic applies to both markets, with volume behavior naturally adapting to each asset class.
⏱ Recommended Timeframes
Crypto: 5m – 15m
Forex: 15m – 1H
Lower timeframes (1m) are not recommended due to noise and unreliable volume behavior.
🧪 Backtesting & Settings Transparency
Default strategy properties are intentionally conservative to reflect realistic conditions:
Initial capital: $20,000
Position size: 2% of equity
Commission: 0.08%
Slippage: 1 tick
Fixed Stop Loss and Take Profit on every trade
Backtests should be performed on sufficient historical data (ideally 6–12 months) to ensure a statistically meaningful sample size (100+ trades).
📈 Originality & Usefulness
DkSPro is not a simple indicator mashup.
Each component serves a specific role in a layered confirmation system:
EMAs define direction
Structure defines timing
Volume validates participation
RSI confirms momentum
Risk management controls exposure
Removing any layer significantly reduces signal quality. The strategy is designed as a complete decision framework, not a signal generator.
⚠️ Important Notes
This script is an analysis and execution tool, not financial advice.
Market conditions change, and no strategy performs well in all environments.
Users are encouraged to backtest, forward test, and adjust position sizing according to their own risk tolerance.
🧩 Version Notice
This publication represents a consolidated and refined version of an internal experimental script.
No parallel or duplicate versions are intended.
All future improvements will be released exclusively using TradingView’s Update feature.
🇪🇸 Descripción en Español (Resumen)
DkSPro es una estrategia basada en estructura de mercado, diseñada para Crypto y Forex, que combina tendencia, ruptura de estructura, volumen y control de riesgo.
Solo opera cuando todas las condiciones se alinean, evitando rangos, falsas rupturas y sobreoperar.
Ha sido utilizada en Binance con pares como SOL-USDT y XRP-USDT, así como en Forex, siempre con gestión de riesgo fija y condiciones realistas.






















