Range Filter Strategy [Real Backtest] by mfsz2015
By mfsz2015
Performance Metrics
- Author: mfsz2015
- Symbol: CAPITALCOM:GOLD
- Timeframe: 15 minutes
- Net P&L: +141.69 USD (+0.01%)
- Win Rate: 55.2%
- Profit Factor: 2.231
- Max Drawdown: 18.26 USD (0.00%)
- Total Trades: 96
- Sharpe Ratio: −96.392
Description
Range Filter Strategy - Real Backtesting# OverviewAdvanced Range Filter strategy designed for realistic backtesting with precise execution timing and comprehensive risk management. Built specifically for cryptocurrency markets with customizable parameters for different assets and timeframes.Core AlgorithmRange Filter Technology:- Smooth Average Range calculation using dual EMA filtering- Dynamic range-based price filtering to identify trend direction- Anti-noise filtering system to reduce false signals- Directional momentum tracking with upward/downward countersKey FeaturesReal-Time Execution (No Delay)- Process orders on tick: Immediate execution without waiting for bar close- Bar magnifier integration for intrabar precision- Calculate on every tick for maximum responsiveness- Standard OHLC bypass for enhanced accuracyRealistic Price Simulation- HL2 entry pricing (High+Low)/2 for realistic fills- Configurable spread buffer simulation- Random slippage generation (0 to max slippage)- Market liquidity validation before entryAdvanced Signal Filtering- Volume-based filtering with customizable ratio- Optional signal confirmation system (1-3 bars)- Anti-repetition logic to prevent duplicate signals- Daily trade limit controlsRisk Management- Fixed Risk:Reward ratios with precise point calculation- Automatic stop loss and take profit execution- Position size management- Maximum daily trades limitationAlert System- Real-time alerts synchronized with strategy execution- Multiple alert types: Setup, Entry, Exit, Status- Customizable message formatting with price/time inclusion- TradingView alert panel integrationDefault ParametersOptimized for BTC 5-minute charts:- Sampling Period: 100- Range Multiplier: 3.0- Risk: 50 points- Reward: 100 points (1:2 R:R)- Spread Buffer: 2.0 points- Max Slippage: 1.0 pointsSignal LogicLong Entry Conditions:- Price above Range Filter line- Upward momentum confirmed- Volume requirements met (if enabled)- Confirmation period completed (if enabled)- Daily trade limit not exceededShort Entry Conditions:- Price below Range Filter line- Downward momentum confirmed- Volume requirements met (if enabled)- Confirmation period completed (if enabled)- Daily trade limit not exceededVisual Elements- Range Filter line with directional coloring- Upper and lower target bands- Entry signal markers- Risk/Reward ratio boxes- Real-time settings dashboardCustomization OptionsMarket Adaptation:- Adjust Sampling Period for different timeframes- Modify Range Multiplier for various volatility levels- Configure spread/slippage for different brokers- Set appropriate R:R ratios for trading styleFiltering Controls:- Enable/disable volume filtering- Adjust confirmation requirements- Set daily trade limits- Customize alert preferencesPerformance Features- Realistic backtesting results aligned with live trading- Elimination of look-ahead bias- Proper order execution simulation- Comprehensive trade statisticsAlert ConfigurationAlert Types Available:- Entry signals with complete trade information- Setup alerts for early preparation- Exit notifications for position management- Filter direction changes for market contextMessage Format:Symbol - Action | Price: XX.XX | Stop: XX.XX | Target: XX.XX | Time: HH:MMUsage RecommendationsOptimal Settings:- Bitcoin/Major Crypto: Default parameters- Forex: Reduce sampling period to 50-70, multiplier to 2.0-2.5- Stocks: Reduce sampling period to 30-50, multiplier to 1.0-1.8- Gold: Sampling period 60-80, multiplier 1.5-2.0TradingView Configuration:- Recalculate: "On every tick"- Orders: "Use bar magnifier"- Data: Real-time feed recommendedRisk DisclaimerThis strategy is designed for educational and analytical purposes. Past performance does not guarantee future results. Always test thoroughly on paper trading before live implementation. Consider market conditions, broker execution, and personal risk tolerance when using any automated trading system.Best Settings Found for Gold 15-Minute TimeframeAfter extensive testing and optimization, these are the most effective settings I've discovered for trading Gold (XAUUSD) on the 15-minute timeframe:Core Filter Settings:Sampling Period: 100Range Multiplier: 3.0Professional Execution Engine:Realistic Entry: Enabled (HL2)Spread Buffer: 2 pointsDynamic Slippage: Enabled with max 1 pointVolume Filter: Enabled at 1.7x ratioSignal Confirmation: Enabled with 1 bar confirmationRisk Management:Stop Loss: 50 pointsTake Profit: 100 points (2:1 Risk-Reward)Max Trades Per Day: 5These settings provide an excellent balance between signal accuracy and realistic market execution. The volume filter at 1.7x ensures we only trade during periods of sufficient market activity, while the 1-bar confirmation helps filter out false signals. The spread buffer and slippage settings account for real trading costs, making backtest results more realistic and achievable in live trading.