PROTECTED SOURCE SCRIPT

Signal Tester EN [Abusuhil]

111
Signal Tester [Abusuhil] - Complete Description
Overview
Signal Tester is a comprehensive trading tool designed to backtest and analyze external trading signals with advanced risk management capabilities. The indicator provides seven different calculation methods for stop-loss and take-profit levels, along with detailed performance statistics and real-time tracking of active trades.
Important Disclaimer: This indicator is a tool for analysis and education purposes only. Past performance does not guarantee future results. Trading involves substantial risk of loss and is not suitable for all investors. Always conduct your own research and consider seeking advice from a qualified financial advisor before making trading decisions.

Key Features

7 Calculation Methods for customizable risk management
External Signal Integration via any oscillator or indicator
Real-time Trade Tracking with visual entry/exit points
Comprehensive Statistics Table showing win rate, profit/loss, and active trades
Date Filtering for focused backtesting periods
Custom Alerts for new buy signals
Multi-Target System with up to 5 take-profit levels


How to Use
Step 1: Connect External Signal
The indicator requires an external signal source to generate buy signals.

Add your preferred indicator to the chart (RSI, MACD, Stochastic, custom indicator, etc.)
In Signal Tester settings, locate "External Indicator" input
Click the input and select your indicator's plot line
Buy signals are generated when the external source crosses above zero

Example: If using RSI, connect the RSI line. A buy signal triggers when RSI crosses above the zero reference (if plotted as oscillator).

Step 2: Choose Your Calculation Method
Select one of seven methods under "Calculation Method":
1. Percentage %
The simplest method using fixed percentage values.
Settings:

Stop Loss %: Distance from entry to stop-loss (default: 2%)
Target 1-5 %: Distance from entry to each take-profit level

Example: Entry at $100

Stop Loss (2%): $98
Target 1 (2%): $102
Target 2 (4%): $104

Best For: Beginners, markets with consistent volatility

2. ATR Multiplier
Uses Average True Range for dynamic levels based on market volatility.
Settings:

ATR Period: Calculation period (default: 14)
Stop Multiplier: ATR multiplier for stop-loss (default: 1.5)
Target Multipliers: ATR multipliers for each take-profit

Example: Entry at $100, ATR = $2

Stop Loss (1.5x ATR): $100 - $3 = $97
Target 1 (2x ATR): $100 + $4 = $104

Best For: Volatile markets, adapting to changing conditions

3. Risk:Reward Ratio
Calculates targets based on risk-to-reward ratios.
Settings:

Stop Loss %: Initial risk percentage
Target Ratios: R:R ratio for each target (1:1.5, 1:2, 1:3, etc.)

Example: Entry at $100, Stop at $98 (2% risk = $2)

Target 1 (1:1.5): $100 + ($2 × 1.5) = $103
Target 2 (1:2): $100 + ($2 × 2) = $104
Target 3 (1:3): $100 + ($2 × 3) = $106

Best For: Traders focused on risk management and position sizing

4. Swing High/Low
Places stop-loss at recent swing low with targets as multiples of the risk.
Settings:

Swing Lookback Candles: Number of bars to find swing low (default: 5)
Stop Safety Distance %: Buffer below swing low
Target Multipliers: Risk multiples for each target

Example: Entry at $105, Swing Low at $100

Stop Loss: $100 - 0.1% = $99.90 (risk = $5.10)
Target 1 (1.5x): $105 + ($5.10 × 1.5) = $112.65

Best For: Swing traders, respecting market structure

5. Partial Take Profit
Sells portions of the position at each target level, moving stop to entry after first target.
Settings:

Stop Loss %: Initial stop distance
Target 1-5 %: Price levels for partial exits
Sell % at TP1-4: Percentage of position to close at each level

Example: 100% position, 50% sell at each target

TP1 hit: Sell 50%, remaining 50%, stop moves to entry
TP2 hit: Sell 25% (50% of remaining), remaining 25%
TP3 hit: Sell 12.5%, remaining 12.5%

Best For: Conservative traders, locking in profits gradually

6. Trailing Stop
Similar to Partial Take Profit but trails the stop-loss to each achieved target.
Settings:

