OPEN-SOURCE SCRIPT
Hilly's Advanced Crypto Scalping Strategy - 5 Min Chart

To determine the "best" input parameters for the Advanced Crypto Scalping Strategy on a 5-minute chart, we need to consider the goals of optimizing for profitability, minimizing false signals, and adapting to the volatile nature of cryptocurrencies. The default parameters in the script are a starting point, but the optimal values depend on the specific cryptocurrency pair, market conditions, and your risk tolerance. Below, I'll provide recommended input values based on common practices in crypto scalping, along with reasoning for each parameter. I’ll also suggest how to fine-tune them using TradingView’s backtesting and optimization tools.
Recommended Input Parameters
These values are tailored for a 5-minute chart for liquid cryptocurrencies like BTC/USD or ETH/USD on exchanges like Binance or Coinbase. They aim to balance signal frequency and accuracy for day trading.
Fast EMA Length (emaFastLen): 9
Reasoning: A 9-period EMA is commonly used in scalping to capture short-term price movements while remaining sensitive to recent price action. It reacts faster than the default 10, aligning with the 5-minute timeframe.
Slow EMA Length (emaSlowLen): 21
Reasoning: A 21-period EMA provides a good balance for identifying the broader trend on a 5-minute chart. It’s slightly longer than the default 20 to reduce noise while confirming the trend direction.
RSI Length (rsiLen): 14
Reasoning: The default 14-period RSI is a standard choice for momentum analysis. It works well for detecting overbought/oversold conditions without being too sensitive on short timeframes.
RSI Overbought (rsiOverbought): 75
Reasoning: Raising the overbought threshold to 75 (from 70) reduces false sell signals in strong bullish trends, which are common in crypto markets.
RSI Oversold (rsiOversold): 25
Reasoning: Lowering the oversold threshold to 25 (from 30) filters out weaker buy signals, ensuring entries occur during stronger reversals.
MACD Fast Length (macdFast): 12
Reasoning: The default 12-period fast EMA for MACD is effective for capturing short-term momentum shifts in crypto, aligning with scalping goals.
MACD Slow Length (macdSlow): 26
Reasoning: The default 26-period slow EMA is a standard setting that works well for confirming momentum trends without lagging too much.
MACD Signal Smoothing (macdSignal): 9
Reasoning: The default 9-period signal line is widely used and provides a good balance for smoothing MACD crossovers on a 5-minute chart.
Bollinger Bands Length (bbLen): 20
Reasoning: The default 20-period Bollinger Bands are effective for identifying volatility breakouts, which are key for scalping in crypto markets.
Bollinger Bands Multiplier (bbMult): 2.0
Reasoning: A 2.0 multiplier is standard and captures most price action within the bands. Increasing it to 2.5 could reduce signals but improve accuracy in highly volatile markets.
Stop Loss % (slPerc): 0.8%
Reasoning: A tighter stop loss of 0.8% (from 1.0%) suits the high volatility of crypto, helping to limit losses on false breakouts while keeping risk manageable.
Take Profit % (tpPerc): 1.5%
Reasoning: A 1.5% take-profit target (from 2.0%) aligns with scalping’s goal of capturing small, frequent gains. Crypto markets often see quick reversals, so a smaller target increases the likelihood of hitting profits.
Use Candlestick Patterns (useCandlePatterns): True
Reasoning: Enabling candlestick patterns (e.g., engulfing, hammer) adds confirmation to signals, reducing false entries in choppy markets.
Use Volume Filter (useVolumeFilter): True
Reasoning: The volume filter ensures signals occur during high-volume breakouts, which are more likely to sustain in crypto markets.
Signal Arrow Size (signalSize): 2.0
Reasoning: Increasing the arrow size to 2.0 (from 1.5) makes buy/sell signals more visible on the chart, especially on smaller screens or volatile price action.
Background Highlight Transparency (bgTransparency): 85
Reasoning: A slightly higher transparency (85 from 80) keeps the background highlights subtle but visible, avoiding chart clutter.
How to Apply These Parameters
Copy the Script: Use the Pine Script provided in the previous response.
Paste in TradingView: Open TradingView, go to the Pine Editor, paste the code, and click "Add to Chart."
Set Parameters: In the strategy settings, manually input the recommended values above or adjust them via the input fields.
Test on a 5-Minute Chart: Apply the strategy to a liquid crypto pair (e.g., BTC/USDT, ETH/USDT) on a 5-minute chart.
Fine-Tuning for Optimal Performance
To find the absolute best parameters for your specific trading pair and market conditions, use TradingView’s Strategy Tester and optimization features:
Backtesting:
Run the strategy on historical data for your chosen pair (e.g., BTC/USDT on Binance).
Check metrics like Net Profit, Profit Factor, Win Rate, and Max Drawdown in the Strategy Tester.
Focus on a sample period of at least 1–3 months to capture various market conditions (bull, bear, sideways).
Parameter Optimization:
In the Strategy Tester, click the settings gear next to the strategy name.
Enable optimization for key inputs like emaFastLen (test range: 7–12), emaSlowLen (15–25), slPerc (0.5–1.5), and tpPerc (1.0–3.0).
Run the optimization to find the combination with the highest net profit or best Sharpe ratio, but avoid over-optimization (curve-fitting) by testing on out-of-sample data.
Market-Specific Adjustments:
Volatile Pairs (e.g., DOGE/USDT): Use tighter stop losses (e.g., 0.5–0.7%) and smaller take-profit targets (e.g., 1.0–1.2%) to account for rapid price swings.
Stable Pairs (e.g., BTC/USDT): Slightly wider stop losses (e.g., 1.0–1.2%) and take-profit targets (e.g., 1.8–2.5%) may work better.
Trending Markets: Increase emaSlowLen (e.g., to 25–30) to follow stronger trends.
Choppy Markets: Tighten bbMult (e.g., to 1.8) and lower rsiOverbought/rsiOversold (e.g., to 70/30) to filter noise.
Forward Testing:
After backtesting, run the strategy in real-time on a demo account for 1–2 weeks to validate performance under current market conditions.
Important Notes
No Universal "Best" Numbers: Optimal parameters vary by crypto pair, exchange, and market conditions (e.g., bull vs. bear market). The suggested values are a starting point based on common scalping practices.
Risk Management: Never risk more than 1–2% of your account per trade. Adjust position sizing in TradingView’s strategy settings to align with your risk tolerance.
Market Volatility: Crypto markets are highly volatile. Test the strategy on your specific pair and adjust parameters if signals are too frequent or too rare.
Not Financial Advice: This is an educational tool. Backtest thoroughly and use a demo account before trading with real funds.
If you want me to generate a chart showing backtest performance for specific parameters or to tweak the script further (e.g., adding more indicators or adjusting signal logic), let me know!can you add clear buy ans sell signs above the candles in this codeTo add clear buy and sell signals above the candles in the provided Pine Script, I'll modify the existing code to include prominent text labels directly above (for sell signals) and below (for buy signals) the candles. These labels will be larger, color-coded, and positioned to avoid clutter, ensuring they are easily visible on the chart. The core strategy logic (EMA, RSI, MACD, Bollinger Bands, candlestick patterns, and volume filter) will remain unchanged, and I'll reuse the same artifact_id since this is an update to the previous script.AdvancedCryptoScalpingStrategy.pinex-pine
Recommended Input Parameters
These values are tailored for a 5-minute chart for liquid cryptocurrencies like BTC/USD or ETH/USD on exchanges like Binance or Coinbase. They aim to balance signal frequency and accuracy for day trading.
Fast EMA Length (emaFastLen): 9
Reasoning: A 9-period EMA is commonly used in scalping to capture short-term price movements while remaining sensitive to recent price action. It reacts faster than the default 10, aligning with the 5-minute timeframe.
Slow EMA Length (emaSlowLen): 21
Reasoning: A 21-period EMA provides a good balance for identifying the broader trend on a 5-minute chart. It’s slightly longer than the default 20 to reduce noise while confirming the trend direction.
RSI Length (rsiLen): 14
Reasoning: The default 14-period RSI is a standard choice for momentum analysis. It works well for detecting overbought/oversold conditions without being too sensitive on short timeframes.
RSI Overbought (rsiOverbought): 75
Reasoning: Raising the overbought threshold to 75 (from 70) reduces false sell signals in strong bullish trends, which are common in crypto markets.
RSI Oversold (rsiOversold): 25
Reasoning: Lowering the oversold threshold to 25 (from 30) filters out weaker buy signals, ensuring entries occur during stronger reversals.
MACD Fast Length (macdFast): 12
Reasoning: The default 12-period fast EMA for MACD is effective for capturing short-term momentum shifts in crypto, aligning with scalping goals.
MACD Slow Length (macdSlow): 26
Reasoning: The default 26-period slow EMA is a standard setting that works well for confirming momentum trends without lagging too much.
MACD Signal Smoothing (macdSignal): 9
Reasoning: The default 9-period signal line is widely used and provides a good balance for smoothing MACD crossovers on a 5-minute chart.
Bollinger Bands Length (bbLen): 20
Reasoning: The default 20-period Bollinger Bands are effective for identifying volatility breakouts, which are key for scalping in crypto markets.
Bollinger Bands Multiplier (bbMult): 2.0
Reasoning: A 2.0 multiplier is standard and captures most price action within the bands. Increasing it to 2.5 could reduce signals but improve accuracy in highly volatile markets.
Stop Loss % (slPerc): 0.8%
Reasoning: A tighter stop loss of 0.8% (from 1.0%) suits the high volatility of crypto, helping to limit losses on false breakouts while keeping risk manageable.
Take Profit % (tpPerc): 1.5%
Reasoning: A 1.5% take-profit target (from 2.0%) aligns with scalping’s goal of capturing small, frequent gains. Crypto markets often see quick reversals, so a smaller target increases the likelihood of hitting profits.
Use Candlestick Patterns (useCandlePatterns): True
Reasoning: Enabling candlestick patterns (e.g., engulfing, hammer) adds confirmation to signals, reducing false entries in choppy markets.
Use Volume Filter (useVolumeFilter): True
Reasoning: The volume filter ensures signals occur during high-volume breakouts, which are more likely to sustain in crypto markets.
Signal Arrow Size (signalSize): 2.0
Reasoning: Increasing the arrow size to 2.0 (from 1.5) makes buy/sell signals more visible on the chart, especially on smaller screens or volatile price action.
Background Highlight Transparency (bgTransparency): 85
Reasoning: A slightly higher transparency (85 from 80) keeps the background highlights subtle but visible, avoiding chart clutter.
How to Apply These Parameters
Copy the Script: Use the Pine Script provided in the previous response.
Paste in TradingView: Open TradingView, go to the Pine Editor, paste the code, and click "Add to Chart."
Set Parameters: In the strategy settings, manually input the recommended values above or adjust them via the input fields.
Test on a 5-Minute Chart: Apply the strategy to a liquid crypto pair (e.g., BTC/USDT, ETH/USDT) on a 5-minute chart.
Fine-Tuning for Optimal Performance
To find the absolute best parameters for your specific trading pair and market conditions, use TradingView’s Strategy Tester and optimization features:
Backtesting:
Run the strategy on historical data for your chosen pair (e.g., BTC/USDT on Binance).
Check metrics like Net Profit, Profit Factor, Win Rate, and Max Drawdown in the Strategy Tester.
Focus on a sample period of at least 1–3 months to capture various market conditions (bull, bear, sideways).
Parameter Optimization:
In the Strategy Tester, click the settings gear next to the strategy name.
Enable optimization for key inputs like emaFastLen (test range: 7–12), emaSlowLen (15–25), slPerc (0.5–1.5), and tpPerc (1.0–3.0).
Run the optimization to find the combination with the highest net profit or best Sharpe ratio, but avoid over-optimization (curve-fitting) by testing on out-of-sample data.
Market-Specific Adjustments:
Volatile Pairs (e.g., DOGE/USDT): Use tighter stop losses (e.g., 0.5–0.7%) and smaller take-profit targets (e.g., 1.0–1.2%) to account for rapid price swings.
Stable Pairs (e.g., BTC/USDT): Slightly wider stop losses (e.g., 1.0–1.2%) and take-profit targets (e.g., 1.8–2.5%) may work better.
Trending Markets: Increase emaSlowLen (e.g., to 25–30) to follow stronger trends.
Choppy Markets: Tighten bbMult (e.g., to 1.8) and lower rsiOverbought/rsiOversold (e.g., to 70/30) to filter noise.
Forward Testing:
After backtesting, run the strategy in real-time on a demo account for 1–2 weeks to validate performance under current market conditions.
Important Notes
No Universal "Best" Numbers: Optimal parameters vary by crypto pair, exchange, and market conditions (e.g., bull vs. bear market). The suggested values are a starting point based on common scalping practices.
Risk Management: Never risk more than 1–2% of your account per trade. Adjust position sizing in TradingView’s strategy settings to align with your risk tolerance.
Market Volatility: Crypto markets are highly volatile. Test the strategy on your specific pair and adjust parameters if signals are too frequent or too rare.
Not Financial Advice: This is an educational tool. Backtest thoroughly and use a demo account before trading with real funds.
If you want me to generate a chart showing backtest performance for specific parameters or to tweak the script further (e.g., adding more indicators or adjusting signal logic), let me know!can you add clear buy ans sell signs above the candles in this codeTo add clear buy and sell signals above the candles in the provided Pine Script, I'll modify the existing code to include prominent text labels directly above (for sell signals) and below (for buy signals) the candles. These labels will be larger, color-coded, and positioned to avoid clutter, ensuring they are easily visible on the chart. The core strategy logic (EMA, RSI, MACD, Bollinger Bands, candlestick patterns, and volume filter) will remain unchanged, and I'll reuse the same artifact_id since this is an update to the previous script.AdvancedCryptoScalpingStrategy.pinex-pine
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.