OPEN-SOURCE SCRIPT
Güncellendi

Buysell Martingale Signal - Custom

1 660
Buysell Martingale Signal - Custom Indicator

Introduction:
This indicator provides a dynamic buy and sell signal system incorporating an adaptive Martingale logic. Built upon the signalLib_yashgode9/2 library, it is designed for use across various markets and timeframes.

Key Features:
Primary Buy & Sell Signals: Identifies initial buy and sell opportunities based on directional changes derived from the signalLib.
Martingale Signals:
For Short (Sell) Positions: A Martingale Sell signal is triggered when the price moves against the existing short position by a specified stepPercent from the last entry price, indicating a potential opportunity to average down or increase position size.
For Long (Buy) Positions: Similarly, a Martingale Buy signal is triggered when the price moves against the existing long position by a stepPercent from the last entry price.
On-Chart Labels: Displays clear, customizable labels on the chart for primary Buy, Sell, Martingale Buy, and Martingale Sell signals.
Customizable Colors: Allows users to set distinct colors for primary signals and Martingale signals for better visual distinction.
Adjustable Sensitivity: Features configurable parameters (DEPTH_ENGINE, DEVIATION_ENGINE, BACKSTEP_ENGINE) to fine-tune the sensitivity of the underlying signal generation.
Webhook Support (Static Message Alerts): This indicator provides alerts with static messages for both primary and Martingale buy/sell signals. These alerts can be leveraged for automation by external systems (such as trading bots or exchange-provided Webhook Signal Trading services).
Important Note: When using these alerts for automation, an external system is required to handle the complex Martingale logic and position management (e.g., tracking steps, PnL calculation, hedging, dynamic quantity sizing), as this indicator solely focuses on signal generation and sending predefined messages.
How to Use:
Add the indicator to your desired chart.
Adjust the input parameters in the indicator's settings to match your specific trading symbol and timeframe.
For automation, you can set up TradingView alerts for the Buy Signal (Main/Martingale) and Sell Signal (Main/Martingale) conditions, pointing them to your preferred Webhook URL.
Configurable Parameters:
DEPTH_ENGINE: (e.g., 30) Controls the depth of analysis for the signal algorithm.
DEVIATION_ENGINE: (e.g., 5) Defines the allowable deviation for signal generation.
BACKSTEP_ENGINE: (e.g., 5) Specifies the number of historical bars to look back.
Martingale Step Percent: (e.g., 0.5) The percentage price movement against the current position that triggers a Martingale signal.
Labels Transparency: Adjusts the transparency of the on-chart signal labels.
Buy-Color / Sell-Color: Sets the color for primary Buy and Sell signal labels.
Martingale Buy-Color / Martingale Sell-Color: Sets the color for Martingale Buy and Sell signal labels.
Label size: Controls the visual size of the labels.
Label Offset: Adjusts the vertical offset of the labels from the candlesticks.
Risk Warning:
Financial trading inherently carries significant risk. Martingale strategies are particularly high-risk and can lead to substantial losses or even complete liquidation of capital if the market moves strongly and persistently against your position. Always backtest thoroughly and practice with a demo account, fully understanding the associated risks, before engaging with real capital.
Sürüm Notları
📘 Indicator Description – Version 1.1 (5-Minute Timeframe)

This indicator offers a robust and flexible Buy/Sell signal system with optional Martingale logic, built on the powerful `signalLib_yashgode9/2` engine. Designed for short-term strategies, this version is optimized for use on the **5-minute timeframe** — making it ideal for scalpers and high-frequency traders.

⚙️ Current Settings (v1.1):
- Timeframe Focus: 5-minute
- DEPTH_ENGINE: 350
- DEVIATION_ENGINE: 5
- BACKSTEP_ENGINE: 5
- Martingale Step Percent: 0
- Label Size: 4
- Label Offset: 0.0005
- Label Transparency: 20
- Show Buy Signals: OFF ❌
- Show Sell Signals: OFF ❌
- Show Martingale Signals: ON ✅

🔍 Functionality Overview:
• **Martingale Signal Logic (Active)**:
This version focuses purely on Martingale signals. When price moves in the opposite direction of the previous entry by the configured Martingale Step Percent, a Martingale Buy or Sell signal is triggered. These help traders identify opportunities for cost-averaging or risk-adjusted re-entries in volatile markets.

• **Primary Buy/Sell Signals (Disabled)**:
Standard directional buy/sell signals are disabled in this setup to reduce clutter and focus solely on Martingale logic.

• **On-Chart Signal Labels**:
Only Martingale signals (Buy and Sell) are plotted on the chart with customizable label size, offset, and transparency for a cleaner and more focused trading view.

• **Webhook Alert Support**:
Static message alerts are available for Martingale signals, allowing traders to integrate with bots, trading automation platforms, or external webhook services.

• **Highly Configurable Sensitivity**:
Fine-tune how signals are generated with these parameters:
- `DEPTH_ENGINE`: Defines how deep the signal logic analyzes past data.
- `DEVIATION_ENGINE`: Sets the acceptable variation before triggering a signal.
- `BACKSTEP_ENGINE`: Determines how far back in history the engine looks to confirm patterns.

📈 Usage Guide:
1. Apply the indicator to a 5-minute chart on TradingView.
2. Adjust sensitivity settings depending on asset volatility.
3. Set up alerts for Martingale Buy/Sell signals using TradingView’s alert system with your webhook URL.
4. Use the output for manual monitoring or connect to an automated strategy that handles Martingale execution.

⚠️ Risk Warning:
This indicator does not perform any trades and only provides signal alerts. Martingale trading is inherently high-risk due to the compounding nature of the strategy. If not managed properly, it can lead to substantial drawdown or full liquidation. Always test thoroughly in simulation before using real capital. External systems are required to manage PnL, capital scaling, and safety logic — this tool is signal-only.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.