OPEN-SOURCE SCRIPT
Strategy Chameleon [theUltimator5]

Have you ever looked at an indicator and wondered to yourself "Is this indicator actually profitable?" Well now you can test it out for yourself with the Strategy Chameleon!
Strategy Chameleon is a versatile, signal-agnostic trading strategy designed to adapt to any external indicator or trading system. Like a chameleon changes colors to match its environment, this strategy adapts to match any buy/sell signals you provide, making it the ultimate backtesting and automation tool for traders who want to test multiple strategies without rewriting code.
🎯 Key Features
1) Connects ANY external indicator's buy/sell signals
2) Multiple Stop Loss Types:
3) Advanced Trailing Stop System:
4) Flexible Take Profit Options:
5) Trading Direction Control
6) Time-Based Filtering
📈 How It Works
⚙️ Setup Instructions
0) Add indicator you want to test, then add the Strategy to your chart
Connect Your Signals:
https://imgur.com/a/UX6fiIz
Go to strategy settings → Signal Sources
1) Set "Buy Signal Source" to your indicator's buy output
2) Set "Sell Signal Source" to your indicator's sell output
3) Choose table position - This simply changes the table location on the screen
4) Set trading direction preference - Buy only? Sell only? Both directions?
https://imgur.com/a/k8fXEbe
5) Set your preferred stop loss type and level
You can set the stop loss to be either percentage based or ATR and fully configurable.
6) Enable trailing stops if desired
https://imgur.com/a/ycnfxcw
7) Configure take profit settings
8) Toggle time filter to only consider specific time windows or trading sessions.
🚀 Use Cases
Portfolio Management
Automation Ready
⚠️ Important Notes
This strategy requires external signals to function
Default settings use 10% of equity per trade
Pyramiding is disabled (one position at a time)
Strategy calculates on bar close, not every tick
🔗 Integration Examples
Works perfectly with:
RSI strategies (connect RSI > 70 for sells, RSI < 30 for buys)
Moving average crossovers
MACD signal line crosses
Bollinger Band strategies
Custom oscillators and indicators
Multi-timeframe strategies
📋 Default Settings
Position Size: 10% of equity
Stop Loss: 2% percentage-based
Trailing Stop: 1.5% percentage-based (enabled)
Take Profit: Disabled (optional)
Trade Direction: Both long and short
Time Filter: Disabled
Strategy Chameleon is a versatile, signal-agnostic trading strategy designed to adapt to any external indicator or trading system. Like a chameleon changes colors to match its environment, this strategy adapts to match any buy/sell signals you provide, making it the ultimate backtesting and automation tool for traders who want to test multiple strategies without rewriting code.
🎯 Key Features
1) Connects ANY external indicator's buy/sell signals
- Works with RSI, MACD, moving averages, custom indicators, or any Pine Script output
- Simply connect your indicator's signal output to the strategy inputs
2) Multiple Stop Loss Types:
- Percentage-based stops
- ATR (Average True Range) dynamic stops
- Fixed point stops
3) Advanced Trailing Stop System:
- Percentage trailing
- ATR-based trailing
- Fixed point trailing
4) Flexible Take Profit Options:
- Risk:Reward ratio targeting
- Percentage-based profits
- ATR-based profits
- Fixed point profits
5) Trading Direction Control
- Long Only - Bull market strategies
- Short Only - Bear market strategies
- Both - Full market strategies
6) Time-Based Filtering
- Optional trading session restrictions
- Customize active trading hours
- Perfect for day trading strategies
📈 How It Works
- Signal Detection: The strategy monitors your connected buy/sell signals
- Entry Logic: Executes trades when signals trigger during valid time periods
- Risk Management: Automatically applies your chosen stop loss and take profit levels
- Trailing System: Dynamically adjusts stops to lock in profits
- Performance Tracking: Real-time statistics table showing win rate and performance
⚙️ Setup Instructions
0) Add indicator you want to test, then add the Strategy to your chart
Connect Your Signals:
https://imgur.com/a/UX6fiIz
Go to strategy settings → Signal Sources
1) Set "Buy Signal Source" to your indicator's buy output
2) Set "Sell Signal Source" to your indicator's sell output
3) Choose table position - This simply changes the table location on the screen
4) Set trading direction preference - Buy only? Sell only? Both directions?
https://imgur.com/a/k8fXEbe
5) Set your preferred stop loss type and level
You can set the stop loss to be either percentage based or ATR and fully configurable.
6) Enable trailing stops if desired
https://imgur.com/a/ycnfxcw
7) Configure take profit settings
8) Toggle time filter to only consider specific time windows or trading sessions.
🚀 Use Cases
- Test various indicators to determine feasibility and/or profitability.
- Compare different signal sources quickly
- Validate trading ideas with consistent risk management
Portfolio Management
- Apply uniform risk management across different strategies
- Standardize stop loss and take profit rules
- Monitor performance consistently
Automation Ready
- Built-in alert conditions for automated trading
- Compatible with trading bots and webhooks
- Easy integration with external systems
⚠️ Important Notes
This strategy requires external signals to function
Default settings use 10% of equity per trade
Pyramiding is disabled (one position at a time)
Strategy calculates on bar close, not every tick
🔗 Integration Examples
Works perfectly with:
RSI strategies (connect RSI > 70 for sells, RSI < 30 for buys)
Moving average crossovers
MACD signal line crosses
Bollinger Band strategies
Custom oscillators and indicators
Multi-timeframe strategies
📋 Default Settings
Position Size: 10% of equity
Stop Loss: 2% percentage-based
Trailing Stop: 1.5% percentage-based (enabled)
Take Profit: Disabled (optional)
Trade Direction: Both long and short
Time Filter: Disabled
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.