استراتيجية Pine Script®
المؤشرات والاستراتيجيات
استراتيجية Pine Script®
Xbirch_Turtle_ Crypto_CalcМодернизированная стратегия Черепах.
Вход/выход по каналу Дончиана, стопы по величине ATR, возможность выбора лонг/шорт/всё. Имеется пирамидинг - добавление по +0,5ATR от первого бая, не более 4х входов. Модернизированный стоп - по ATR от первого бая.
Не финансовый совет.
A modernized Turtle strategy.
Entry/exit based on the Donchian Channel, stops based on the ATR value, and the ability to choose long/short/all options. Pyramiding is available – adding +0.5 ATR from the first buy, with a maximum of four entries. The modernized stop is based on the ATR value from the first buy.
This is not financial advice.
استراتيجية Pine Script®
extradestrategy.limited.editiom 2026cocok untuk btc usd tidak di perjual belikan harap tidak menggunakan sembarangan
استراتيجية Pine Script®
The Engulfing Liquidity Signal with Adjustable Trailing StopEngulfing Liquidity Signal with Adjustable Trailing Stop
This strategy is designed to enter long trades based on the Engulfing Liquidity Signal combined with a Trailing Stop. The strategy uses custom volume analysis and price action to detect potential market opportunities. The Trailing Stop is adjustable, allowing traders to customize the distance at which the stop will trail the price.
Key Features:
Engulfing Liquidity Signal: The strategy enters a trade when the market shows signs of strong liquidity and price action, typically when there is a strong reversal signal (bullish engulfing) accompanied by higher volume.
Trailing Stop: A dynamic exit strategy that locks in profits by trailing the stop level behind the highest price achieved since the trade entry. This prevents the position from being closed prematurely while still protecting profits if the market reverses.
Customizable Trailing Stop: Users can adjust the trailing stop percentage via the settings. This allows for greater flexibility in how closely the stop will trail the price.
No Fixed Take Profit: The strategy uses only the trailing stop, ensuring that profits are maximized based on price action without a fixed profit target.
How the Strategy Works:
Buy Signal (LongC):
The strategy triggers a buy signal when a bullish engulfing pattern occurs, and the liquidity conditions align (i.e., the volume is increasing and price action shows signs of a potential reversal).
The strategy enters a long position when the signal conditions are met.
Trailing Stop Logic:
Once the trade is initiated, a trailing stop is applied. The stop level follows the highest price achieved since entry, trailing the price based on a user-defined percentage.
The stop level adjusts upward as the price increases, locking in profits. If the price reverses and hits the trailing stop, the trade is closed.
The trailing stop is dynamic, meaning it moves only in the direction of profit, but it will not move lower once it has been set.
Sell Signal (ShortC):
The position will also be closed if a sell signal (ShortC) is generated. This ensures that the strategy exits the trade when a potential reversal is detected in the market.
No Fixed Take Profit:
The strategy does not use a fixed take profit level. Instead, the profit is managed entirely by the trailing stop, which ensures that positions remain open as long as the market is moving in favor of the trade, allowing the position to capture the maximum possible profit.
Settings:
Trailing Stop Percentage: The user can adjust the trailing stop distance by setting a percentage value between 10% and 100%. This controls how tightly or loosely the trailing stop will follow the price.
Benefits:
Maximized Profits: By using a trailing stop, the strategy aims to capture as much profit as possible without prematurely exiting trades.
Customizable: The adjustable trailing stop allows traders to tailor the strategy to their risk tolerance and market conditions.
Simple & Effective: The strategy is straightforward, relying on price action and volume signals, making it easy to understand and implement.
Ideal Use Case:
This strategy is suitable for traders who prefer to let their profits run and manage risk with a trailing stop. It is particularly useful in trending markets where the price continues to move in one direction for an extended period. By using a trailing stop, the strategy allows you to stay in the market and capture large moves while protecting profits.
This strategy provides an excellent combination of automated trade management with a Trailing Stop and Engulfing Liquidity Signal, making it a solid choice for traders seeking to automate their trades with customizable risk management.
استراتيجية Pine Script®
Gold Adaptive Surfer v42 [huntamayung]Just a trend-following optimized for minimal risk and high grip onto trend. Try to use it as a signal in 1 minute timeframe. Note that this was optimized for OANDA:XAUUSD only.
استراتيجية Pine Script®
Gold Smart Scalper V3 - Clean ChartOverview
The Gold Smart Scalper V3 is a trend-following momentum strategy specifically optimized for XAU/USD (Gold). It focuses on catching "value pullbacks" within a strong trend, avoiding the noise of sideways markets. Unlike many scalpers that use lagging indicators for exits, this version uses fixed ATR-based targets to lock in profits during high-volatility moves common in Gold.
Core Methodology
The strategy operates on three layers of confirmation:
Macro Trend (HTF Filter): Uses a 50-period EMA to ensure trades are only taken in the direction of the higher-timeframe momentum.
The Value Zone: Instead of "chasing" green or red candles, the script waits for a pullback to the space between the 9 EMA and 21 EMA. This ensures a better risk-to-reward entry point.
The Trigger: A trade is only executed when price confirms the resumption of the trend by crossing back over the signal EMA after the pullback.
Key Features
Fixed Profit Targets: Replaced dynamic trailing stops with fixed Take Profit (TP) and Stop Loss (SL) levels based on ATR, ensuring exits aren't "hunted" by Gold's signature volatility spikes.
C lean Chart Interface : All moving average plots are hidden. The only visuals provided are the active TP/SL levels when a trade is live, keeping your workspace clutter-free.
Single-Trade Logic: The script includes a "One Trade Per Cross" gate, preventing the strategy from over-trading or "stacking" positions during choppy price action.
Settings & OptimizationATR Multipliers :
Stop Loss (SL): Default $2.0 \times ATR$. Protects against standard market noise.Take Profit (TP): Default $3.0 \times ATR$. Designed for a high Risk/Reward profile.Timeframe Recommendation: Optimized for 15m and 1H for swing scalping, or 5m for aggressive scalping.Instrument: Specifically tuned for Gold (XAU/USD), but applicable to other high-volatility pairs like GBP/JPY or NASDAQ.
Disclaimer
This script is for educational and backtesting purposes only. Past performance does not guarantee future results. Always practice proper risk management.
استراتيجية Pine Script®
UT Bot + Hull MA Close-Cross Confirm (Strategy)UT Bot + Hull MA Close-Cross Confirm (Strategy)
This strategy combines the classic UT Bot ATR trailing stop with a Hull Moving Average (HMA) close-cross confirmation to reduce false signals and improve trade quality.
The system works in two stages:
UT Bot Signal Detection
A volatility-adjusted ATR trailing stop identifies potential trend shifts using a 1-period EMA crossover. This provides early buy and sell signals based on momentum and volatility.
Hull MA Close-Cross Confirmation
UT Bot signals are only confirmed once price closes across the Hull Moving Average. If a UT signal occurs on the wrong side of the Hull MA, the strategy waits until a valid close-cross occurs before triggering an entry. This confirmation step helps filter chop and late-trend reversals.
Key Features
Non-repainting logic (uses bar-close confirmation)
Futures-friendly design (fixed contracts, point-based TP/SL)
Supports Long, Short, or Both directions
Built-in Take Profit & Stop Loss
Configurable Hull MA type (HMA / EHMA / THMA)
Optional Heikin Ashi signal source
Clean Buy/Sell alerts for automation and webhook execution
Trade Logic Summary
Long Entry:
UT Bot buy signal + confirmed close above Hull MA
Short Entry:
UT Bot sell signal + confirmed close below Hull MA
Exit:
Fixed Take Profit or Stop Loss (user-defined in points)
Alerts & Automation
The strategy includes dedicated Buy Alert and Sell Alert conditions designed for webhook automation (e.g., trade logging, execution engines, or external dashboards). Alerts trigger only on confirmed bar closes, matching backtest behavior.
Intended Use
This strategy is designed for futures markets (e.g., MNQ, ES, GC) and performs best on intraday timeframes. Session filters, risk rules, and trade management can be handled externally if desired.
Disclaimer
This script is provided for educational and research purposes only and is not financial advice. Always test thoroughly and use proper risk management.
استراتيجية Pine Script®
Bollinger Reversal + Swing ExitBollinger Reversal + Swing Exit is a mean-reversion strategy designed to capture short-term reversals when price stretches to an extreme and then shows the first signs of rejection.
1. Core idea
This strategy assumes that sharp deviations from a central equilibrium are often followed by a corrective move back toward normal pricing. It does not chase trends. Instead, it waits for price to reach an extreme area and then looks for a controlled turn back in the opposite direction.
2. Signal concept
A setup starts only after price reaches an outer extreme zone. The trade is taken only if the market immediately shows a reversal-type reaction rather than continuing to push outward. This reduces entries that happen too early while the move is still accelerating.
3. Long and short behavior
Long trades are allowed only after a downside extreme has been reached and price begins to recover.
Short trades are allowed only after an upside extreme has been reached and price begins to fade.
The goal is to enter close enough to the extreme to keep risk contained, while still requiring evidence that the turn has started.
4. Risk control
Risk is defined tightly. The protective stop is placed where the reversal thesis is clearly invalidated, so the strategy is built to accept small losses when the market does not revert and continues expanding in the same direction.
5. Exit logic
Profits are taken based on local market structure rather than fixed targets. Once in a position, the strategy looks for a clear exhaustion point in the move and closes the trade when the short-term swing structure signals that the rebound or pullback has likely completed. This aims to capture the core of the corrective move without overstaying.
6. Best conditions
This approach performs best in range-bound markets, during consolidations, and in instruments that frequently oscillate around a fair value. It is also useful after impulsive spikes when the move becomes overstretched and liquidity rebalances.
7. When to avoid
Avoid using it during strong, clean trends and during persistent breakout phases, where extremes can keep extending and reversals can fail repeatedly. In these conditions, mean-reversion setups can be systematically punished.
8. What to expect
Expect a higher trade frequency than trend-following systems, with many small-to-medium wins and occasional sharp losses when the market refuses to revert. The edge comes from disciplined entries only after extremes and quick exits when structure signals completion.
استراتيجية Pine Script®
Turtle Multi-Market StrategyTurtle Multi-Market Strategy is a breakout trend-following approach designed to stay aligned with the dominant market direction and participate only when price proves it has enough strength to escape consolidation.
1. Core idea
This strategy treats trends as permission and breakouts as proof.
The market must already show a clear directional bias before any trade is considered. Only when price is consistently positioned on the correct side of the dominant direction does the strategy become active. This avoids engagement during random price movement and low-quality conditions.
2. Entry logic
Trades are initiated only when price demonstrates expansion beyond a well-defined recent range, signaling that the market may be transitioning from consolidation to directional movement.
An optional confirmation behavior can be used to avoid reacting to isolated spikes. In this case, the strategy waits for additional price acceptance beyond the breakout area before committing, favoring reliability over immediacy.
3. Trend quality filter
The strategy can optionally require evidence of genuine trend strength before allowing entries. When this filter is active, breakouts occurring in weak or indecisive environments are ignored. This helps reduce exposure during sideways markets where breakouts are more likely to fail.
4. Risk and position sizing
Risk is handled dynamically. Trade size adapts to current market volatility so that risk remains proportional across different instruments and volatility regimes. This makes the strategy suitable for use on crypto, commodities, indices, and forex without manual recalibration for each market.
5. Exit and trade management
Exits are protective and progressive.
A protective stop defines the initial risk and then adjusts as price moves favorably. As the trend develops, the stop follows price action, aiming to lock in gains while still allowing room for natural pullbacks.
An additional safety mechanism can be enabled to exit if the market decisively re-enters the long-term equilibrium zone. This reduces exposure during sharp reversals but may also shorten otherwise valid trends.
6. How to use it
This strategy is best applied to liquid markets where sustained trends can emerge and where breakouts carry informational value, such as major crypto pairs, gold, indices, and liquid forex pairs.
It performs best during transitions from consolidation to expansion and during trending phases. It is not designed for mean-reverting or range-bound environments.
7. Practical workflow
Apply it on higher intraday or swing-oriented timeframes.
Keep the trend strength filter enabled in mixed or uncertain market conditions.
Use confirmation on instruments prone to false breakouts or during news-sensitive sessions.
If price repeatedly fails to sustain movement and returns to equilibrium, standing aside is part of correct execution.
8. What to expect
Expect fewer trades rather than constant activity. Many positions will end with small controlled losses, while profitable trades tend to come from sustained directional moves. The edge lies in participation during expansion phases, not in high win rates or frequent signals.
استراتيجية Pine Script®
EMA Trend Following Strategy🎯 EMA TREND FOLLOWING STRATEGY
A simple yet powerful trend-following strategy designed for 1-hour timeframes across multiple markets including cryptocurrencies, commodities, indices, and forex pairs.
📊 STRATEGY LOGIC
This strategy is based on the classic moving average crossover technique, one of the most reliable trend-following methods in technical analysis:
- LONG ENTRIES: When the fast EMA crosses above the slow EMA, indicating the beginning of an uptrend
- SHORT ENTRIES: When the fast EMA crosses below the slow EMA, indicating the beginning of a downtrend
- EXITS: Positions are closed when the opposite crossover occurs, capturing the trend reversal
🛡️ RISK MANAGEMENT
The strategy includes professional risk management features:
- Dynamic stop-loss based on market volatility
- Automatic position sizing to risk only a fixed percentage per trade
- Optional take-profit levels for securing gains
- Customizable risk parameters to fit your trading style
⚙️ RECOMMENDED SETTINGS
- Timeframe: 1 Hour (H1)
- Fast EMA: 20 periods
- Slow EMA: 50 periods
- Risk per trade: 1-2% of capital
- Stop-loss: 2x ATR (Average True Range)
💡 BEST USE CASES
This strategy works particularly well on:
✅ BTC/USD and major cryptocurrencies
✅ GOLD and precious metals
✅ S&P 500, NASDAQ, and major indices
✅ EUR/USD, GBP/USD and major forex pairs
⚠️ IMPORTANT NOTES
- Always backtest on your specific market before live trading
- Past performance does not guarantee future results
- Use appropriate position sizing and never risk more than you can afford to lose
- This strategy works best in trending markets
📈 Perfect for swing traders and those looking for a systematic approach to capture market trends!
استراتيجية Pine Script®
NexTrade Concept NTC Strategy v3.3 BTCNexTrade Concept NTC – Strategy v3.2 BTC
NexTrade Concept NTC – Strategy v3.2 BTC is a rule-based trading strategy developed for educational and analytical purposes, focused on BTC market behavior under structured, volatility-aware conditions.
This strategy is not a signal service and does not guarantee profitability. Its objective is to provide a systematic framework to study how market structure, volatility regimes, and risk-defined execution interact in Bitcoin environments.
Core Concept
The strategy is built around clean structural logic, prioritizing:
Directional bias via recent market structure (BOS / CHoCH logic)
Volatility filtering to avoid low-quality conditions
Risk-controlled execution using ATR-based stop validation
Premium / Discount contextual positioning
Displacement confirmation to avoid weak price movement
All entries are generated only when multiple independent conditions align, reducing noise and over-trading.
Key Components
Market Structure
Swing-based structure detection
Trend direction tracking
Recency filter to avoid outdated breaks
Volatility Regime Control
ATR mean comparison
Optional blocking of low-volatility environments
Cooldown system after position exits
Displacement Validation
Optional requirement of real price expansion
Body-to-ATR proportional confirmation
Risk & Execution Logic
Fixed percentage risk per trade
Dynamic position sizing based on stop distance
Predefined Risk-to-Reward framework
One-position-at-a-time logic (no pyramiding)
Important Notes
This script is intended for backtesting, research, and learning purposes only.
It does not provide financial advice.
Performance results depend on market conditions, execution settings, and user configuration.
Always validate any strategy in a simulated environment before considering real-world use.
Recommended Use
BTC-focused analysis
Intraday to swing timeframes
Study of volatility-adjusted structure-based trading
Strategy optimization and parameter research
استراتيجية Pine Script®
OFFSIDE Institutional Breakout Dynamic RRSL at the last HL or LH.
RR 1:2 for HOD or LOD breakout
RR: 1:3 for YH or YL breakout.
Risk: 0.5% per trade maximum 4 per day.
try it in all TF.
let me know.
made with IA help.
استراتيجية Pine Script®
First Strike ORB Strategy [BlackBelt Futures]My own personal take on the opening range breakout.
2:1RR, 45% win rate. Fully automated. DM for access.
استراتيجية Pine Script®
RSI Strategy with Auto Tuner (PF)# RSI Auto‑Tuner Strategy — How To Use
This document explains **how to use** the RSI Auto‑Tuner strategy. It intentionally avoids math and implementation details. Follow this as an operating guide.
---
## 1. What This Tool Is For
This strategy helps you:
* Discover **which RSI length works best** on a given ticker and timeframe
* Measure performance using **Profit Factor (PF)**
* Improve RSI performance on noisy markets by **transforming price first**
The auto‑tuner is a **research tool**, not a live trading signal generator.
---
## 2. Two Modes You Must Treat Differently
### Research Mode
Used to explore and discover parameters.
* Auto‑Tune: **ON**
* Parameters are allowed to change
* Results may look very good
* Overfitting risk is real
### Trading Mode
Used for forward testing or live trading.
* Auto‑Tune: **OFF**
* Parameters are fixed
* Behavior is stable and repeatable
* This is the only acceptable mode for live use
**Never trade live with Auto‑Tune enabled.**
---
## 3. Manual Mode (Trading Mode)
Use this after parameters are finalized.
Steps:
1. Set **Auto‑Tune = OFF**
2. Choose:
* Source (raw price or transformed price)
* RSI Length (manual, default 14)
* Oversold / Overbought levels
3. The strategy will:
* Enter long when RSI crosses up through Oversold
* Enter short when RSI crosses down through Overbought
* Flip positions on opposite signals
This mode is predictable and safe for forward testing.
---
## 4. Auto‑Tune Mode (Research Mode)
Use this to find optimal RSI lengths.
Steps:
1. Set **Auto‑Tune = ON**
2. Configure the search range:
* Minimum Length (default 5)
* Maximum Length (default 14)
* Step Size (default 1)
3. The strategy will:
* Internally simulate trades for each RSI length
* Track gross profit, gross loss, and trades
* Select the length with the highest Profit Factor
4. The best length is applied automatically
Auto‑Tune evaluates historical data only.
---
## 5. Using a Transform on Price (Critical)
RSI does **not** have to run on raw price.
You can significantly improve results by:
* Applying a **price transform** first
* Feeding the transformed series into the RSI Source input
Examples of transforms:
* Moving averages
* Low‑pass filters
* Butterworth filters
* Any smoother or denoiser
Why this works:
* Busy, wicky markets cause RSI to whipsaw
* Transforms remove micro‑noise
* RSI responds to structure instead of chaos
* Profit Factor often increases dramatically
Best practice:
* Auto‑tune on raw price
* Auto‑tune on transformed price
* Compare PF, trade count, and stability
---
## 6. Reading the Status Label
At the last bar, the on‑chart label shows:
* Whether Auto‑Tune is ON or OFF
* Whether candidates were built successfully
* Number of RSI lengths tested
* Best RSI length found
* Profit Factor and trade count
If Auto‑Tune is OFF, the label shows the manual length.
---
## 7. Recommended Workflow
1. Choose ticker and timeframe
2. Enable Auto‑Tune on **raw price**
3. Record best RSI length and PF
4. Enable Auto‑Tune on **transformed price**
5. Compare results
6. Lock parameters
7. Disable Auto‑Tune
8. Forward test
---
## 8. Warnings and Discipline
* High PF with few trades is unreliable
* Transforms can hide execution costs
* Always validate on a different period
* Auto‑Tune is a **lens**, not an edge
Treat this tool as a research microscope, not an autopilot.
استراتيجية Pine Script®
Prop ES EMA Cross during Single/Dual Trading SessionEMA crossover strategy for ES futures optimized for prop firm rules.
Choose long-only, short-only, or both directions.
Customizable short and long EMA lengths.
Enter trades during one or two configurable sessions specified in New York time.
Fixed TP/SL in ticks with forced close by 4:59 PM NY time.
استراتيجية Pine Script®
EMA 1 & SALMA Intersection StrategyTrading Strategy: EMA 1 & SALMA Crossover System
This strategy is a Trend-Following system that focuses on the direct interaction between the price (represented by EMA 1) and a smoothed trendline (SALMA). Instead of relying on the color changes of the indicator, it uses mechanical crossover signals to enter and exit trades.
1. Indicators Used
EMA 1 (Exponential Moving Average): Since the period is 1, it effectively represents the Current Price. It reacts instantly to every market move.
SALMA v3.0 (Smoothed Adaptive Lattice Moving Average): A double-smoothed moving average that acts as the "Base Line" or "Trend Support/Resistance."
RSI (Relative Strength Index): Used as a Momentum Filter to ensure we don't trade against the market's strength.
2. Buy (Long) Entry Rules
You enter a Long position when the following conditions are met:
The Crossover: The EMA 1 (Price) crosses ABOVE the SALMA line. This indicates that the short-term momentum is shifting higher than the average trend.
The Filter (RSI): The RSI must be above 50. This confirms that the buyers are in control and the upward move has enough strength.
3. Sell (Short) Entry Rules
You enter a Short position when the following conditions are met:
The Crossunder: The EMA 1 (Price) crosses BELOW the SALMA line. This indicates a breakdown in price action.
The Filter (RSI): The RSI must be below 50. This confirms that the sellers are dominating and the downward momentum is real.
4. Key Advantages of This System
Objectivity: You don't guess based on the color of the line; you wait for a clear physical break (cross) of the line.
Precision: By using EMA 1, you get the earliest possible entry signal compared to slower moving averages.
False Signal Protection: The RSI 50 filter prevents you from entering "weak" trades where the price crosses the line but lacks the volume or momentum to continue.
استراتيجية Pine Script®
Adoptive Conditional range High/Low MA Crossover StrategyDeveloped from the doctoral research of Abu-Kadunagra at ****** University's in Australia, this strategy implements a "Campaign-Based Adaptive Execution" framework. It moves beyond simple entries and exits by treating each market engagement as a multi-phase campaign with distinct operational states. The system intelligently identifies cyclical turning points, then employs a feedback-driven approach to capital allocation—reinforcing successful momentum with pyramiding while deploying controlled defensive averaging during temporary setbacks. By anchoring its exit mechanism to dynamically updated market structure rather than static profit targets, the algorithm seeks to capture cyclical momentum while maintaining disciplined risk parameters. This research-driven approach represents an evolution toward state-aware algorithmic systems that adapt their tactics in real-time based on market phase recognition.
استراتيجية Pine Script®
Conditional-range High/Low adoptive-MA Crossover StrategyDeveloped from the doctoral research of Abu-Kadunagra at ****** University on topic of Digital Finance and Crypto in Australia, this strategy implements a "Campaign-Based Adaptive Execution" framework. It moves beyond simple entries and exits by treating each market engagement as a multi-phase campaign with distinct operational states. The system intelligently identifies cyclical turning points, then employs a feedback-driven approach to capital allocation—reinforcing successful momentum with pyramiding while deploying controlled defensive averaging during temporary setbacks. By anchoring its exit mechanism to dynamically updated market structure rather than static profit targets, the algorithm seeks to capture cyclical momentum while maintaining disciplined risk parameters. This research-driven approach represents an evolution toward state-aware algorithmic systems that adapt their tactics in real-time based on market phase recognition.
استراتيجية Pine Script®
VuManChu Strategy [ADX + Vol + Risk] - Good for BTC- The strategy uses the VuManChu WaveTrend oscillator
- Before entering any trade, the ADX filter must show a reading above 25. For more reliable momentum moves
- Three-Layer Exit System:
Fixed Stop Loss (3%): Hard stop placed 3% below entry for longs (above for shorts) to limit maximum loss per trade. This accommodates typical BTC 5-minute volatility without premature stopouts.
Take Profit Target (9%): Fixed profit target at 9% providing a 1:3 risk-reward ratio. This means you only need a 40-50% win rate to be profitable overall.
Conditional Trailing Stop: The most sophisticated protection - a trailing stop that only activates after the trade reaches 4.5% profit (halfway to target). Once activated, it trails price by 2%, locking in gains while still allowing the trade to reach the full 9% target.
استراتيجية Pine Script®
KSE-100 PSX Long Strategy by KadunagraDeveloped from a academic part of the doctoral research of Kadunagra on digital finance and automation at **** University in Australia, this strategy implements a "Campaign-Based Adaptive Execution" framework. It moves beyond simple entries and exits by treating each market engagement as a multi-phase campaign with distinct operational states. The system intelligently identifies cyclical turning points, then employs a feedback-driven approach to capital allocation—reinforcing successful momentum with pyramiding while deploying controlled defensive averaging during temporary setbacks. By anchoring its exit mechanism to dynamically updated market structure rather than static profit targets, the algorithm seeks to capture cyclical momentum while maintaining disciplined risk parameters. This research-driven approach represents an evolution toward state-aware algorithmic systems that adapt their tactics in real-time based on market phase recognition.
استراتيجية Pine Script®
OCC Strategy Optimized (MA 5 + Delayed TSL)# OCC Strategy Optimized (MA 5 + Delayed TSL) - User Guide
## Introduction
The **OCC Strategy Optimized** is an enhanced version of the classic **Open Close Cross (OCC)** strategy. This strategy is designed for high-precision trend following, utilizing the crossover logic of Open and Close moving averages to identify market shifts. This optimized version incorporates advanced risk management, multi-timeframe analysis, and a variety of moving average types to provide a robust trading solution for modern markets.
>
> **Special Thanks:** This strategy is based on the original work of **JustUncleL**, a renowned Pine Script developer. You can find their work and profile on TradingView here: (in.tradingview.com).
---
## Key Features
### 1. Optimized Core Logic
- **MA Period (Default: 5):** The strategy is tuned with a shorter MA length to reduce lag and capture trends earlier.
- **Crossing Logic:** Signals are generated when the Moving Average of the **Close** crosses the Moving Average of the **Open**.
### 2. Multi-Timeframe (MTF) Analysis
- **Alternate Resolution:** Use a higher timeframe (Resolution Multiplier) to filter out noise. By default, it uses $3 \times$ your current chart timeframe to confirm the trend.
- **Non-Repainting:** Includes an optional delay offset to ensure signals are confirmed and do not disappear (repaint) after the bar closes.
### 3. Advanced Risk Management
This script features a hierarchical exit system to protect your capital and lock in profits:
- **Fixed Stop Loss (Initial):** Protects against sudden market reversals immediately after entry.
- **Delayed Trailing Stop Loss (TSL):**
- **Activation Delay:** The TSL only activates after the trade reaches a specific profit threshold (e.g., 1%). This prevents being stopped out too early in the trade's development.
- **Ratchet Trail:** Once activated, the stop loss "ratchets" up/down, never moving backward, ensuring you lock in profits as the trend continues.
- **Take Profit (TP):** A fixed percentage target to exit the trade at a pre-defined profit level.
### 4. Versatility
- **12 MA Types:** Choose from SMA, EMA, DEMA, TEMA, WMA, VWMA, SMMA, HullMA, LSMA, ALMA, SSMA, and TMA.
- **Trade Direction:** Toggle between Long-only, Short-only, or Both.
- **Visuals:** Optional bar coloring to visualize the trend directly on the candlesticks.
---
## User Input Guide
### Core Settings
- **Use Alternate Resolution?:** Enable this to use the MTF logic.
- **Multiplier for Alternate Resolution:** How many charts higher the "filter" timeframe should be.
- **MA Type:** Select your preferred moving average smoothing method.
- **MA Period:** The length of the Open/Close averages.
- **Delay Open/Close MA:** Use `1` or higher to force non-repainting behavior.
### Risk Management Settings
- **Use Trailing Stop Loss?:** Enables the TSL system.
- **Trailing Stop %:** The distance the stop follows behind the price (Optimized Default: 1.5%).
- **TSL Activation % (Delay):** The profit % required before the TSL starts moving. (Optimized Default: 2.0% to ensure 0.5% profit is locked immediately).
- **Initial Fixed Stop Loss %:** Your hard stop if the trade immediately goes against you.
- **Take Profit %:** Your ultimate profit target for the trade.
---
## How to Trade with This Strategy
1. **Identify the Trend:** Look for the Moving Average lines (Close vs Open) to cross.
2. **Wait for Confirmation:** If using MTF, ensure the higher timeframe also shows a trend change.
3. **Manage the Trade:** Let the TSL work. With the default **2.0% Activation** and **1.5% Trail**, the strategy will automatically lock in **0.5% profit** the moment the threshold is hit, then follow the price higher.
4. **Position Sizing:** Adjust the `Properties` tab in the script settings to match your desired capital allocation (Default is 10% of equity).
---
## Recommended Settings
1. Trialing < Activation
2. Check ranging
## Credits
Original Strategy by: **JustUncleL**
Optimized and Enhanced by: **Antigravity AI**
استراتيجية Pine Script®
Butterworth LPF Flip + AutoTune (PF)Butterworth LPF Flip + AutoTune (PF)
This strategy trades price trend flips using two Butterworth low-pass filters (a FAST filter and a SLOW filter). A trade is taken when the FAST filter crosses the SLOW filter. Optionally, the script can auto-tune the filter lengths by simulating many Fast/Slow combinations and selecting the pair with the best Profit Factor (PF).
What the Script Does
- Computes two 2‑pole Butterworth low‑pass filters on price.
- Enters LONG when FAST crosses above SLOW.
- Enters SHORT when FAST crosses below SLOW.
- Optionally simulates many Fast/Slow length combinations internally.
- Chooses the Fast/Slow pair with the highest Profit Factor.
- Trades only the selected best pair.
Manual Mode (Default)
1. Leave Auto‑Tune OFF.
2. Set:
- FAST cutoff period (bars)
- SLOW cutoff period (bars)
3. The strategy will trade using only these values.
Use this mode for normal trading or live deployment.
Auto‑Tune Mode
1. Enable Auto‑Tune.
2. Define Fast and Slow ranges:
- FAST min / max / step
- SLOW min / max / step
3. The script simulates ALL Fast × Slow combinations bar‑by‑bar.
4. Each combination tracks:
- Gross Profit
- Gross Loss
- Closed trades
- Profit Factor (PF = GP / GL)
5. At the end of the chart, the best PF pair is selected and used for trading.
Interpreting the End Box
The status label at the end of the chart reports:
- Whether Auto‑Tune is enabled
- Number of candidate pairs tested
- Best FAST period
- Best SLOW period
- Profit Factor of the best pair
- Win Rate (wins ÷ closed trades)
If PF is near 1.0 or trades are very low, expand the range or length of the test.
Best Practices
- Use Auto‑Tune ONLY for research and optimization.
- After finding good parameters, disable Auto‑Tune and trade manually.
- Keep Fast < Slow (logical separation).
- Longer charts produce more reliable PF results.
- Avoid very small step sizes (performance + noise).
Known Limitations
- Pine Script runs bar‑by‑bar; tuning is approximate, not vectorized.
- Large grids increase execution time.
- Results are historical and NOT predictive.
- Not suitable for live auto‑optimization.
Summary
This script is best viewed as a *research tool first, strategy second*. Use it to discover stable Fast/Slow regimes, then lock them in for simple, repeatable trading.
استراتيجية Pine Script®






















