OPEN-SOURCE SCRIPT
Trend Vector Pro v2.0

Title: Trend Vector Pro v2.0
👨💻 Developed by: Mohammed Bedaiwi
💡 Strategy Overview & Coherence
Trend Vector Pro (TVPro) is a momentum-based trend & reversal strategy that uses a custom smoothed oscillator, an optional ADX filter, and classic Pivot Points to create a single, coherent trading framework.
Instead of stacking random indicators, TVPro is built around these integrated components:
All parts are designed to work together and are documented below to address originality & usefulness requirements.
🔍 Core Components & Justification
1. Custom Momentum Engine (Main Signal Source)
TVPro’s engine is a custom oscillator derived from the bar midpoint ([code]hl2[/code]), similar in spirit to the Awesome Oscillator but adapted and fully integrated into the strategy. It measures velocity and acceleration of price, letting the script distinguish between strong impulses, weakening trends, and pure noise.
2. ADX Filter (Trend Strength Validation – Optional)
Uses Average Directional Index (ADX) as a gatekeeper.
Why this matters: This prevents the strategy from firing signals in choppy, non-trending environments (when ADX is below the threshold) and keeps trades focused on periods of clear directional strength.
3. Classic Pivot Points (Context & Targets)
Calculates Daily Pivot Points ([code]PP, R1-R3, S1-S3[/code]) via [code]request.security()[/code] using prior session data.
Why this matters: Momentum gives the signal, ADX validates the environment, and Pivots add external structure for risk and target planning. This is a designed interaction, not a random mashup.
🧭 Trend State Logic (5-State Bar Coloring)
The strategy uses the momentum's value + slope to define five states, turning the chart into a visual momentum map:
🎯 Signal Logic Modes
TVPro provides two selectable entry styles, controlled by input:
📌 Risk Management Tools
⚙️ Strategy Defaults (Crucial for Publication Compliance)
To keep backtest results realistic and in line with House Rules, TVPro is published with the following fixed default settings:
📘 How to Trade with Trend Vector Pro
🛑 Disclaimer
👨💻 Developed by: Mohammed Bedaiwi
💡 Strategy Overview & Coherence
Trend Vector Pro (TVPro) is a momentum-based trend & reversal strategy that uses a custom smoothed oscillator, an optional ADX filter, and classic Pivot Points to create a single, coherent trading framework.
Instead of stacking random indicators, TVPro is built around these integrated components:
- A custom momentum engine (signal generation)
- An optional ADX filter (trend quality control)
- Daily Pivot Points (context, targets & S/R)
- Swing-based “Golden Bar” trailing stops (trade management)
- Optional extended bar detection (overextension alerts)
All parts are designed to work together and are documented below to address originality & usefulness requirements.
🔍 Core Components & Justification
1. Custom Momentum Engine (Main Signal Source)
TVPro’s engine is a custom oscillator derived from the bar midpoint ([code]hl2[/code]), similar in spirit to the Awesome Oscillator but adapted and fully integrated into the strategy. It measures velocity and acceleration of price, letting the script distinguish between strong impulses, weakening trends, and pure noise.
2. ADX Filter (Trend Strength Validation – Optional)
Uses Average Directional Index (ADX) as a gatekeeper.
Why this matters: This prevents the strategy from firing signals in choppy, non-trending environments (when ADX is below the threshold) and keeps trades focused on periods of clear directional strength.
3. Classic Pivot Points (Context & Targets)
Calculates Daily Pivot Points ([code]PP, R1-R3, S1-S3[/code]) via [code]request.security()[/code] using prior session data.
Why this matters: Momentum gives the signal, ADX validates the environment, and Pivots add external structure for risk and target planning. This is a designed interaction, not a random mashup.
🧭 Trend State Logic (5-State Bar Coloring)
The strategy uses the momentum's value + slope to define five states, turning the chart into a visual momentum map:
- 🟢 STRONG BULL (Bright Green): Momentum accelerating UP. → Strong upside impulse.
- 🌲 WEAK BULL (Dark Green): Momentum decelerating DOWN (while positive). → Pullback/pause zone.
- 🔴 STRONG BEAR (Bright Red): Momentum accelerating DOWN. → Strong downside impulse.
- 🍷 WEAK BEAR (Dark Red): Momentum decelerating UP (while negative). → Rally/short-covering zone.
- 🔵 NEUTRAL / CHOP (Cyan): Momentum is near zero (based on noise threshold). → Consolidation / low volatility.
🎯 Signal Logic Modes
TVPro provides two selectable entry styles, controlled by input:
- Reversals Only (Cleaner Mode – Default): Targets trend flips. Entry triggers when the current state is Bullish (or Bearish) and the previous state was not. This reduces noise and over-trading.
- All Strong Pulses (Aggressive Mode): Targets acceleration phases. Entry triggers when the bar turns to STRONG BULL or STRONG BEAR after any other state. This mode produces more trades.
📌 Risk Management Tools
- Golden Bars – Trailing Stops: Yellow “Trail” Arrows mark confirmed Swing Highs/Lows. These are used as logical trailing stop levels based on market structure.
- Extended Bars: Detects when price closes outside a 2-standard-deviation channel, flagging overextension where a pullback is more likely.
- Pivot Points: Used as external targets for Take Profit and structural stop placement.
⚙️ Strategy Defaults (Crucial for Publication Compliance)
To keep backtest results realistic and in line with House Rules, TVPro is published with the following fixed default settings:
- Order Size:5% of equity per trade ([code]default_qty_value = 5[/code])
- Commission:0.04% per order ([code]commission_value = 0.04[/code])
- Slippage:2 ticks ([code]slippage = 2[/code])
- Initial Capital: 10,000
📘 How to Trade with Trend Vector Pro
- Entry: Take Long when a Long signal appears and confirm the bar is Green (Bull state). Short for Red (Bear state).
- Stop Loss: Place the initial SL near the latest swing High/Low, or near a relevant Pivot level.
- Trade Management: Follow Golden (Trail) Arrows to trail your stop behind structure.
- Exits: Exit when: the trailing stop is hit, Price reaches a major Pivot level, or an opposite signal prints.
🛑 Disclaimer
This script is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Always forward-test and use proper risk management before applying any strategy to live trading.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.