Stop Loss %: Initial stop distance
Target 1-5 %: Price levels for trailing stops
Sell % at TP1-4: Percentage to close at each level

Example:

TP1 ($102) hit: Sell 50%, stop trails to $102
TP2 ($104) hit: Sell 25%, stop trails to $104
Price retraces to $104: Exit with locked profits

Best For: Trend followers, maximizing profit in strong moves

7. Smart Exit
Advanced method that moves stop to entry after first target, then exits based on technical conditions.
Settings:

Stop Loss %: Initial stop distance
First Target %: When hit, stop moves to breakeven
Exit Method: Choose from 8 exit strategies

Exit Methods:

Close < EMA 21: Exits when price closes below 21-period EMA
Close < MA 20: Exits when price closes below 20-period Moving Average
Supertrend Flip: Exits when Supertrend indicator flips bearish
ATR Trailing Stop: Dynamic trailing stop based on ATR
MACD Crossover: Exits on MACD bearish crossover
RSI < 50: Exits when RSI drops below specified level
Parabolic SAR Flip: Exits when SAR flips above price
Bollinger Bands: Exits when price closes below middle or lower band

Best For: Advanced traders, letting winners run with protection

Date Filtering
Control which trades are included in backtesting.
Filter Types:

Specific Date: Only trades after selected date
Number of Weeks: Last X weeks (default: 12)
Number of Months: Last X months (default: 3)

How to Enable:

Check "Enable Date Filter"
Select filter type
Set the date or number of weeks/months

Use Case: Test strategy performance in recent market conditions or specific periods

Understanding the Statistics Table
The table displays the last 10 trades plus comprehensive statistics:
Trade Columns:

#: Trade number
Entry: Entry price
Stop: Current stop-loss level
TP1-TP5: Checkmarks (✅) when targets are hit
Profit %: Realized profit for the trade
Max %: Maximum unrealized profit reached (⬆️ indicates active trade)
Status:

🔄 Active trade
✅ Closed winner
❌ SL - Stopped out



Summary Row:

Total: Number of trades executed
Period: Duration of trading period (Years, Months, Days)

Statistics Row:

W: Number of winning trades
L: Number of losing trades
A: Number of active (open) trades
Win Rate %: (Wins / Total Trades) × 100

Performance Row:

Profit: Total profit from all winning trades
Loss: Total loss from all losing trades
Net: Net profit/loss (Profit - Loss)


Visual Elements
When a buy signal triggers, the indicator draws:

Blue Line: Entry price
Red Line: Stop-loss level
Green Lines: Take-profit levels (up to 5)
Green Label: Trade number below the entry bar
Green Triangle: Buy signal marker


Alerts
The indicator includes customizable alerts for new buy signals.
Setting Up Alerts:

Click the "⏰" icon in TradingView
Select "Signal Tester [Abusuhil]"
Choose condition: "Buy"
Configure notification preferences (popup, email, webhook)
Click "Create"

Alert Message Format:
🚀 New Buy Signal!
Price: [Entry Price]
Trade #: [Trade Number]

Best Practices

Backtest First: Test each calculation method on historical data before live trading
Match Timeframe: Use the indicator on the timeframe you plan to trade
Combine with Analysis: Use alongside support/resistance, trend analysis, and other tools
Risk Management: Never risk more than 1-2% of capital per trade
Review Statistics: Regularly check win rate and profit/loss metrics
Adjust Settings: Optimize parameters based on the asset's volatility and your risk tolerance


Limitations

Requires external signal source (does not generate signals independently)
Backtesting assumes perfect entry/exit execution (real trading includes slippage)
Past performance does not guarantee future results
Should be used as one component of a complete trading strategy


Version Information

Version: 1.0
Pine Script Version: v5
Type: Overlay Indicator
Author: Abusuhil


Support and Updates
This indicator is provided as-is for educational and analytical purposes. Users are responsible for their own trading decisions and should thoroughly test any strategy before implementing it with real capital.

Risk Warning: Trading financial instruments carries a high level of risk and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade, you should carefully consider your investment objectives, level of experience, and risk appetite. Only trade with money you can afford to lose.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.